fix(pytorch_xdit): use an inactivity timeout, clean up on failure, verify artifacts - #322
Open
speriaswamy-amd wants to merge 1 commit into
Conversation
…rify artifacts Three defects in the benchmark run step, all confirmed on a live MI300X node. Wall-clock timeout killed healthy runs. exec_cmd_list(docker_cmds, timeout=1800) is a total read cap that activity does not reset, so a legitimate run was killed at exactly 1800s while still inside torch.compile warmup — rocm-smi showed all 8 GPUs at 100% and ~131GB VRAM each, i.e. computing, not hung. Left alone, the same container finished normally ~13 minutes later and produced all 5 steps and video.mp4. Switching to inactivity_timeout=1800 measures silence between output lines instead, so a run that keeps logging is never killed, while a genuine hang still fails within 30 minutes. The value is kept at 1800 because the silent gap between shard loading and the first compile log ranged from ~5 to 15+ minutes across nodes; 300s and 900s both produced false kills. Timeout orphaned a GPU-holding container. When the call raised, the test failed but the container it started kept running — `docker ps` showed it Up and holding all 8 GPUs indefinitely. test_cleanup_stale_containers only runs at the start of the next session, so on a shared node every timeout leaks a container. The except branch now calls docker_lib.kill_docker_container before failing. A clean log was treated as success. The run step only scanned container output for error strings; a run that logged nothing alarming but wrote no artifacts passed here and failed confusingly in the parse step. Both benchmarks now verify the expected artifacts exist and are non-empty (timing.json plus a flux_*.png for FLUX; a rank0_step*.json plus video.mp4 for WAN) on every node. LocalPssh gains a matching inactivity path so single-node local runs behave the same as SSH runs: a reader thread feeds a queue and the process is killed only after inactivity_timeout seconds with no line. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 9 of 12 in a stack that replaces #184. Base: #321.
Three defects in the benchmark run step, all confirmed on a live MI300X node.
Wall-clock timeout killed healthy runs
exec_cmd_list(docker_cmds, timeout=1800)is a total read cap that activity does not reset. A legitimate run was killed at exactly 1800s while still insidetorch.compilewarmup —rocm-smishowed all 8 GPUs at 100% and ~131GB VRAM each, i.e. computing, not hung. Left alone, the same container finished normally ~13 minutes later and produced all 5 steps andvideo.mp4.Now
inactivity_timeout=1800, which measures silence between output lines: a run that keeps logging is never killed, a genuine hang still fails within 30 minutes. Kept at 1800 because the silent gap between shard loading and the first compile log ranged from ~5 to 15+ minutes across nodes; 300s and 900s both produced false kills.Timeout orphaned a GPU-holding container
When the call raised, the test failed but the container it started kept running —
docker psshowed itUpand holding all 8 GPUs indefinitely.test_cleanup_stale_containersonly runs at the start of the next session, so on a shared node every timeout leaks a container. Theexceptbranch now callsdocker_lib.kill_docker_containerbefore failing.A clean log was treated as success
The run step only scanned container output for error strings; a run that logged nothing alarming but wrote no artifacts passed here and failed confusingly in the parse step. Both benchmarks now verify the expected artifacts exist and are non-empty (
timing.json+ aflux_*.png; arank0_step*.json+video.mp4) on every node.LocalPsshgains a matching inactivity path so single-node local runs behave the same as SSH runs.