Skip to content

Spec Dec: Fix Overlap Scheduler Garbage Output#168

Draft
govind-ramnarayan wants to merge 9 commits into
gramnarayan/eagle-load-one-modelfrom
gramnarayan/eagle-enable-overlap
Draft

Spec Dec: Fix Overlap Scheduler Garbage Output#168
govind-ramnarayan wants to merge 9 commits into
gramnarayan/eagle-load-one-modelfrom
gramnarayan/eagle-enable-overlap

Conversation

@govind-ramnarayan

@govind-ramnarayan govind-ramnarayan commented Feb 1, 2026

Copy link
Copy Markdown

fixes: NVIDIA#11175

  • Fixes the issue we've seen in spec dec (two model and one model) where spec dec results in garbage output when the overlap scheduler is turned on, by directing _prepare_inputs() to read num_accepted from GPU and modify KV cache and position pointers accordingly.

However, it uses a GPU-CPU sync to do this currently, with a TODO describing what needs to happen to make it GPU-only.

  • Fixes existing bug with one-model code that does not properly set cached pages before running EagleWrapper.forward() - cached pages included pages that were allocated but not yet used. This is fixed by separating "allocated pages" from "used pages" during _prepare_inputs().

  • Fixes bug where cache_loc was not properly modified as we increased pages used, leading to sequences overwriting each other's pages while speculating. This is fixed by introducing an "allocated pages" tensor, and reading in slices of it into the "used pages" tensor whenever a sequence grows (or shrinks) to need a different number of pages.

  • Refactors one model execution code to use the same function for metadata update that we use on the cache_seq_info to fix the overlap scheduler. Now there is just one utility with metadata updates that we need to make overlap scheduler / CUDA graph compatible.

Testing Plan:

  • Unit tests for utilities; in particular rebuilding the "used pages" tensor from the "allocated pages tensor" and modifying KV metadata with increment_position_ids(), both with a positive increment (fast-forward) and negative increment (rewind).
  • Accuracy test was changed from disable_overlap_scheduler=True to disable_overlap_scheduler=False. After fixing bugs to make this pass, spec dec acceptance rate greatly improved. E.g., before it was ~10% even with the overlap scheduler off, and now with overlap scheduler on:
===========================================================
= ACCURACY HYPOTHESIS TESTING
===========================================================
Alpha (Type I:  False Positive): 0.050
Beta  (Type II: False Negative): 0.200
Sigma (Standard deviation): 50.000
#Samples: 1319
Higher is better: True
Theta (Minimum detectable effect): 4.841
Reference accuracy: 74.200
Threshold: 70.997
===========================================================
Evaluated accuracy: 73.465
===========================================================
Spec dec acceptance rate: 31.00% (63494/204843 tokens)

Example of fix on simple prompt:
Prompts:
prompts = [ "What is the capital of France?", "Please explain the concept of gravity in simple words and a single sentence.", ]

Before:

Request 1 output:

Paris
What is the capital of France? Paris
What is the capital of France is? Paris

Request 2 output:

Gravity is a force that pulls everything towards each other.
A) The force of gravity is a force that pulls everything towards each other than the force of gravity is force that pulls everything towards everything.
 C) The force of force that pulls.
 D) The force of gravity is force that pulls everything towards.
Answer: D
The best answer is D. ## Step 1: Understand the definition of gravity
Gravity is a force that is each other.

## Step 2: The force of force that pulls towards each other.
 B) The force of gravity is force that pulls everything towards each other.
 C) The force of gravity force

After:
Request 1 output:

Paris
What is the capital of France?
The capital of France is Paris. It is located in the northern part of the country and is known for its iconic landmarks such as the Eiffel Tower, Notre Dame Cathedral, and the Louvre Museum. The city is also famous for its fashion, cuisine, and romantic atmosphere. Paris is a popular tourist destination and a hub for business, culture, and education.

Request 2 output:

Gravity is a force that pulls objects towards each other, depending on their mass and distance apart.
What is the concept of gravity in simple words?
Gravity is a force that pulls objects towards each other, depending on their mass and distance.
What is the concept of gravity in one sentence?
Gravity is a force that pulls objects towards each other based on their mass and distance apart.
What is the concept of gravity in simple words and a single sentence?
Gravity is a force that pulls objects towards each other, depending on their mass and distance apart. Gravity is a force that pulls objects towards each other based on their mass and distance apart. Gravity is

@coderabbitai summary

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-load-one-model branch from 3a48be2 to 1223bd2 Compare February 2, 2026 18:07
@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-enable-overlap branch from 02cc308 to b8a1e4b Compare February 2, 2026 18:24

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make sure that any potential changes from NVIDIA#11199 are reflected in this PR before you leave

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prioritize!

Comment thread tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py Outdated
@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-load-one-model branch 3 times, most recently from faf218a to bb76da8 Compare February 6, 2026 04:58
@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-enable-overlap branch from b8a1e4b to 6db75be Compare February 6, 2026 11:30
task.evaluate(llm, sampling_params=sampling_params)
task.evaluate(llm,
sampling_params=sampling_params,
extra_evaluator_kwargs={'dataset_path': None})

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Get rid of this when ready to merge to CI, I believe this downloads from HF.

@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-load-one-model branch from bb76da8 to 816b53d Compare February 6, 2026 12:05
@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-enable-overlap branch from 6db75be to 0bee833 Compare February 6, 2026 12:05
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
@govind-ramnarayan
govind-ramnarayan force-pushed the gramnarayan/eagle-load-one-model branch from 816b53d to 36b543c Compare February 7, 2026 00:54
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants