Skip to content

Allow DASC quality gates above parity - #2378

Closed
kaix-nv wants to merge 1 commit into
feature/dasc-state-sparsity-review-fixesfrom
feature/dasc-state-sparsity-parity-gate
Closed

Allow DASC quality gates above parity#2378
kaix-nv wants to merge 1 commit into
feature/dasc-state-sparsity-review-fixesfrom
feature/dasc-state-sparsity-parity-gate

Conversation

@kaix-nv

@kaix-nv kaix-nv commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2377 for its CodeRabbit consistency finding.

The DASC perplexity ratio allows values above 1.0, so the configurable minimum gate now accepts any finite positive value as well. The test exercises a 1.0002 minimum against a 1.0004 measurement through full calibration and policy export.

Validation:

  • 15 focused DASC tests pass
  • pre-commit passes for both changed files

Signed-off-by: Kai Xu kaix@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Perplexity-retention thresholds now accept any finite positive value, including values above 1.0.
    • Calibration succeeds when measured perplexity retention exceeds 1.0 and meets the configured threshold.

Signed-off-by: Kai Xu <kaix@nvidia.com>
@kaix-nv
kaix-nv requested review from a team as code owners September 11, 2026 01:12
@kaix-nv
kaix-nv requested review from realAsma and removed request for a team September 11, 2026 01:12
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a2318403-f054-459c-ae72-d4ba4bdcb6f5

📥 Commits

Reviewing files that changed from the base of the PR and between edc91ec and a0a5d08.

📒 Files selected for processing (2)
  • modelopt/torch/sparsity/state_sparsity/config.py
  • tests/unit/torch/sparsity/state_sparsity/test_dasc.py

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The perplexity gate now accepts any finite positive retention threshold. DASC calibration tests verify selection with retention measurements above 1.0.

Changes

Perplexity Gate Threshold

Layer / File(s) Summary
Threshold validation and calibration coverage
modelopt/torch/sparsity/state_sparsity/config.py, tests/unit/torch/sparsity/state_sparsity/test_dasc.py
validate_perplexity_gate accepts finite positive values above 1.0. The calibration test verifies a 1.0004 measurement against a 1.0002 threshold.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to a0a5d

The updated quality gate behavior is covered through calibration, including an above-parity threshold. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 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 change: allowing DASC quality gates above parity.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
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 pull request changes only DASC perplexity-threshold validation and its test. The added implementation contains no torch.load, numpy.load/allow_pickle, trust_remote_code, eval/exec, or # nose…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/dasc-state-sparsity-parity-gate

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

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-11 04:54 UTC

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.74%. Comparing base (edc91ec) to head (a0a5d08).

Additional details and impacted files
@@                            Coverage Diff                            @@
##           feature/dasc-state-sparsity-review-fixes    #2378   +/-   ##
=========================================================================
  Coverage                                     78.74%   78.74%           
=========================================================================
  Files                                           548      548           
  Lines                                         64105    64105           
=========================================================================
  Hits                                          50477    50477           
  Misses                                        13628    13628           
Flag Coverage Δ
examples-diffusers 20.81% <0.00%> (ø)
examples-gpt-oss 13.37% <0.00%> (ø)
examples-hf_ptq 21.78% <0.00%> (ø)
examples-llm_distill 13.44% <0.00%> (ø)
examples-llm_eval 17.25% <0.00%> (ø)
examples-llm_qat 17.58% <0.00%> (ø)
examples-llm_sparsity 15.93% <0.00%> (ø)
examples-megatron_bridge 26.27% <0.00%> (ø)
examples-specdec_bench 13.12% <0.00%> (ø)
examples-speculative_decoding 17.67% <0.00%> (ø)
examples-torch_onnx 21.82% <0.00%> (ø)
examples-torch_trt 15.14% <0.00%> (ø)
gpu 58.43% <0.00%> (ø)
regression 15.14% <0.00%> (ø)
unit 57.38% <100.00%> (ø)

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.

kaix-nv added a commit that referenced this pull request Sep 11, 2026
## Summary

Consolidates the complete reviewed fix stack for #2375 into one DCO-safe
commit:

- harden package exports, measurement semantics, wrapper handling, and
actionable calibration errors
- validate exact installed GDN identities plus ModelOpt dynamic
subclasses; reject lookalikes, ordinary subclasses, incomplete layers,
and partial layer sets
- make stale checkpoints saveable and restorable while keeping
deployment export strict
- make DASC recalibration replace and deduplicate existing mode state
without stale-metadata refresh
- record the declared decay-parameter checkpoint storage dtype and use
derived FP16/BF16/FP32 rounding bounds
- preserve BF16/FP16 storage and wider/cross-dtype reload compatibility
without globally widening FP32 tolerance
- add installed Transformers path coverage, optional Megatron gating,
lifecycle, tamper, lossy-cast, and mixed-layer regressions
- document the explicit storage-dtype contract

This consolidated PR supersedes the mechanically stacked review-fix PRs
#2377, #2378, #2379, #2380, #2382, #2383, #2384, and #2385. Its tree is
byte-identical to the independently reviewed leaf commit from #2386.

## Validation

- focused DASC suite: 23 passed, 1 absent optional Megatron skip
- DASC plus weight sparsity plus attention sparsity compatibility suite:
134 passed, 1 optional skip
- DASC package coverage: 408/408 statements, 100%
- full pre-commit on all touched files: passed
- real Transformers Qwen3NextGatedDeltaNet BF16 storage to FP32 reload
smoke: passed
- commit author and Signed-off-by identity both use kaix-nv
<kaix@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added support for configuring decay-parameter storage precision with
FP16, BF16, or FP32.
  * Added safer recalibration that replaces existing DASC state.
* Expanded compatibility with supported GDN adapter classes and model
wrappers.
* Added improved validation for sparsity policies, measurements, model
structure, and decay parameters.
  * Added support for perplexity-retention values above 1.

* **Documentation**
* Clarified evaluation responsibilities, recalibration behavior,
stale-policy handling, supported adapters, and dtype requirements.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: kaix-nv <kaix@nvidia.com>
@kaix-nv

kaix-nv commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated review-fix PR #2387, now merged into #2375’s head. Closing this mechanical stack layer.

@kaix-nv kaix-nv closed this Sep 11, 2026
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