Skip to content

fix(pytorch_xdit): fail fast on missing image and on incomplete WAN caches - #321

Open
speriaswamy-amd wants to merge 1 commit into
speriaswamy/xdit-07-output-dir-labelsfrom
speriaswamy/xdit-08-preflight-and-cache-checks
Open

fix(pytorch_xdit): fail fast on missing image and on incomplete WAN caches#321
speriaswamy-amd wants to merge 1 commit into
speriaswamy/xdit-07-output-dir-labelsfrom
speriaswamy/xdit-08-preflight-and-cache-checks

Conversation

@speriaswamy-amd

Copy link
Copy Markdown
Contributor

Part 8 of 12 in a stack that replaces #184. Base: #320.

Why

Two preflight gaps, both of which turned a clear setup problem into a confusing downstream failure.

What changed

Missing container image. Neither benchmark checked that config.container_image was present locally before docker run. Both now call docker_lib.nodes_missing_docker_image() and fail with the node list and the docker pull command to fix it. WAN also gains the /dev/kfd check FLUX already had.

Incomplete WAN snapshot. Verification only ran test -d on the snapshot directory — which exists as soon as hf download starts, so a half-downloaded cache passed and the failure surfaced ~20 minutes later inside the container. New utils_lib.wan_hf_snapshot_offline_check_commands() returns per-file OK/MISSING shell checks for the Wan2.2-I2V-A14B layout: three config.json files, six >500MiB diffusion shards in each of the low/high-noise dirs, and size floors on the VAE and T5 weights so LFS pointer stubs do not count as present.

The checks use find -L. A hf_hub cache stores weights as symlinks into blobs/, so find without -L stats the link (tiny, type l) and reports zero shards for a fully correct cache. Verified against a real ~118GB download: without -L the low-noise shard count is 0, with -L it is 6.

They run in both staging modes (explicit host path and hf_home cache) and only when the repo id or path names Wan2.2-I2V-A14B, so other WAN forks and custom layouts are unaffected.

Unit test asserts the generated commands quote paths containing spaces and emit both branches.

…aches

Two preflight gaps, both of which turned a clear setup problem into a confusing
downstream failure.

Missing container image: neither benchmark checked that config.container_image
was present locally before `docker run`. Both now call
docker_lib.nodes_missing_docker_image() and fail with the node list and the
`docker pull` command to fix it. WAN also gains the /dev/kfd check FLUX already
had.

Incomplete WAN snapshot: verification only ran `test -d` on the snapshot
directory. That directory exists as soon as `hf download` starts, so a
half-downloaded cache passed verification and the failure surfaced 20 minutes
later inside the container. New utils_lib.wan_hf_snapshot_offline_check_commands()
returns per-file OK/MISSING shell checks for the Wan2.2-I2V-A14B layout: the
three config.json files, six >500MiB diffusion shards in each of the
low/high-noise directories, and size floors on the VAE and T5 weights so LFS
pointer stubs do not count as present.

The checks use `find -L`. A hf_hub cache stores weights as symlinks into
blobs/, so `find` without -L stats the link (tiny, type l) and reports zero
shards for a fully correct cache. Verified against a real ~118GB download:
without -L the low-noise shard count is 0, with -L it is 6.

They run in both staging modes (explicit host path and hf_home cache) and only
when the repo id or path names Wan2.2-I2V-A14B, so other WAN forks and
custom layouts are unaffected.

Adds a unit test asserting the generated commands quote paths containing
spaces and emit both OK and MISSING branches.

Co-Authored-By: Claude <noreply@anthropic.com>
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