nemo_automodel.components.speculative.dfly2.target
nemo_automodel.components.speculative.dfly2.target
Model-owned contracts and the frozen-target wrapper for DFly2 training.
DFly2 reads the target’s own attention state, whose layout is architecture specific, so
the target model produces it (DFly2TargetFeatureProvider) and the target config
builds the matching draft (ModelOwnedDFly2Provider). This module only names those
contracts and runs the frozen forward.
Module Contents
Classes
API
Target features and the batch tensors the DFly2 trainer reads.
Frozen target state, documented by DFly2TargetFeatures.
Integer tensor of shape [batch, sequence].
Tensor of shape [batch, sequence] selecting supervised tokens.
Target model that exposes the attention state its paired DFly2 draft layers read.
Run the frozen forward and return the paired layers’ keys and key lists.
Parameters:
Integer tensor of shape [batch, sequence].
Binary right-padding tensor of shape [batch, sequence].
Target layers paired with the draft layers, in draft-layer order.
Run a frozen target that implements DFly2TargetFeatureProvider.
Run the target once and collect the DFly2 features.
Parameters:
Integer tensor of shape [batch, sequence].
Binary right-padding tensor of shape [batch, sequence].
Tensor of shape [batch, sequence] selecting supervised tokens.
Returns: DFly2TargetBatch
The batch with the features of DFly2TargetFeatureProvider.dfly2_target_features.
Return the target’s input embedding.
Return the target’s LM head.
Target config that owns construction of its architecture-specific DFly2 draft.
Build a draft from the recipe’s declarative options.
Recipe options consumed by model-owned DFly2 draft constructors.