Skip to content

[None][fix] Honor deterministic mode in PyTorch backend#1

Closed
achartier wants to merge 3735 commits into
mainfrom
cursor/fix-deterministic-bs-consistency-99a2
Closed

[None][fix] Honor deterministic mode in PyTorch backend#1
achartier wants to merge 3735 commits into
mainfrom
cursor/fix-deterministic-bs-consistency-99a2

Conversation

@achartier

@achartier achartier commented Jun 22, 2026

Copy link
Copy Markdown
Owner

@coderabbitai summary

Description

Rebased on NVIDIA/TensorRT-LLM main at f7dd7ec54.

Propagate FORCE_DETERMINISTIC=1 through PyTorch backend settings that were not previously covered:

  • Disable overlap scheduling when deterministic mode is requested.
  • Disable PyTorch MoE finalize fusion when deterministic mode is requested.
  • Pass the deterministic flag into vanilla FlashAttention no-KV-cache attention.

This narrows batch-composition-dependent execution differences in deterministic PyTorch generation while keeping the changes guarded behind the existing env var.

Test Coverage

  • Added unit coverage for vanilla attention forwarding the env-controlled deterministic flag to FlashAttention.
  • python3 -m py_compile tensorrt_llm/_torch/pyexecutor/py_executor_creator.py tensorrt_llm/_torch/attention_backend/vanilla.py tests/unittest/_torch/attention/test_vanilla_attention.py
  • Targeted runtime test was previously attempted but blocked in this cloud image because pytest and torch are not installed:
    • python3 -m pytest tests/unittest/_torch/attention/test_vanilla_attention.py::TestVanillaAttention::test_no_kv_cache_forward_honors_force_deterministic
    • python3 -m unittest tests.unittest._torch.attention.test_vanilla_attention.TestVanillaAttention.test_no_kv_cache_forward_honors_force_deterministic

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 from a previous pipeline.

--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 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 pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

Open in Web Open in Cursor 

taylor-yb-lee and others added 30 commits June 6, 2026 21:47
Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
…okens (NVIDIA#13723)

Signed-off-by: greg-kwasniewski1 <213329731+greg-kwasniewski1@users.noreply.github.com>
Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
…onfig / --extra_llm_api_options YAML (NVIDIA#14812)

Signed-off-by: marinayanov <256585945+marinayanov@users.noreply.github.com>
Signed-off-by: Bo Deng <deemod@nvidia.com>
Signed-off-by: Tyler Burt <195370667+tburt-nv@users.noreply.github.com>
Signed-off-by: TensorRT LLM <90828364+tensorrt-cicd@users.noreply.github.com>
…DIA#15015)

Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
…h Cutlass backend - Part 1 (NVIDIA#14923)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
…isagg (NVIDIA#14935)

Signed-off-by: Dongfeng Yu <dongfengy@nvidia.com>
…IDIA#14994)

Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
…15035)

Signed-off-by: junq <22017000+QiJune@users.noreply.github.com>
…IA#15080)

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>
…A#15082)

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
…cher rewrites (NVIDIA#14835)

Signed-off-by: greg-kwasniewski1 <213329731+greg-kwasniewski1@users.noreply.github.com>
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
Co-authored-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
…A#15089)

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>
…IA#15038)

Signed-off-by: junq <22017000+QiJune@users.noreply.github.com>
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
…els (NVIDIA#14851)

Revert c37992c to remove padding.
Added warmup with a grid that should be dense enough to catch almost every possible JIT kernels. Note that this PR only enables warmup and have no shape binning at runtime. I'd like to see how it performs and if it can warmup most kernels then we may not need further works.
Added a message when a possible JIT happened, to give a clear clue why performance dropped.

Signed-off-by: Pengbo Wang <221450789+pengbowang-nv@users.noreply.github.com>
Signed-off-by: Jonas Li <6110159+longlee0622@users.noreply.github.com>
NVIDIA#14898)

Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
…15083)

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
…A#14972)

Signed-off-by: jbernloehr <jbernloehr@nvidia.com>
Signed-off-by: Tyler Burt <195370667+tburt-nv@users.noreply.github.com>
Co-authored-by: jbernloehr <jbernloehr@nvidia.com>
…n trtllm attention (NVIDIA#14911)

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: egeva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
Signed-off-by: Abby Wei <18545893+mzweilz@users.noreply.github.com>
…VIDIA#14917)

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
tensorrt-cicd and others added 27 commits June 18, 2026 03:08
Signed-off-by: TensorRT LLM <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
…ntion backend (NVIDIA#15204)

Signed-off-by: Yuxian Qiu <142763828+yuxianq@users.noreply.github.com>
…A#15478)

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>
* Why?

Multimodal context requests currently run their encoder only after they
are scheduled. That potentially keeps the next request's image encoding
on the critical path even when the executor already has independent GPU
work from the current iteration to overlap it with.

* What?

Add an opt-in cross-iteration prefetch path gated by
`TLLM_MM_SIDE_STREAM_MAX_AHEAD`. The executor picks pending multimodal
context requests that are not in flight, moves their inputs to CUDA and
runs the encoder on an auxiliary stream.

This leverages the recently added `MultimodalEncoderMixin`.

Signed-off-by: William Zhang <133824995+2ez4bz@users.noreply.github.com>
…PI changes (NVIDIA#15292)

Signed-off-by: Fred Wei <20514172+WeiHaocheng@users.noreply.github.com>
Signed-off-by: WeiHaocheng <20514172+WeiHaocheng@users.noreply.github.com>
Signed-off-by: TensorRT LLM <90828364+tensorrt-cicd@users.noreply.github.com>
…ue per-run subdir `{model}-openai-complet (NVIDIA#14742)

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
…NVIDIA#14203)

Signed-off-by: Harris Nover <249353502+hnover-nv@users.noreply.github.com>
Signed-off-by: TensorRT LLM <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: Jie Li <76780849+jieli-matrix@users.noreply.github.com>
Co-authored-by: Jie Li <76780849+jieli-matrix@users.noreply.github.com>
Signed-off-by: TensorRT LLM <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: TensorRT LLM <90828364+tensorrt-cicd@users.noreply.github.com>
…using trtllm-llmapi-launch (NVIDIA#15423)

Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
Signed-off-by: Jie Li <76780849+jieli-matrix@users.noreply.github.com>
Co-authored-by: Jie Li <76780849+jieli-matrix@users.noreply.github.com>
Signed-off-by: Derek Pitman <dpitman@nvidia.com>
NVIDIA#15422)

Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
…M100/SM103 (NVIDIA#15128)

Signed-off-by: Dongfeng Yu <dongfengy@nvidia.com>
…tion (NVIDIA#15517)

Signed-off-by: ixlmar <206748156+ixlmar@users.noreply.github.com>
Co-authored-by: Aurelien Chartier <achartier@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-deterministic-bs-consistency-99a2 branch from 3636d96 to 6348278 Compare June 22, 2026 18:57
@achartier achartier closed this Jun 24, 2026
@achartier
achartier deleted the cursor/fix-deterministic-bs-consistency-99a2 branch June 24, 2026 19:39
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.