agentleFS
NVIDIAKnown publisherNVIDIA/Model-Optimizer/skills/modelopt-speculative-decoding/SKILL.md

modelopt-speculative-decoding

Skill5.6k starsChanged 3 days agoApache-2.0View on GitHub

Train, debug, and validate a speculative decoding draft model (EAGLE3, DFlash, DSpark, Domino) through the ModelOpt launcher pipeline. Use when the user wants to add a new model to a draft-training pipeline, asks why a pipeline run failed, wants experiment logs reviewed, or wants to check whether a run's acceptance rate meets threshold. Triggers on "EAGLE3", "DFlash", "DSpark", "Domino", "draft model", "acceptance rate", "speculative decoding pipeline". Do NOT use for quantizing a model (use modelopt-ptq) or serving a checkpoint (use modelopt-deployment).

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 2 mentionsFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 2 mentionsMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 2 mentionsSep 2026: 20 mentionsOct 2026: 15 mentionsNov 2026: 11 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the NVIDIA/Model-Optimizer repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about NVIDIA/Model-Optimizer

The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 54

Talked about on GitHub and Bluesky (54 times).

On GitHub · 50

45 more on GitHub

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the stage file for *what to do*, and the algorithm sheet for *the values to plug in*.

    line 35
  2. Very specific:

    All recipes live in modelopt_recipes/general/speculative_decoding/<algorithm>.yaml.

    line 62
  3. Very specific:

    If the user's algorithm has no sheet yet, the stage procedures still apply — derive the missing values from an existing launcher example …

    line 81
  4. Very specific:

    Review logs: when it finishes (references/stages/review-logs.md).

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Speculative Decoding Draft-Model Training

Everything needed to take a target model from "no draft head" to "validated acceptance rate" lives in this directory. Work through the stages below in order for a new model; jump straight to a stage when you already know which one you need.

Two axes: stage and algorithm

The pipeline is the same shape for every draft-model algorithm — synthesize data, dump base-model hidden states, train the draft, benchmark acceptance rate. What changes between algorithms is which training script and recipe run, which knobs matter, and which failures are typical.

So this skill is split along those two axes, and you almost always read one file from each:

AxisDirectoryWhat it holds
Stagereferences/stages/The procedure — algorithm-independent
Algorithmreferences/algorithms/The data sheet — scripts, recipe, knobs, thresholds, known failures

Read the stage file for what to do, and the algorithm sheet for the values to plug in. When a stage file says "see the algorithm sheet", it means the section of references/algorithms/<algorithm>.md with the matching heading.

Where the code lives

The launcher scripts in tools/launcher/common/{eagle3,specdec}/ are thin wrappers around examples/speculative_decoding/ — main.py (training), collect_hidden_states/ (dumps), scripts/{export_hf_checkpoint,ar_validate,quantize_drafter}.py. Read a wrapper for the flags it passes, that directory for what they do. Its README.md is also the non-launcher path: training invoked directly, without Slurm.

Stages

StageReferenceUse when
1. Configurereferences/stages/configure.mdAdding a model that has no pipeline YAML yet
2. Review logsreferences/stages/review-logs.mdA run finished (or died) and you want a pass/fail summary
3. Triagereferences/stages/triage.mdA task failed and you need root cause plus a fix
4. Validatereferences/stages/validate.mdAll tasks passed and you need to confirm the acceptance rate gate

Review-logs and triage overlap by design: review-logs is the fast sweep across all tasks, triage is the deep dive into one failing task. Start with review-logs unless the user already knows which task broke.

Algorithms

All recipes live in modelopt_recipes/general/speculative_decoding/<algorithm>.yaml.

AlgorithmSheetFamily
EAGLE3references/algorithms/eagle3.mdAutoregressive draft head
DFlashreferences/algorithms/dflash.mdBlock diffusion
DSparkreferences/algorithms/dspark.mdDFlash backbone + Markov head + optional confidence head
Dominoreferences/algorithms/domino.mdDFlash backbone + GRU causal correction head
DFlash2references/algorithms/dflash2.mdDFlash backbone + sublayer convolutions + candidate selector
LiLiCorrreferences/algorithms/lilicorr.mdDFlash backbone + candidate-lattice reranker (covers lilicorr_conv.yaml)

Everything below EAGLE3 is a DFlash variant, not a separate pipeline: same recipe_type: speculative_dflash, same training script, same dflash.* config namespace, selected by dflash_architecture_config.projector_type. Read references/algorithms/dflash.md first, then the variant's sheet for the delta.

LiLiCorr ships two recipes — lilicorr.yaml and lilicorr_conv.yaml, the latter adding DFlash2's sublayer convolutions — but one sheet covers both.

If the user's algorithm has no sheet yet, the stage procedures still apply — derive the missing values from an existing launcher example for that algorithm (tools/launcher/examples/*/*/hf_*_<algorithm>.yaml) and its recipe, then write the sheet as you go. references/algorithms/README.md defines what a sheet must contain.

End-to-end: a new model

  1. Confirm the algorithm and find the closest existing launcher example.
  2. Configure — write the pipeline YAML (references/stages/configure.md).
  3. Preview with --dryrun, then submit:

    cd tools/launcher
    uv run launch.py --yaml examples/<Org>/<Model>/<config>.yaml --yes
  4. Register the job and set up monitoring per the modelopt-monitor skill.
  5. Review logs when it finishes (references/stages/review-logs.md).
  6. Triage anything that failed (references/stages/triage.md), fix, re-run only the failed tasks onward via pipeline.task_N.skip=true.
  7. Validate once all tasks pass (references/stages/validate.md).

Model-support gaps that need code changes land in modelopt/torch/speculative/ and require a separate ModelOpt PR — the pipeline YAML alone cannot fix an unrecognized architecture.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.