nemo_automodel.components.speculative.dfly2.core
nemo_automodel.components.speculative.dfly2.core
DFly2 online training wrapper.
Like DSpark’s, the draft is self-contained (anchors, key lists, backbone, corrections), so
this wrapper only calls it with the frozen target features and computes the DFly2
objective. It reports DSparkStepMetrics so the DSpark recipe’s metric window,
evaluation and logging apply unchanged.
Module Contents
Classes
API
Bases: Module
DFly2 online training wrapper computing the D-PACE-weighted LK objective.
Run the draft on the target features and compute the DFly2 loss.
Parameters:
Target-token tensor of shape [batch, sequence].
Supervision tensor of shape [batch, sequence].
One tensor per draft layer of shape [batch, context_keys,
key_dim], as in DFly2TargetFeatures.
One integer tensor per draft layer of shape [batch,
sequence, slots], as in DFly2TargetFeatures.
Tensor of shape [batch, sequence, hidden].
Returns: DSparkStepMetrics
Step metrics. The per-position acceptance sums have block_size entries,