Remove --skip-softmax option from hf_sa (only allow calibration option)#1123
Remove --skip-softmax option from hf_sa (only allow calibration option)#1123rohansjoshi wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: Rohan Joshi <rohjoshi@nvidia.com>
📝 WalkthroughWalkthroughThe change removes deprecated Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
examples/llm_sparsity/attention_sparsity/hf_sa.py (1)
230-235: Clarify CLI migration in help text.Line 232 now defaults to a single supported value, which is fine. Consider explicitly stating that
skip_softmaxwas removed to make CLI errors/migration clearer for existing users.Suggested tweak
parser.add_argument( "--sparse_attn", type=str, default="skip_softmax_calib", choices=list(SPARSE_ATTN_CFG_CHOICES.keys()), - help="Sparse attention configuration to apply.", + help="Sparse attention configuration to apply. Only 'skip_softmax_calib' is supported (legacy 'skip_softmax' removed).", )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/llm_sparsity/attention_sparsity/hf_sa.py` around lines 230 - 235, Update the CLI help for the "--sparse_attn" argument to note the migration from the removed "skip_softmax" option to the new default "skip_softmax_calib" so users get a clear migration message; modify the help string where the argument is defined (the "--sparse_attn" parser entry that uses SPARSE_ATTN_CFG_CHOICES and default="skip_softmax_calib") to explicitly state that "skip_softmax" was removed and that "skip_softmax_calib" is now the default, and keep the choices list unchanged to avoid surprises.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@examples/llm_sparsity/attention_sparsity/hf_sa.py`:
- Around line 230-235: Update the CLI help for the "--sparse_attn" argument to
note the migration from the removed "skip_softmax" option to the new default
"skip_softmax_calib" so users get a clear migration message; modify the help
string where the argument is defined (the "--sparse_attn" parser entry that uses
SPARSE_ATTN_CFG_CHOICES and default="skip_softmax_calib") to explicitly state
that "skip_softmax" was removed and that "skip_softmax_calib" is now the
default, and keep the choices list unchanged to avoid surprises.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 68d1cedc-9562-4e37-b7a8-6f0c82c8a5f9
📒 Files selected for processing (1)
examples/llm_sparsity/attention_sparsity/hf_sa.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1123 +/- ##
==========================================
- Coverage 70.21% 70.18% -0.03%
==========================================
Files 228 228
Lines 25952 25952
==========================================
- Hits 18221 18215 -6
- Misses 7731 7737 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What does this PR do?
The
hf_sa.pyscript applies an attention sparsity method to a model and exports a "sparsified" checkpoint. The SKIP_SOFTMAX_DEFAULT sparse attention config doesn't run calibration or make any change to the checkpoint. If we use this method withhf_sa.pythe exported checkpoint is identical to the original checkpoint. This could cause confusion so it's best to remove the option altogether. This PR removes the option and switches to SKIP_SOFTMAX_CALIB as the default config.Summary by CodeRabbit
"skip_softmax"option and changed default to"skip_softmax_calib". The script no longer accepts the previous"skip_softmax"configuration path.