Skip to content

[https://nvbugs/6374873][fix] Allow fp4 KV Cache + non-FP4 Mamba State#16304

Merged
VALLIS-NERIA merged 6 commits into
NVIDIA:mainfrom
VALLIS-NERIA:agent/nvbug-6374873-nvfp4-recurrent-cache
Jul 15, 2026
Merged

[https://nvbugs/6374873][fix] Allow fp4 KV Cache + non-FP4 Mamba State#16304
VALLIS-NERIA merged 6 commits into
NVIDIA:mainfrom
VALLIS-NERIA:agent/nvbug-6374873-nvfp4-recurrent-cache

Conversation

@VALLIS-NERIA

@VALLIS-NERIA VALLIS-NERIA commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Improved mixed-precision KV-cache handling for hybrid Mamba and attention workloads.
    • Correctly supports FP4 attention caches alongside HALF-precision recurrent-state caches.
    • Fixed cache scale metadata alignment when layers use different cache pools or mappings.
    • Improved behavior for configurations with no locally managed Mamba layers.
  • Tests

    • Added coverage for mixed cache data types, pool allocation, scale handling, and layer routing.

Description

Fix NVFP4 KV-cache initialization for hybrid attention/Mamba models by forwarding per-window pool configurations and merging compact pointer tables in Python.

Root Cause

CppMambaHybridCacheManager created recurrent-state and attention windows but did not supply their pool_configurations to KVCacheManager. Consequently, C++ constructed an empty BlockManager::poolByWindow and fell back to the manager-level NVFP4 attention dtype for the recurrent-state window.

Recurrent-state structures do not support FP4. Their backing pool must use the model's actual SSM-state dtype, while the attention pool keeps the requested KV-cache dtype. The Python manager views the backing allocation as bytes when splitting SSM and convolution state sections.

With mixed recurrent-state and NVFP4 attention pools, C++ returns separate compact data-pointer and block-scale-pointer tables. Directly stacking those tensors fails when only some data pools have scales. Python aligns each compact scale row with its NVFP4 data row before stacking, so the final kv_cache_pool_pointers remains [num_data_pools, 2, 2] without changing the C++ pointer ABI.

Changes

  • Derive the local recurrent-state and attention pool configurations directly in CppMambaHybridCacheManager.
  • Use torch_dtype_to_binding(self.ssm_state_dtype) for the recurrent-state pool and the requested KV-cache dtype for attention.
  • Forward those configurations so C++ poolByWindow selects each pool's actual dtype.
  • Rank physical pool IDs into compact data rows, then place compact NVFP4 scale rows before torch.stack.
  • Rely on the C++ KVCacheManager producer contract for pointer shapes, dtypes, devices, mapping consistency, and scale cardinality instead of duplicating defensive checks in Python.
  • Preserve the prior two-dimensional pointer table when no block-scale pools exist.
  • Document and test that C++ exposes effective per-window pool configurations even when Python supplies none.
  • Add Python and C++ regression coverage for mixed SSM-state/NVFP4 pools, shared pools, unmanaged-layer gaps, and physical pool-ID gaps.

Test Coverage

  • Incremental build completed with scripts/build_wheel.py using SM100/SM103, ccache, benchmarks, and NIXL; no --clean rebuild was used.
  • tests/unittest/_torch/executor/test_mamba_cache_manager.py: 26 passed, including FP16, FP32, and BF16 recurrent pools.
  • tests/unittest/_torch/executor/test_resource_manager.py: 20 passed, 7 subtests passed.
  • KVCacheManagerTest.FP4*: 2 passed.
  • ModelOpt checkpoint metadata verified as quant_algo=NVFP4 and kv_cache_quant_algo=NVFP4 for Nemotron-Nano-3-30B-A3.5B-dev-1024.
  • End-to-end generation completed on B300 after the pointer-merge simplification; the checkpoint resolved kv_cache_quant_algo=NVFP4 and generated 8 tokens successfully.
  • Target-file pre-commit checks and git diff --check passed.

PR Checklist

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

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

…ent)

Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
…gent)

Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
…on (By Agent)

Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
…(By Agent)

Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
@VALLIS-NERIA
VALLIS-NERIA marked this pull request as ready for review July 13, 2026 09:29
@VALLIS-NERIA
VALLIS-NERIA requested review from a team as code owners July 13, 2026 09:29
@VALLIS-NERIA
VALLIS-NERIA requested review from syuoni and tomeras91 July 13, 2026 09:29
@VALLIS-NERIA

Copy link
Copy Markdown
Collaborator Author

/bot run

@VALLIS-NERIA VALLIS-NERIA changed the title [https://nvbugs/6374873][fix] Fix recurrent-state pools with NVFP4 KV cache [https://nvbugs/6374873][fix] Allow fp4 KV Cache + non-FP4 Mamba State Jul 13, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58947 [ run ] triggered by Bot. Commit: aadfab6 Link to invocation

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

CppMambaHybridCacheManager now passes explicit per-window pool configurations. KVCacheManager aligns NVFP4 scale pointers with physical pool mappings, with new C++ and Python tests covering mixed dtypes, pool allocation, mappings, and zero-local-Mamba cases.

Changes

Mixed KV cache pool handling

Layer / File(s) Summary
Per-window pool configuration
tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
Builds pool configurations for recurrent-state and attention windows with their corresponding dtypes.
NVFP4 pointer alignment
tensorrt_llm/_torch/pyexecutor/resource_manager.py
Aligns scale-pool pointers with physical KV cache pool ordering using layer mappings and pool dtypes.
Mixed-pool regression coverage
cpp/tests/unit_tests/batch_manager/kvCacheManagerTest.cpp, tests/unittest/_torch/executor/test_mamba_cache_manager.py, tests/unittest/_torch/executor/test_resource_manager.py
Adds coverage for mixed pool dtypes, allocation sizes, pointer shapes, mappings, compact scale rows, and zero-local-Mamba configurations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CppMambaHybridCacheManager
  participant KVCacheManager
  participant BlockManager
  CppMambaHybridCacheManager->>KVCacheManager: pass per-window pool_configurations
  KVCacheManager->>BlockManager: create typed cache pools
  KVCacheManager->>KVCacheManager: align NVFP4 scale pointers with pool mapping
Loading

Suggested reviewers: qijune, pengbowang-nv, longlee0622, mingyanghao, nv-guomingz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change and follows the repo’s required ticket/type/summary format.
Description check ✅ Passed The description includes the issue, solution, test coverage, and checklist, so it is mostly complete and on-template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tensorrt_llm/_torch/pyexecutor/resource_manager.py`:
- Around line 648-655: Update the dtype_by_window construction in the
kv_cache_block_scale_pool_pointers path to handle empty
self.impl.pool_configurations without raising. Reuse the manager-level
dtype/size fallback established by calculateMaxNumBlocks(), while preserving
per-window configuration values when pool_configurations is populated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c287418f-6632-4171-874b-ae433143195a

📥 Commits

Reviewing files that changed from the base of the PR and between a201a43 and aadfab6.

📒 Files selected for processing (5)
  • cpp/tests/unit_tests/batch_manager/kvCacheManagerTest.cpp
  • tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
  • tensorrt_llm/_torch/pyexecutor/resource_manager.py
  • tests/unittest/_torch/executor/test_mamba_cache_manager.py
  • tests/unittest/_torch/executor/test_resource_manager.py

Comment thread tensorrt_llm/_torch/pyexecutor/resource_manager.py
…Agent)

Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
@VALLIS-NERIA

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58960 [ run ] triggered by Bot. Commit: 122d555 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58947 [ run ] completed with state ABORTED. Commit: aadfab6

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58960 [ run ] completed with state SUCCESS. Commit: 122d555
/LLM/main/L0_MergeRequest_PR pipeline #47492 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@eopXD eopXD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The fix looks good to me.

@VALLIS-NERIA

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #59059 [ run ] triggered by Bot. Commit: 122d555 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #59059 [ run ] completed with state SUCCESS. Commit: 122d555
/LLM/main/L0_MergeRequest_PR pipeline #47584 completed with status: 'SUCCESS'

CI Report

Link to invocation

@VALLIS-NERIA
VALLIS-NERIA enabled auto-merge (squash) July 15, 2026 01:42
@VALLIS-NERIA
VALLIS-NERIA merged commit 999618e into NVIDIA:main Jul 15, 2026
11 checks passed
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 15, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims/ILogger (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims/ILogger -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 15, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims/ILogger (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims/ILogger -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 15, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims/ILogger (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims/ILogger -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 16, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 16, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 16, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 16, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 16, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- relocate the retained KVCacheEvent ctor and executor::version() into
  executor/kvCacheEvent.cpp
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 17, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- keep the retained KVCacheEvent ctor and executor::version() inline in
  executor.h (they are trivial; no separate .cpp needed)
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- remove classes orphaned by the engine-path removal: GuidedDecoder
  (the PyTorch backend has its own Python guided decoder; xgrammar stays
  for executor::GuidedDecodingConfig), IntervalSet and DynamicBatchTuner
  (both only consumed by the removed executorImpl), each with their tests;
  removing guidedDecoderTest empties cpp/tests/e2e_tests entirely
- restore the engine-free half of test_executor_bindings.py (config/
  request/result/response/stats construction and pickle tests) since the
  underlying bindings stay and serve the PyTorch backend; only the
  trtllm.Executor/engine-fixture tests are dropped; the second, duplicated
  test_speculative_decoding_config (shadowed, never ran) is renamed to
  test_decoding_config to match what it tests
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest, drop the
  empty tensorrt_llm::runtime forward-declaration block left in
  batch_manager/utils/debugUtils.h, narrow requestTest's
  using-namespace-common to a TllmException using-declaration (common now
  also exports DataType, which made the unqualified executor::DataType
  references ambiguous)
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 18, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- keep the retained KVCacheEvent ctor and executor::version() inline in
  executor.h (they are trivial; no separate .cpp needed)
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- remove classes orphaned by the engine-path removal: GuidedDecoder
  (the PyTorch backend has its own Python guided decoder; xgrammar stays
  for executor::GuidedDecodingConfig), IntervalSet and DynamicBatchTuner
  (both only consumed by the removed executorImpl), each with their tests;
  removing guidedDecoderTest empties cpp/tests/e2e_tests entirely
- restore the engine-free half of test_executor_bindings.py (config/
  request/result/response/stats construction and pickle tests) since the
  underlying bindings stay and serve the PyTorch backend; only the
  trtllm.Executor/engine-fixture tests are dropped; the second, duplicated
  test_speculative_decoding_config (shadowed, never ran) is renamed to
  test_decoding_config to match what it tests
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest, drop the
  empty tensorrt_llm::runtime forward-declaration block left in
  batch_manager/utils/debugUtils.h, narrow requestTest's
  using-namespace-common to a TllmException using-declaration (common now
  also exports DataType, which made the unqualified executor::DataType
  references ambiguous)
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist/
  allreduce-strategy tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Jul 19, 2026
Sever the C++ tree's compile- and link-time dependency on TensorRT so the
shared core (runtime, batch manager, executor API, KV cache, sampling,
kernels, nanobind bridge) builds, links, and runs without the TensorRT
library. Follows the Python TensorRT-backend removal (TRTLLM-14022);
PyTorch is the sole backend.

Internal types (serialization-compatible):
- add tensorrt_llm::DataType/Dims (common/tllmDataType.h); DataType
  enumerator values mirror nvinfer1::DataType for byte-compatible
  serialization, Dims layout mirrors nvinfer1::Dims
- migrate nvinfer1::DataType/Dims -> tensorrt_llm:: across 206
  surviving files; replace NvInfer*.h includes with the internal header;
  drop 12 dead NvInfer includes from files that never referenced nvinfer1
- add tests/unittest/bindings/test_datatype_parity.py guarding the
  enumerator values (auto-scheduled via the existing unittest/bindings
  test-db entries)

Remove the TensorRT-engine execution path (unused by the PyTorch backend):
- plugins/ (nvinfer_plugin_tensorrt_llm), engine runtime wrappers
  (tllmRuntime, tllmStreamReaders, layerProfiler, rawEngine, tllmLogger),
  TRT model adapters (trtGptModel*/trtEncoderModel/trtGptModelFactory),
  executor.cpp/executorImpl, the C++ Executor + TllmRuntime +
  LogitsPostProcessor nanobind bindings (0 Python users each),
  executor_worker, disaggServerUtil, engine I/O buffers and engine-only
  logits/decoder algos, executor/model.h (0 consumers), the ModelSpec test
  helper + binding (orphaned)
- keep the retained KVCacheEvent ctor and executor::version() inline in
  executor.h (they are trivial; no separate .cpp needed)
- decouple shared files (inflightBatchingUtils, medusaBuffers,
  lookaheadBuffers, dataTransceiver) from the removed engine runtime
- remove classes orphaned by the engine-path removal: GuidedDecoder
  (the PyTorch backend has its own Python guided decoder; xgrammar stays
  for executor::GuidedDecodingConfig), IntervalSet and DynamicBatchTuner
  (both only consumed by the removed executorImpl), each with their tests;
  removing guidedDecoderTest empties cpp/tests/e2e_tests entirely
- restore the engine-free half of test_executor_bindings.py (config/
  request/result/response/stats construction and pickle tests) since the
  underlying bindings stay and serve the PyTorch backend; only the
  trtllm.Executor/engine-fixture tests are dropped; the second, duplicated
  test_speculative_decoding_config (shadowed, never ran) is renamed to
  test_decoding_config to match what it tests
- delete the engine-driven C++ tests (e2e_tests engine tests,
  executorTestSmall*, tllmRuntimeTest, encDecBeamSearchTest,
  tests/utils engine builders), cudaGraphExecutorCacheTest (tests the
  removed CudaGraphExecutor), unit_tests/utils (tests the deleted
  tests/utils helpers), tests/unittest/others/test_leak.py (its body
  calls the removed python graph-building APIs; unscheduled in CI), C++ benchmarks (bertBenchmark,
  gptManagerBenchmark, disaggServerBenchmark; the prepare_dataset.py
  tooling used by trtllm-bench stays), examples/cpp executor examples,
  and the cpp/tests/resources engine-build scripts
- fix kept tests: strip vestigial never-consumed TllmLogger members
  (7 files), repoint ropeTest.cu to kernels/gptKernels.h (+ cudaUtils.h
  for QuantMode/getSMVersion), inline the engine-free
  createDecoderBatchInputs helper into gptDecoderBatchedTest, drop the
  empty tensorrt_llm::runtime forward-declaration block left in
  batch_manager/utils/debugUtils.h, narrow requestTest's
  using-namespace-common to a TllmException using-declaration (common now
  also exports DataType, which made the unqualified executor::DataType
  references ambiguous)
- make dependencies the deleted plugin target satisfied transitively
  explicit: MPI include dirs for cpp/tests, th_utils -> tensorrt_llm
  shared-lib link
- remove the IS_BUILDING build-time env contract end to end
  (common/opUtils.h isBuilding + attentionOp gate + _common.py half)
- remove the llm_args=None engine path from executor/base_worker.py
  (tllm.Executor no longer exists); llm_args is now required

Build/packaging (no TensorRT):
- drop find_package(TensorRT)/TRT_LIB/NvInfer include injection and the
  plugins/executor_worker/benchmarks subdirs from the cpp CMake;
  delete FindTensorRT.cmake
- build_wheel.py: trt_root optional (default None), drop the tensorrt
  venv check and the nvinfer_plugin/executorWorker/benchmarks targets
- setup.py no longer packages libnvinfer_plugin_tensorrt_llm.so /
  executorWorker; requirements.txt drops tensorrt
- jenkins/Build.groovy: drop --benchmarks, the benchmark/libnvinfer-plugin
  tarball packaging, and the build_cpp_examples.py step
- delist the removed tests from test-db/waives.txt/.test_durations and
  prune tests/integration/defs/cpp to the shared-core gtest wrappers

- CI-run fixes: respell the nvinfer1 usages a post-rebase main commit
  (NVIDIA#16304) added to kvCacheManagerTest; retire the two CI stages emptied by
  the delisting (A10-CPP-1, H100_PCIe-CPP-Post-Merge-1) and drop the
  duplicate tensorrt-chunk scheduling of unittest/disaggregated/test_router.py;
  make test_to_stage_mapping's CLI check sample only stage-mapped tests
- point the remaining benchmarks/cpp references (AutoDeploy bench/dist/
  allreduce-strategy tests,
  llmc standalone packager + its test, trtllm-bench docs) at benchmarks/ and
  drop the orphaned get_cpp_benchmark() helper
- fix the two OSS-mode gtest compile failures unmasked by dropping the
  nvinfer_plugin link (its PUBLIC USING_OSS_CUTLASS_*_GEMM defines had leaked
  into every gtest, keeping the internal-only branches dormant): inline the
  deleted tests/utils GpuTimer into gemmAllReduceTest.cu, and only add the
  mixtureOfExpertsInternalTest target when INTERNAL_CUTLASS_KERNELS_PATH
  provides the internal headers it includes

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@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.

5 participants