refactor: move training hyperparameters from model configs to trainer kwargs - #707
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has merge conflicts that must be resolved before it can be |
4974e9b to
8bd9f72
Compare
c0675ac to
058e920
Compare
max_anchors is a training hyperparameter, not a model architecture parameter, so it should not be persisted in the model config. This follows the same pattern applied to peagle in PR #687. - Remove max_anchors field from DFlashSpeculatorConfig - Pass max_anchors through get_trainer_kwargs → forward for both DFlash and DSpark - Update tests to pass max_anchors as a forward kwarg Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
num_depths, down_sample_ratio, and down_sample_ratio_min are training hyperparameters (COD sampling behavior), not model architecture parameters. Move them from PEagleSpeculatorConfig to get_trainer_kwargs → forward(), following the same pattern as max_anchors for DFlash. The inference-time speculation count remains in SpeculatorsConfig.proposal_methods[0].speculative_tokens. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
sliding_window_non_causal only affects the training attention mask; vLLM uses its own attention path at inference. Move it from DFlashSpeculatorConfig to get_trainer_kwargs → forward() for both DFlash and DSpark. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
…wargs" This reverts commit 058e920. Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
bfcbcae to
b384dc8
Compare
|
The quality checks have failed. Please run |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
|
All links are now valid - this issue has been resolved. Marked as resolved: 147abf9 |
|
All links are now valid - this issue has been resolved. Marked as resolved: 147abf9 |
Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
Resolve conflicts from vllm-project#707 (max_anchors moved to trainer kwargs): - core.py: combine global_step (domino) + max_anchors (main) in forward() - conftest.py: keep projector_type param, drop max_anchors param - test_model_forward.py: add max_anchors forward_kwargs to both specs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
shift_targets=True creates an off-by-one mismatch between training (position p predicts token p+1) and vLLM inference (position p drafts token p). This degrades acceptance length by -46% vs DFlash baseline. Fix: - Set shift_targets=False to align training with inference - Always include anchor positions in Domino loss mask (decoupled from shift_targets) - Use unshifted suffix_start unconditionally - Derive num_anchors from tensor shape (config.max_anchors removed in vllm-project#707) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
… kwargs (vllm-project#707) Follow-up to vllm-project#687 as discussed in [review comments](vllm-project#687 (comment)): Move training-only hyperparameters out of model configs into `get_trainer_kwargs` → `forward()`. These fields don't affect model architecture or inference behavior and shouldn't be persisted in `config.json`. **DFlash/DSpark:** - `max_anchors` — anchor sampling count, training-only - `sliding_window_non_causal` — training attention mask flag (vLLM uses its own attention path) **PEagle:** - `num_depths`, `down_sample_ratio`, `down_sample_ratio_min` — COD sampling params, training-only - Inference-time speculation count remains in `SpeculatorsConfig.proposal_methods[0].speculative_tokens` Not breaking: `SpeculatorModelConfig` uses `extra="allow"`, so old checkpoints with these fields load fine. - [ ] `pytest tests/integration/models/test_model_forward.py -k dflash` — DFlash param tests - [ ] `pytest tests/integration/models/test_model_forward.py -k peagle` — PEagle param tests - [ ] `pytest tests/integration/models/test_model_forward.py` — all model forward tests (no regressions) - [ ] Existing checkpoints load without error (removed fields silently accepted by `extra="allow"`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
shift_targets=True creates an off-by-one mismatch between training (position p predicts token p+1) and vLLM inference (position p drafts token p). This degrades acceptance length by -46% vs DFlash baseline. Fix: - Set shift_targets=False to align training with inference - Always include anchor positions in Domino loss mask (decoupled from shift_targets) - Use unshifted suffix_start unconditionally - Derive num_anchors from tensor shape (config.max_anchors removed in vllm-project#707) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
… kwargs (vllm-project#707) Follow-up to vllm-project#687 as discussed in [review comments](vllm-project#687 (comment)): Move training-only hyperparameters out of model configs into `get_trainer_kwargs` → `forward()`. These fields don't affect model architecture or inference behavior and shouldn't be persisted in `config.json`. **DFlash/DSpark:** - `max_anchors` — anchor sampling count, training-only - `sliding_window_non_causal` — training attention mask flag (vLLM uses its own attention path) **PEagle:** - `num_depths`, `down_sample_ratio`, `down_sample_ratio_min` — COD sampling params, training-only - Inference-time speculation count remains in `SpeculatorsConfig.proposal_methods[0].speculative_tokens` Not breaking: `SpeculatorModelConfig` uses `extra="allow"`, so old checkpoints with these fields load fine. - [ ] `pytest tests/integration/models/test_model_forward.py -k dflash` — DFlash param tests - [ ] `pytest tests/integration/models/test_model_forward.py -k peagle` — PEagle param tests - [ ] `pytest tests/integration/models/test_model_forward.py` — all model forward tests (no regressions) - [ ] Existing checkpoints load without error (removed fields silently accepted by `extra="allow"`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
shift_targets=True creates an off-by-one mismatch between training (position p predicts token p+1) and vLLM inference (position p drafts token p). This degrades acceptance length by -46% vs DFlash baseline. Fix: - Set shift_targets=False to align training with inference - Always include anchor positions in Domino loss mask (decoupled from shift_targets) - Use unshifted suffix_start unconditionally - Derive num_anchors from tensor shape (config.max_anchors removed in vllm-project#707) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
… kwargs (vllm-project#707) Follow-up to vllm-project#687 as discussed in [review comments](vllm-project#687 (comment)): Move training-only hyperparameters out of model configs into `get_trainer_kwargs` → `forward()`. These fields don't affect model architecture or inference behavior and shouldn't be persisted in `config.json`. **DFlash/DSpark:** - `max_anchors` — anchor sampling count, training-only - `sliding_window_non_causal` — training attention mask flag (vLLM uses its own attention path) **PEagle:** - `num_depths`, `down_sample_ratio`, `down_sample_ratio_min` — COD sampling params, training-only - Inference-time speculation count remains in `SpeculatorsConfig.proposal_methods[0].speculative_tokens` Not breaking: `SpeculatorModelConfig` uses `extra="allow"`, so old checkpoints with these fields load fine. - [ ] `pytest tests/integration/models/test_model_forward.py -k dflash` — DFlash param tests - [ ] `pytest tests/integration/models/test_model_forward.py -k peagle` — PEagle param tests - [ ] `pytest tests/integration/models/test_model_forward.py` — all model forward tests (no regressions) - [ ] Existing checkpoints load without error (removed fields silently accepted by `extra="allow"`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
shift_targets=True creates an off-by-one mismatch between training (position p predicts token p+1) and vLLM inference (position p drafts token p). This degrades acceptance length by -46% vs DFlash baseline. Fix: - Set shift_targets=False to align training with inference - Always include anchor positions in Domino loss mask (decoupled from shift_targets) - Use unshifted suffix_start unconditionally - Derive num_anchors from tensor shape (config.max_anchors removed in vllm-project#707) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
- Add max_anchors=8 to all _backbone_forward() and model() calls in unit tests (PR vllm-project#707 removed max_anchors from config, so _backbone_forward defaults to 3072, causing CUDA OOM) - Fix lambda_base decay: decay_steps=0 means no decay (stay at lambda_base_start), not immediate drop to 0.0 Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
… kwargs (vllm-project#707) Follow-up to vllm-project#687 as discussed in [review comments](vllm-project#687 (comment)): Move training-only hyperparameters out of model configs into `get_trainer_kwargs` → `forward()`. These fields don't affect model architecture or inference behavior and shouldn't be persisted in `config.json`. **DFlash/DSpark:** - `max_anchors` — anchor sampling count, training-only - `sliding_window_non_causal` — training attention mask flag (vLLM uses its own attention path) **PEagle:** - `num_depths`, `down_sample_ratio`, `down_sample_ratio_min` — COD sampling params, training-only - Inference-time speculation count remains in `SpeculatorsConfig.proposal_methods[0].speculative_tokens` Not breaking: `SpeculatorModelConfig` uses `extra="allow"`, so old checkpoints with these fields load fine. - [ ] `pytest tests/integration/models/test_model_forward.py -k dflash` — DFlash param tests - [ ] `pytest tests/integration/models/test_model_forward.py -k peagle` — PEagle param tests - [ ] `pytest tests/integration/models/test_model_forward.py` — all model forward tests (no regressions) - [ ] Existing checkpoints load without error (removed fields silently accepted by `extra="allow"`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
shift_targets=True creates an off-by-one mismatch between training (position p predicts token p+1) and vLLM inference (position p drafts token p). This degrades acceptance length by -46% vs DFlash baseline. Fix: - Set shift_targets=False to align training with inference - Always include anchor positions in Domino loss mask (decoupled from shift_targets) - Use unshifted suffix_start unconditionally - Derive num_anchors from tensor shape (config.max_anchors removed in vllm-project#707) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
- Add max_anchors=8 to all _backbone_forward() and model() calls in unit tests (PR vllm-project#707 removed max_anchors from config, so _backbone_forward defaults to 3072, causing CUDA OOM) - Fix lambda_base decay: decay_steps=0 means no decay (stay at lambda_base_start), not immediate drop to 0.0 Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
… kwargs (vllm-project#707) Follow-up to vllm-project#687 as discussed in [review comments](vllm-project#687 (comment)): Move training-only hyperparameters out of model configs into `get_trainer_kwargs` → `forward()`. These fields don't affect model architecture or inference behavior and shouldn't be persisted in `config.json`. **DFlash/DSpark:** - `max_anchors` — anchor sampling count, training-only - `sliding_window_non_causal` — training attention mask flag (vLLM uses its own attention path) **PEagle:** - `num_depths`, `down_sample_ratio`, `down_sample_ratio_min` — COD sampling params, training-only - Inference-time speculation count remains in `SpeculatorsConfig.proposal_methods[0].speculative_tokens` Not breaking: `SpeculatorModelConfig` uses `extra="allow"`, so old checkpoints with these fields load fine. - [ ] `pytest tests/integration/models/test_model_forward.py -k dflash` — DFlash param tests - [ ] `pytest tests/integration/models/test_model_forward.py -k peagle` — PEagle param tests - [ ] `pytest tests/integration/models/test_model_forward.py` — all model forward tests (no regressions) - [ ] Existing checkpoints load without error (removed fields silently accepted by `extra="allow"`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
shift_targets=True creates an off-by-one mismatch between training (position p predicts token p+1) and vLLM inference (position p drafts token p). This degrades acceptance length by -46% vs DFlash baseline. Fix: - Set shift_targets=False to align training with inference - Always include anchor positions in Domino loss mask (decoupled from shift_targets) - Use unshifted suffix_start unconditionally - Derive num_anchors from tensor shape (config.max_anchors removed in vllm-project#707) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com> Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
- Add max_anchors=8 to all _backbone_forward() and model() calls in unit tests (PR vllm-project#707 removed max_anchors from config, so _backbone_forward defaults to 3072, causing CUDA OOM) - Fix lambda_base decay: decay_steps=0 means no decay (stay at lambda_base_start), not immediate drop to 0.0 Signed-off-by: Eros483 <arnabmandal2912@gmail.com>
Summary
Follow-up to #687 as discussed in review comments:
Move training-only hyperparameters out of model configs into
get_trainer_kwargs→forward(). These fields don't affect model architecture or inference behavior and shouldn't be persisted inconfig.json.DFlash/DSpark:
max_anchors— anchor sampling count, training-onlysliding_window_non_causal— training attention mask flag (vLLM uses its own attention path)PEagle:
num_depths,down_sample_ratio,down_sample_ratio_min— COD sampling params, training-onlySpeculatorsConfig.proposal_methods[0].speculative_tokensNot breaking:
SpeculatorModelConfigusesextra="allow", so old checkpoints with these fields load fine.Test plan
pytest tests/integration/models/test_model_forward.py -k dflash— DFlash param testspytest tests/integration/models/test_model_forward.py -k peagle— PEagle param testspytest tests/integration/models/test_model_forward.py— all model forward tests (no regressions)extra="allow")🤖 Generated with Claude Code