Skip to content

[OMNIML-6180] Add a nightly test marker and use it for the example PR skips - #2982

Merged
shengliangxu merged 1 commit into
mainfrom
shengliangx/ci-nightly-marker-pr
Oct 23, 2026
Merged

shengliangxu merged 1 commit into
mainfrom
shengliangx/ci-nightly-marker-pr

Conversation

@shengliangxu

@shengliangxu shengliangxu commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change: CI (test selection)

Step 1 of 2 of the follow-up to a review note on #2925 ("make it generic like unit and gpu tests: pytest.mark.nightly for nightly ones and pytest.mark.manual for the ones we may want to skip in nightly CI too").

Test selection by tier was done three different ways: the unit and GPU workflows pass --run-manual off pull requests, so manual means "also nightly" there; the example workflow passes nothing, so manual means "never in CI" in tests/examples (the two eagle cases in test_eagle.py never run); and the llm_qat and torch_onnx example tests each decided "PR or not" themselves from GITHUB_REF (two copies of the same line). There was no way to say "nightly only" in a test.

This PR adds the nightly marker next to manual and release and uses it for the two example tests:

  • pyproject.toml registers the marker; tests/conftest.py gets --run-nightly and one entry in the existing marker/flag table.
  • The unit and GPU workflows pass --run-nightly with --run-manual off pull requests; the example action passes it when github.ref is not a pull-request/N ref (the same test hf_ptq uses for -n 4).
  • test_llm_qat.py: the three backend cases that only run nightly are pytest.mark.nightly params; the GITHUB_REF check and its os import are gone.
  • test_torch_quant_to_onnx.py: the three swinv2 cases that only run nightly are pytest.mark.nightly params of one flat (model_key, qformat) parametrization with the same ids and order as before; the in-test pytest.skip on GITHUB_REF is gone.
  • CONTRIBUTING.md names the two marks.

Behavior: pull-request runs and nightly runs select exactly the same tests as before. Local runs of those two example files now skip the six nightly cases unless --run-nightly is given (they used to run everything because GITHUB_REF is unset); that is what manual already does for its tests.

Step 2 (separate PR, needs the maintainers' agreement) makes the meaning uniform: the unit and GPU tests that are marked manual today but run nightly become nightly, the nightly workflows stop passing --run-manual, and manual means "never in CI" everywhere. It will be guarded by a before/after comparison of the nightly selection.

Usage

pytest tests/examples/llm_qat --run-nightly   # also run the nightly-marked cases
@pytest.mark.nightly                                          # skipped on PRs, runs in the scheduled and on-demand CI
pytest.param("deepspeed", marks=pytest.mark.nightly)          # one case of a parametrization

Testing

  • Collection of tests/examples/{llm_qat,torch_onnx,speculative_decoding} (156 tests) on main (67e7ac3) and on this branch under three setups, comparing which tests are not skipped by a mark: a PR run (GITHUB_REF=refs/heads/pull-request/7, no flags): 147 selected before and after, identical; a nightly run (GITHUB_REF=refs/heads/main, --run-nightly after): 153 before and after, identical; a local run (no GITHUB_REF, no flags): 153 before, 147 after, the difference being exactly the six nightly cases (test_qwen3_qat_nvfp4[ddp], test_qwen3_qat_nvfp4[deepspeed], test_qwen3_qad_nvfp4[deepspeed], test_torch_onnx[swinv2_tiny-int8], [swinv2_tiny-mxfp8], [swinv2_tiny-auto]). All 156 test ids are unchanged. The old torch_onnx skip happened inside the test, so for the "before" PR run those three ids were removed by hand.
  • --strict-markers collection passes with the new marker; --run-nightly appears in pytest --help; a CPU unit file runs with --run-nightly --run-manual.
  • YAML of the three changed workflow and action files parses; pre-commit passes.
  • This PR's own CI, PR side: llm_qat 13 passed / 4 skipped, torch_onnx 20 / 6, speculative_decoding 109 / 4, identical to the last run before the change ([OMNIML-6180] Run the small example lanes of a job together #2924's head). Not run: the nightly side (--run-nightly off pull-request/* refs); the first nightly after the merge shows it (the last one before: llm_qat 16 passed / 1 skipped, torch_onnx 23 / 3).
  • No test was added: the marker reuses the existing flag-gated skip loop in tests/conftest.py, and the example lanes exercise it.

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • Is this change backward compatible?: yes for CI; local runs of the six cases need --run-nightly (see Behavior)
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: no new dependency
  • Did you write any new necessary tests?: N/A (selection mechanism, covered by the example lanes)
  • Did you update Changelog?: N/A (CI and tests)
  • Did you get Claude approval on this PR?: N/A (not run yet)

Additional Information

Jira: [OMNIML-6180]. Follow-up (step 2): re-mark the unit and GPU manual tests that run nightly as nightly; 24 marks in 10 files today (unit 17 in 4 files, gpu 6 in 5, gpu_megatron 1 in 1); the 2 in tests/examples (the eagle cases that never run in CI) stay manual.

…on PRs

nightly tests are skipped unless --run-nightly is given, like manual and
release. The unit, GPU and example workflows pass it off pull requests, and the
llm_qat and torch_onnx example tests use it instead of checking GITHUB_REF
themselves (the torch_onnx cases keep their test ids). Local runs now skip
those cases unless --run-nightly is given.

Signed-off-by: Shengliang Xu <shengliangx@nvidia.com>
@shengliangxu
shengliangxu requested review from a team as code owners October 23, 2026 20:15
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 8aa5824 and eccea48.

📒 Files selected for processing: 8
  • .github/actions/run-example/action.yml
  • .github/workflows/gpu_tests.yml
  • .github/workflows/unit_tests.yml
  • CONTRIBUTING.md
  • pyproject.toml
  • tests/conftest.py
  • tests/examples/llm_qat/test_llm_qat.py
  • tests/examples/torch_onnx/test_torch_quant_to_onnx.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

The pull request adds a pytest nightly marker and --run-nightly option, marks selected example-test cases, and updates CI commands to enable nightly tests under specified event conditions.

Changes: Nightly test selection

Layer / File(s) Summary
Nightly marker and test cases
pyproject.toml, tests/conftest.py, tests/examples/llm_qat/*, tests/examples/torch_onnx/*, CONTRIBUTING.md
Pytest registers --run-nightly and skips tests marked nightly unless the option is supplied. Selected QAT backend cases and SwinV2 ONNX formats now use the marker. Contributor guidance describes the marker and option behavior.
CI nightly options
.github/actions/run-example/action.yml, .github/workflows/gpu_tests.yml, .github/workflows/unit_tests.yml
The example action passes --run-nightly outside pull-request refs. GPU tests pass it for non-push events, and Linux unit tests pass it for non-PR events.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Suggested reviewers: ajrasane

Merge Risk: ⚪ Minimal · up to eccea

The nightly selection change is mergeable after normal checks; no actionable risk remains established.

Pre-merge checks: Passed 5 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (5 skipped: 5… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: adding a nightly test marker and applying it to example tests previously skipped in pull requests.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns Passed PASS. The PR changes only test-selection code in tests/examples, tests/conftest.py, workflows, documentation, and pytest configuration. The added Python code contains no `torch.load(..., weights_o…
Full details: Security Anti-Patterns

Explanation

PASS. The PR changes only test-selection code in tests/examples, tests/conftest.py, workflows, documentation, and pytest configuration. The added Python code contains no torch.load(..., weights_only=False), numpy.load(..., allow_pickle=True), hardcoded trust_remote_code=True, external-input eval()/exec(), or # nosec. The pyproject.toml change registers a pytest marker and adds no PIP dependency.

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (5 skipped: 5 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.10%. Comparing base (5383d1a) to head (eccea48).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2982      +/-   ##
==========================================
- Coverage   79.50%   79.10%   -0.40%     
==========================================
  Files         660      660              
  Lines       74771    74771              
==========================================
- Hits        59448    59150     -298     
- Misses      15323    15621     +298     
Flag Coverage Δ
examples-diffusers 19.94% <ø> (-0.07%) ⬇️
examples-gpt-oss 13.47% <ø> (-0.03%) ⬇️
examples-hf_ptq 23.38% <ø> (-0.11%) ⬇️
examples-llm_distill 13.55% <ø> (-0.03%) ⬇️
examples-llm_eval 17.20% <ø> (-0.05%) ⬇️
examples-llm_qat 17.37% <ø> (-0.09%) ⬇️
examples-llm_sparsity 16.79% <ø> (-0.05%) ⬇️
examples-megatron_bridge 26.45% <ø> (-0.11%) ⬇️
examples-specdec_bench 13.25% <ø> (-0.03%) ⬇️
examples-speculative_decoding 17.46% <ø> (-0.11%) ⬇️
examples-torch_onnx 21.26% <ø> (-0.10%) ⬇️
examples-torch_trt 15.18% <ø> (-0.04%) ⬇️
examples-vllm_serve 17.42% <ø> (-0.05%) ⬇️
gpu 58.86% <ø> (-1.04%) ⬇️
regression 15.07% <ø> (+0.04%) ⬆️
unit 61.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shengliangxu
shengliangxu merged commit 587b4cc into main Oct 23, 2026
53 checks passed
@shengliangxu
shengliangxu deleted the shengliangx/ci-nightly-marker-pr branch October 23, 2026 21:10
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-23 21:11 UTC

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.

2 participants