Megatron CI improvement#143
Draft
sudhu2k wants to merge 8 commits into
Draft
Conversation
…d on rocm_dev branch
… management - Added `mock` to the list of Python dependencies in the Dockerfile. - Modified the Dockerfile to clone a specific version of `mamba` and install it, enhancing reproducibility. - Enhanced `run_unit_tests.sh` to classify test outcomes and organize logs into separate directories for passed and failed tests, improving log management and clarity.
- Changed the per-test timeout to 1 hour, allowing for longer test execution without premature termination. - Improved crash XML reporting by including a reason for timeouts, enhancing clarity in test outcomes. - Updated logging to reflect per-test timeout reasons, providing better insights into test failures. - Adjusted pytest invocation to ensure detailed output and proper timeout management for individual tests.
… logging - Replaced the existing outcome classification logic with a new function to count failures and errors from JUnit XML reports, enhancing accuracy in determining test results. - Updated logging to reflect the new classification method, ensuring clearer reporting of test outcomes, including handling of crashes and timeouts. - Improved organization of test logs by outcome, facilitating better management and analysis of test results.
- Introduced a retry mechanism for failed test files, allowing up to MAX_FILE_RETRIES attempts to pass before finalizing results. - Improved logging to indicate retries and outcomes for each test file, enhancing visibility into test execution. - Updated the script to clear previous artifacts before each test run, ensuring accurate results and preventing stale data interference. - Adjusted the handling of test outcomes to better classify and report failures, including timeouts and crashes.
…r for unexpected keys. Updated assertions to check for warning-level logs instead of empty log text, ensuring accurate capture of unexpected key warnings.
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.
Problem
The single
Build and Test on GPUjob has been flaky and operationally painful:torchrunforever, and the only timeout was the 12h job-leveltimeout-minutes: 720, so one stuck test stalled the entire run until it was force-cancelled.set -xtraced every shell command, and pytest ran with--showlocals --tb=long -v -s, dumping full local tensors, long tracebacks, and uncaptured per-rank stdout (including RCCL chatter). The reporting step also ranls -Rover the whole repo.dorny/test-reporteronly reads the JUnit XML. On a hard exit (SIGTERM from a timeout, segfault, RCCL abort, OOM, worker death), pytest never finishes writing the XML, so crashed files simply disappeared from the report even though the job failed.permissions:block forchecks: write.Changes
run_unit_tests.shset -x; keptset -u -o pipefail. Addedexport NCCL_DEBUG=WARNto cut RCCL/NCCL noise.timeout(--signal=SIGTERM --kill-after=60, default 1200s/20 min) so a deadlocked file is killed and the loop moves on instead of hanging the job.--timeout=900 --timeout-method=thread) that fires first and produces a traceback before the hard kill.output/pytest_<name>.log); the console now prints a single concise line per file ([PASS]/[FAIL]/[TIMEOUT]+ pytest's one-line summary).--showlocals,-v,-s; added--tb=short --capture=fd.--reruns 2 --reruns-delay 5.write_crash_xml: when a run dies hard (exit code not 0/1) or the JUnit XML is missing/empty, a valid synthetic JUnit file is emitted so the crash shows up as a red entry in the report (with exit code, a human label like SIGTERM/segfault/timeout, and the last 50 log lines).pytest/torchrunprocesses between files to avoid leaking GPU memory after a kill.Dockerfile_rocm.cipytest-timeoutandpytest-rerunfailuresto the pip install block..github/workflows/megatron-ci.ymlpermissions:block (contents: read,checks: write,pull-requests: write) so the test report check can publish.dorny/test-reporter@v1→@v3and setcollapsed: auto(collapse on all-pass, auto-expand on failure).output/pytest_*.logas artifacts alongside the JUnit/CSV reports.ls -Rwithls -R output.timeout-minutesfrom720to240.Impact