Conversation
Signed-off-by: Benjamin Chislett <bchislett@nvidia.com>
📝 WalkthroughWalkthroughThe pull request adds support for a configurable Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/speculative_decoding/launch_train.sh`:
- Around line 89-92: NUM_TTT_STEPS is taken directly from user input and later
interpolated into a shell command; validate and harden it in launch_train.sh
before any sh -c invocation by enforcing it is a positive integer within an
acceptable range (e.g., digits only, min/max bounds) and rejecting or defaulting
on invalid values; locate the parsing block that assigns NUM_TTT_STEPS and add
validation (or sanitize with a strict numeric cast) so only safe numeric values
are used, and avoid passing raw user strings into sh -c (prefer passing as
positional arguments or using printf %q if quoting is required).
In `@examples/speculative_decoding/main.py`:
- Around line 133-136: num_ttt_steps may be non-positive and is forwarded into
the Eagle config unchecked; add a validation check where num_ttt_steps is
consumed (before constructing or passing into the Eagle config) that ensures it
is an integer >= 1 (optionally enforce an upper bound if desired), and raise a
clear ValueError if the check fails; e.g., validate the num_ttt_steps attribute
from the dataclass/config and refuse to build the Eagle config (or normalize)
when the value is <= 0 so the downstream Eagle config creation code (the place
where num_ttt_steps is passed to the Eagle configuration) never receives invalid
values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dda22186-a514-429c-86b4-1b48b23a6da7
📒 Files selected for processing (3)
examples/speculative_decoding/launch_train.shexamples/speculative_decoding/main.pymodelopt/torch/speculative/config.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1042 +/- ##
==========================================
- Coverage 70.10% 70.09% -0.02%
==========================================
Files 221 221
Lines 25541 25541
==========================================
- Hits 17905 17902 -3
- Misses 7636 7639 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What does this PR do?
Type of change: new CLI option for existing option
Usage
Users can now pass
--num_ttt_steps 7tolaunch_train.shwhen training an EAGLE3 model for extended speculation lengths.Testing
N/A
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.).CONTRIBUTING.md: N/ASummary by CodeRabbit