Repository navigation
Conversation
rikundu
force-pushed
the
chakra/pr-9
branch
4 times, most recently
from
October 23, 2026 09:01
d09e8a6 to
0988d98
Compare
rikundu
marked this pull request as ready for review
November 2, 2026 04:15
rikundu
requested review from
BowenFu,
QiJune,
ZhanruiSunCh,
cascade812,
chienchunhung,
eopXD,
laikhtewari,
leslie-fang25,
mikeiovine,
nv-guomingz,
reasonsolo,
rosong11,
tburt-nv,
thorjohnsen and
xxi-nv
November 2, 2026 04:15
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
…ution Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
Signed-off-by: Rishabh Kundu <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add native
kv_cache_offloadandkv_cache_onboardCPU scopes at actual V1 pool-copy and V2 batched host/device submission boundaries. SelectkvinTLLM_PROFILE_CUSTOM_REGIONS; PyTorch builds support these scopes independently of the NCCL/nanobind options.Metadata records direction, manager version, copy count and payload bytes. V2 counts only GPU-backed hot pools; encoded page size remains separate. V1 distinguishes copied payload from allocation pitch and handles partial/full-copy paths. Optional numeric CUDA stream IDs are queried lazily without consuming a pending CUDA error; unrepresentable integer fields are omitted. Disk staging, device reuse and host-only copies are excluded. Scopes measure enqueue work, not asynchronous completion, and add no synchronization.
Issue #20407 · Stack 9/9, cumulative against
main(27b44ebb). Depends on PR8 and earlier layers; merge those first, then rebase onto updated main before merging. This layer’s diff.Test Coverage
Rebase verification on final stacked head
c11366d8: profiler contracts, affected upstream CPU regressions, and all 36 CUDA graph cases passed with ON/OFF source overlays. Native/build inputs are unchanged from the fresh ON/OFF Release FAST_BUILD SM86 wheels built at6443dc65on A6000s; those binaries were reused. These are final-stack checks, not separate builds of intermediate heads. Fresh current-head Jenkins builds remain pending.PR Checklist
Pending before merge: current-head Jenkins, reviewer approval, and dependency checks where applicable.
Dev Engineer Review
BUILD_PYTand the patched nanobind runtime. NCCL profiling also requiresENABLE_MULTI_DEVICE.RelWithDebInfoprofiling artifact without cache reuse and checks 13 native profiler cases. The configuration is present, but execution success is not established.QA Engineer Review
test_mpi_profilertol0_cpu.yml.test_nccl_profiler_build_contract[off]tol0_dgx_h100.yml.test_graph_capture_skips_only_profiler_serializationtol0_h100.yml.test_nccl_profiler_build_contract[on]tol0_nccl_profiler.yml.l0_cpu.ymlalso listsunittest/_torch/executor/test_workflow_profiler.py; direct list entries for every new unit-test module are not evidenced.Per-File QA Perspective
Source, configuration, and documentation
3rdparty/fetch_content.json— Applies the nanobind profiler patch. Verify dependency fetching and reproducible builds.3rdparty/patches/nanobind_pytorch_profiler.patch— Adds tensor metadata and nanobind profiler records. Verify PyTorch 2.14+, limited-API, free-threaded, property, and failure paths.cpp/CMakeLists.txt— Adds independent nanobind and NCCL profiling options and dependency checks. Verify all ON/OFF combinations.cpp/include/tensorrt_llm/common/profiler.h— Adds public profiler-region, metadata, and scope APIs. Verify ownership, ABI, and no-op behavior.cpp/tensorrt_llm/batch_manager/CMakeLists.txt— Links KV-cache targets totllm::common_profilerunderBUILD_PYT. Verify non-PyTorch builds.cpp/tensorrt_llm/batch_manager/kvCacheTransferManager.cpp— Changes partial-copy and transfer-byte calculations. Verify data types, scales, layer-first pools, zero tokens, and partial blocks.cpp/tensorrt_llm/batch_manager/kvCacheTransferProfiler.h— Adds V1/V2 KV-transfer scopes and metadata. Verify direction inference, stream-ID omission, reuse exclusion, and non-Torch builds.cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/storageManager.cpp— Adds V2 migration scopes and GPU-pool byte accounting. Verify sparse host pools, disk pools, page counts, and stream metadata.cpp/tensorrt_llm/common/CMakeLists.txt— Builds and exports the common profiler library. Verify public linkage and non-PyTorch configuration.cpp/tensorrt_llm/common/profiler.cpp— Implements selector parsing, metadata serialization, and fail-open scopes. Verify defaults,none, duplicates, malformed input, and cleanup failures.cpp/tensorrt_llm/nanobind/CMakeLists.txt— Builds and substitutes a profiled nanobind runtime. Verify patched-header detection and target linkage.cpp/tensorrt_llm/nanobind/bindings.cpp— Initializes selector diagnostics and exposes build flags. Verify startup warnings and GPU-less extension loading.cpp/tensorrt_llm/thop/ncclCommunicatorOp.cpp— Adds NCCL send/receive metadata. Verify eager, capture, unknown-capture, rank, shape, dtype, and replay paths.cpp/tensorrt_llm/thop/ncclCommunicatorOp.h— Updates communicator documentation and conditional state. Verify documentation matches runtime behavior.cpp/tests/unit_tests/batch_manager/CMakeLists.txt— Registers the KV profiler GPU test. Verify exclusion whenBUILD_PYTis disabled.cpp/tests/unit_tests/common/CMakeLists.txt— RegistersprofilerTestand selector-case data. Verify the target is built in the intended configuration.docs/source/developer-guide/kv-transfer-profiler.md— Documents correlated and native KV profiling. Verify lifecycle and exclusion statements.docs/source/developer-guide/kv-transfer.md— Adds the KV profiling link. Verify navigation.docs/source/developer-guide/moe-perf-guide.md— Adds the MoE profiler link. Verify synchronization-limit statements.docs/source/developer-guide/moe-routing-profiler.md— Documents MoE shape and expert-ID profiling. Verify restrictions match implementation.docs/source/developer-guide/nccl-profiler-metadata.md— Documents NCCL, MPI, and execution-trace metadata. Verify build-option and replay statements.docs/source/developer-guide/perf-analysis.md— Documents selectors and profile filenames. Verify examples match runtime paths.docs/source/developer-guide/profiler-metadata.md— Documents the shared selector and metadata contract. Verify Python/C++ consistency.docs/source/developer-guide/workflow-profiler-regions.md— Documents workflow boundaries and metadata. Verify capture-time and replay claims.docs/source/index.rst— Adds five profiler pages to the guide. Verify links resolve.jenkins/Build.groovy— Adds the profiling artifact and 13-case native test gate. Verify archive creation and result parsing.jenkins/L0_MergeRequest.groovy— Expands multi-GPU path triggers. Verify profiler changes select the intended stages.jenkins/L0_Test.groovy— Maps profiling stages to the profiling artifact. Verify stage and artifact selection.tensorrt_llm/__init__.py— Initializes native profiler regions during import. Verify import ordering and GPU-less behavior.tensorrt_llm/_profiler.py— Adds Python selectors, metadata, workflow scopes, and MoE helpers. Verify fail-open behavior, cycles, CUDA capture, and no-copy routing-ID collection.tensorrt_llm/_torch/disaggregation/base/transfer.py— Centralizes wire request-ID precedence. Verify disaggregated, context, and local IDs.tensorrt_llm/_torch/disaggregation/kv_cache_transceiver.py— Adds profiling hooks and transceiver defaults. Verify compatibility with existing implementations.tensorrt_llm/_torch/disaggregation/native/transfer.py— Reuses centralized wire-ID selection. Verify native session IDs.tensorrt_llm/_torch/disaggregation/profiler.py— Correlates request-scoped submit and terminal observations. Verify ownership, cancellation, shutdown, weak references, and exceptions.tensorrt_llm/_torch/disaggregation/transceiver.py— Tracks terminal send outcomes. Verify retirement and shutdown cleanup.tensorrt_llm/_torch/distributed/communicator.py— Adds MPI scopes and type annotations. Verify unchanged collective arguments, results, and exceptions.tensorrt_llm/_torch/models/modeling_step3p7.py— Warns for unsupported Python MoE routing. Verify routed-expert LoRA behavior.tensorrt_llm/_torch/moe/fused_moe/create_moe.py— Warns for Triton and vanilla routing backends. Verify backend construction is unchanged.tensorrt_llm/_torch/moe/fused_moe/moe_scheduler.py— Records routed and prerouted expert IDs. Verify empty-token, chunked, replay, and graph paths.tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py— Adds graph capture and replay metadata. Verify heterogeneous encoder inputs.tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/inputs.py— Adds theprepare_inputsscope. Verify results and exceptions.tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/runner.py— Adds model-forward metadata. Verify warmup and padded-row values.tensorrt_llm/_torch/pyexecutor/profiling.py— Changes multi-range and early-exit trace filenames. Verify collisions and runtime captures.tensorrt_llm/_torch/pyexecutor/py_executor.py— Adds executor scopes and phase metadata. Verify phase classification, encoder rows, dummy requests, and microbatch IDs.tensorrt_llm/_torch/route_capture.py— Adds delayed route-copy callbacks. Verify original-step metadata and no synchronization.Test files and test lists
cpp/tests/unit_tests/batch_manager/kvOffloadProfilerTest.cpp— Covers V1/V2 round trips, directions, payload bytes, streams, cold tiers, sparse pools, disabled profiling, and reuse. Registered through CMake; no separatetest-dbentry is shown.cpp/tests/unit_tests/common/profilerTest.cpp— Covers native selector caching, lazy factories, callback requirements, scope counts, and exception preservation. NCCL cases depend on the profiling option.tests/integration/defs/test_unittests.py— Adds MPI and NCCL profiler integration functions. Verify rank-report validation and build-flag checks.tests/integration/test_lists/test-db/l0_cpu.yml— Addstest_mpi_profilerand CPU profiler coverage, including the workflow-profiler module.tests/integration/test_lists/test-db/l0_dgx_h100.yml— Addstest_nccl_profiler_build_contract[off]for the disabled-probe contract.tests/integration/test_lists/test-db/l0_h100.yml— Adds the MoE graph-capture regression test.tests/integration/test_lists/test-db/l0_nccl_profiler.yml— Adds the enabled NCCL build-contract test for two H100 GPUs with PyTorch and MPI.tests/unittest/_torch/disaggregation/fake_kv_cache_transceiver.py— Adds fake status-ID behavior for profiling tests. Verify production ID precedence.tests/unittest/_torch/disaggregation/test_disagg_idle_cancellation.py— Initializes send-outcome state in the fixture. Verify idle cancellation terminal paths.tests/unittest/_torch/disaggregation/test_kv_transfer_profiler.py— Covers submit/terminal correlation, cancellation, ownership uncertainty, failures, cleanup, delegation, and wire IDs. No direct test-list entry is shown.tests/unittest/_torch/distributed/test_communicator_profiler.py— Covers MPI metadata, payloads, subgroup caching, exceptions, and two-rank behavior. No direct test-list entry is shown.tests/unittest/_torch/distributed/test_nccl_profiler.py— Covers NCCL eager/capture metadata, replay, build flags, selectors, and dispatcher boundaries. Related integration coverage is listed.tests/unittest/_torch/executor/test_profile_window_filenames.py— Covers profile ranges, runtime captures, early exits, execution traces, and missing Chrome paths. No direct test-list entry is shown.tests/unittest/_torch/executor/test_workflow_profiler.py— Covers workflow metadata, phases, graphs, failures, ordering, counts, and microbatch slots. The module is listed inl0_cpu.yml.tests/unittest/_torch/moe/test_moe_profiler.py— Covers routing shapes, completed IDs, scheduler paths, warnings, graph capture, and failure preservation. Its graph-capture regression is listed inl0_h100.yml.tests/unittest/_torch/pyexecutor/test_cuda_graph_capture_replay.py— Covers decoder and encoder capture/replay events and latest-input behavior. Related coverage is listed inl0_h100.yml.tests/unittest/_torch/test_route_capture.py— Covers delayed and out-of-order route copies, callback metadata, inactive profiling, and no synchronization. No direct test-list entry is shown.tests/unittest/bindings/test_nanobind_profiler.py— Covers binding tensor metadata, selectors, warnings, stubs, and GPU-less extension initialization. No direct test-list entry is shown.tests/unittest/disaggregated/test_cache_reuse_adapter.py— Initializes profiling state in cache-reuse fixtures. Verify fixture behavior remains representative.tests/unittest/disaggregated/test_chunked_transfer.py— Updates failed-send and outcome-observation fixtures. No direct test-list entry is shown.tests/unittest/disaggregated/test_disagg_transfer_diagnostics_wiring.py— Initializes profiler state in diagnostic fixtures. Verify native diagnostic paths.tests/unittest/disaggregated/test_kv_transfer_fail_stop.py— Initializes profiler state in fail-stop fixtures. Verify pending-observation shutdown.tests/unittest/disaggregated/test_transceiver_bounded_polling.py— Updates bare-transceiver and request-ID fixtures. Verify bounded polling behavior.tests/unittest/disaggregated/test_transfer_ownership_regressions.py— Initializes profiler state in ownership fixtures. Verify constructor-independent coverage.tests/unittest/profiler_selector_cases.json— Defines valid and invalid selector cases. Verify packaging and runtime availability.tests/unittest/profiler_test_utils.py— Adds shared selector, observer, filtering, and metadata-decoding helpers. Verify malformed and unsupported metadata handling.tests/unittest/test_profiler.py— Covers selector contracts, metadata, scopes, decorators, traces, lazy factories, and failure preservation. Related profiler coverage is added tol0_cpu.yml.tests/unittest/tools/test_unittest_culprits.py— Covers MPI per-rank JUnit success, skip, failure, missing, stale, and empty reports. No direct test-list entry is shown.