Repository navigation
[3/11] Run release-marked tests on nightly and on-demand GPU runs - #2847
Draft
shengliangxu wants to merge 3 commits into
Draft
shengliangxu wants to merge 3 commits into
shengliangxu wants to merge 3 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
shengliangxu
added this pull request to stack #2856
October 17, 2026 01:41
This was referenced Oct 17, 2026
This was referenced Oct 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## shengliangx/ci-2-coverage #2847 +/- ##
=============================================================
- Coverage 78.91% 78.90% -0.02%
=============================================================
Files 658 658
Lines 73649 73649
=============================================================
- Hits 58122 58114 -8
- Misses 15527 15535 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
/ok to test 9c2eebb |
shengliangxu
removed this pull request from stack #2856
October 17, 2026 06:58
Tests marked `release` collect only when pytest gets --run-release, and no workflow passes it, so a test marked `release` never runs in CI (the docs say the same of the example release suite). Set PYTEST_ADDOPTS=--run-release in the "Run gpu tests" step for every run that is not a pull-request run: the nightly schedule and manual dispatches. That lets slow or network-heavy checks leave the pull-request jobs without leaving CI. Pull-request runs are unchanged. Nothing under tests/gpu* is marked release yet; the next commit marks the first test. The release example suites (hf_ptq/test_deploy.py, gpt-oss QAT) belong to example_tests.yml, which does not get the flag, so the docs sentence that said no workflow passes it now says no example workflow does. Testing: actionlint is clean. A stub test marked `release`, collected under the repo's tests/conftest.py, is skipped with "Only run when --run-release is given" when PYTEST_ADDOPTS is empty and runs when it is --run-release. The expression is `!startsWith(github.ref, 'refs/heads/pull-request/') && '--run-release' || ''`, which gives '' for a pull-request ref and '--run-release' otherwise. Not run on GitHub. Signed-off-by: Shengliang Xu <shengliangx@nvidia.com>
test_megatron_generate_and_mmlu[tp] builds a 28-layer Qwen3-0.6B Megatron model, downloads 1.2-1.5 GB of real weights into a fresh container cache and scores about 1,400 MMLU prompts: a 32 s call in every pull-request gpu_megatron job. It is the only test in the lane that downloads real weights. Mark it `release` so pytest skips it unless --run-release is given. The importer shape and name tests and the generate control-flow tests in the same module keep running on pull requests. This test is also the only one that checks real-weight accuracy (0.36 < MMLU < 0.39), so a numeric regression in the import or generation path is no longer caught on a pull request. The previous commit passes --run-release on the nightly and on-demand runs, so the real-weight accuracy check still runs there, a day after a change instead of on the pull request. Testing: ruff check and ruff format with the pinned ruff 0.15.20, and py_compile. Ran a stub module with the same decorators under the repo's tests/conftest.py on CPU: without the flag the four parametrized ids are skipped with "Only run when --run-release is given", with it they all run. Not run: the test itself, because this machine has no GPU and its Megatron is too old to import the module, and the flag on GitHub (the previous commit checked it with a stub test only). Signed-off-by: Shengliang Xu <shengliangx@nvidia.com>
test_get_dataset_dataloader_nemotron_v3_chat_template streams the seven gated Nemotron post-training v3 datasets from the Hub and applies a chat template: a 24 s call in the PR run (run 37703177445) that needs an HF token and the network, which also makes it a source of Hub flakes. It checks the live gated data, not modelopt logic: the combo expansion and sample distribution of get_dataset_dataloader are covered by the CPU unit tests in tests/unit/torch/utils/test_dataset_utils.py, which record the per-dataset calls instead of fetching. Mark it `release`. The nightly and on-demand gpu runs pass --run-release, so it still runs there every day, and it is skipped on pull requests. Testing: ruff check and format with the pinned ruff 0.15.20. Without the flag the test is skipped with "Only run when --run-release is given". Not run: the test itself or the nightly. Expected saving is about 24 s per pull-request gpu job. Signed-off-by: Shengliang Xu <shengliangx@nvidia.com>
shengliangxu
force-pushed
the
shengliangx/ci-3-release-tests
branch
from
October 17, 2026 07:02
9c2eebb to
dddb321
Compare
shengliangxu
added this pull request to stack #2859
October 17, 2026 07:02
Collaborator
Author
|
/ok to test dddb321 |
This branch has not been deployed
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.
What does this PR do?
Type of change: CI (test runtime)
Tests marked
releasecollect only when pytest gets--run-release, and no workflow passes it, so a test markedreleasenever runs in CI. This setsPYTEST_ADDOPTS=--run-releasein the "Run gpu tests" step for every run that is not a pull-request run (the nightly schedule and manual dispatches), which lets slow or network-heavy checks leave the pull-request jobs without leaving CI. Pull-request runs are unchanged by the flag itself. The expression is!startsWith(github.ref, 'refs/heads/pull-request/') && '--run-release' || ''. The release example suites (hf_ptq/test_deploy.py, gpt-oss QAT) belong toexample_tests.yml, which does not get the flag, so the docs sentence that said no workflow passes it now says no example workflow does.Two tests use it:
test_megatron_generate_and_mmlu[tp]builds a 28-layer Qwen3-0.6B Megatron model, downloads 1.2-1.5 GB of real weights into a fresh container cache and scores about 1,400 MMLU prompts: a 21-39 s call in every PR gpu_megatron job (21 s with the sysmon core of [2/11] Use the sysmon coverage core in CI #2846, 39 s without it), and the only test in the lane that downloads real weights.test_get_dataset_dataloader_nemotron_v3_chat_templatestreams the seven gated Nemotron post-training v3 datasets from the Hub (a 17-24 s call that needs an HF token and the network, and a source of Hub flakes). The combo expansion and sample distribution it goes through are covered by CPU unit tests that record the per-dataset calls.Trade-off: these two checks no longer run on pull requests. The real-weight accuracy check (0.36 < MMLU < 0.39) and the gated-data smoke test run every night and on demand, a day after a change instead of on the PR.
Time improvement (measured in CI)
Time of the module that holds the skipped test, from the per-test timestamps; before = the run of #2846, after = this PR's run and the runs above it that carry the change (median):
test_megatron_generate_and_mmlu[tp](21 s)test_get_dataset_dataloader_nemotron_v3_chat_template(17 s)So 22 s off the gpu_megatron job and 19 s off the gpu job of every PR run. The lane totals cannot show a change this small (gpu_megatron 1,212 -> 1,206 s, gpu 1,289 -> 1,351 s: their run-to-run spread is several times larger). The price is that the two checks run only on the nightly and on demand.
Method: every PR of the series has its own CI run, so "before" is the run of the PR(s) below that lack the change and "after" the runs that carry it. Times come from the job logs (
--durations, or the gap between consecutive result lines). Where runner speed matters, the tests that no PR of the series touches scale each run, and the raw and the scaled medians are both shown. One test varies by 15-30% from run to run on its own, so smaller differences are not evidence.Usage
pytest --run-releaseruns the release-marked tests locally.Testing
A stub test marked
release, collected under the repo'stests/conftest.py, is skipped with "Only run when --run-release is given" whenPYTEST_ADDOPTSis empty and runs with--run-release; the expression gives''for a pull-request ref and--run-releaseotherwise. Pre-commit and actionlint pass. Not run on a GPU here: the two tests themselves, and the flag on a nightly (this PR's GPU run shows both skipped on a pull request; a nightly, where they run, is what verifies the flag end to end).Before your PR is "Ready for review"
Make sure you read and follow Contributor guidelines and your commits are signed (
git commit -s -S).CONTRIBUTING.md: no new dependencyAdditional Information
Slice 3 of 11 of the GPU-CI speed-up work, split out of the reference draft #2730 (not for merge; it holds the whole series with its measurements). Merge in order; each PR stands on its own and passes CI without the later ones.