nemo_automodel.recipes.speculative_decoding.train_eagle1
nemo_automodel.recipes.speculative_decoding.train_eagle1
EAGLE-1 / EAGLE-2 training recipe for Llama-style dense LLMs (Llama, Phi-3, Qwen3) and MoE backbones (Qwen3-MoE).
Module Contents
Classes
Functions
Data
API
Bases: SpecDecodeRecipeBase
Recipe for EAGLE-1 training on Llama-style dense LLMs (Llama, Phi-3, Qwen3) and MoE backbones (Qwen3-MoE).
Run the frozen target and the draft over one micro-batch.
Parameters:
Dataloader batch whose tensors are already on self.device.
Carries input_ids / attention_mask / loss_mask, each
of shape [batch, sequence], plus any packing metadata.
Returns:
EagleStepMetrics for this micro-batch. Subclasses that feed the draft
Build the optimizer, schedule, checkpointer, and logging around a ready trainer module.
Runs once self.trainer_module / self.draft_model / the dataloaders
exist, so recipes that assemble those differently (e.g. ViSpec’s VLM
target) share the rest of setup() instead of copying it.
Parameters:
The recipe_args config node.
Target model id or path, used for checkpoint metadata and the default W&B run name.
Prefix for the default W&B run name.
Restore EAGLE-recipe-specific scalars. Subclasses extend this.
Return the per-term losses this recipe logs alongside the total.
Parameters:
The step metrics returned by _compute_metrics.
Returns: dict[str, float]
Mapping of log-suffix to scalar value, logged as train/<key>.
Persist EAGLE-recipe-specific scalars. Subclasses extend this.
Run the training loop.
Build target model, draft model, data, optimizer, and trainer module.
Build the EAGLE-1/2 augmentation from the recipe’s fixed-width knob.
Entrypoint for TrainEagle1Recipe.