nemo_automodel.components.speculative.precompute_dspark
nemo_automodel.components.speculative.precompute_dspark
Precompute the DSpark offline target-supervision cache.
The online DSpark recipe runs a frozen target model every step to capture the
intermediate target hidden states consumed by the draft and the final hidden
state used by the TV / confidence losses. This script runs that target once and
writes those tensors to disk. Training can then set
recipe_args.cached_target_path to stream the cache without loading or
running the target model.
Typical usage (single device):
python -m nemo_automodel.components.speculative.precompute_dspark
—target-model Qwen/Qwen3-0.6B
—input-data /data/messages.jsonl
—output-dir /data/dspark_cache/qwen3_06b
—seq-length 2048 —batch-size 4 —shard-size 256 —dtype bf16
Module Contents
Functions
Data
_UNSUPPORTED_OFFLINE_TARGET_MODEL_TYPES
API
Refuse to resume into shards produced with a different configuration.
Load the target, scan the dataset once, and write the sharded cache.
Reject invalid CLI values before loading the target model.
CLI entry point. Parses argv and returns the process exit code.