Skip to content

build: don't compress the repacked patched torch wheel - #212

Merged
janickm merged 1 commit into
NVIDIA:mainfrom
janickm:dev/janickm/ci-repack-stored
Oct 17, 2026
Merged

janickm merged 1 commit into
NVIDIA:mainfrom
janickm:dev/janickm/ci-repack-stored

Conversation

@janickm

@janickm janickm commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

The torch CUDA preload patch (pip.override in MODULE.bazel) makes rules_python unpack the 4 GB torch wheel, patch it and repack it, before extracting the repacked wheel right away. Repacking deflates every file, which takes ~150s and is most of the ~2 minutes CI spends fetching external repositories without visible progress (Analyzing: ... no actions running).

This adds a rules_python patch to store, instead of deflate, the files of repacked wheels. Nothing else changes: the patched files and the extracted repository are identical.

Measurements

Local cold fetch of all external repositories (bazel build ... --nobuild with a fresh output base and repository cache):

before this PR
cold fetch ~245s 78s

Testing

  • The repacked torch wheel is valid (zipfile.testzip), stored, and contains the patched torch/__init__.py.
  • MODULE.bazel.lock is unchanged (--lockfile_mode=error passes).
  • CI timing is compared against the previous runs below.

The torch CUDA preload patch (pip.override) makes rules_python unpack
the 4 GB torch wheel, patch it and repack it, only to extract the
repacked wheel right away. Repacking deflates every file, which takes
~150s and is most of the ~2 minutes Bazel spends fetching external
repositories without any visible progress on every CI run.

Patch rules_python to store the files of repacked wheels instead. A
cold fetch of all external repositories now takes 78s instead of ~245s.
@janickm
janickm merged commit dc91c12 into NVIDIA:main Oct 17, 2026
8 of 9 checks passed
@janickm
janickm deleted the dev/janickm/ci-repack-stored branch October 17, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant