Repository navigation
Description
🚀 The feature, motivation and pitch
Motivation
Distributed inference traces need structured metadata to identify execution phases, communication operations, and data movement across ranks. This would enable downstream tools, including Chakra, to construct a combined execution DAG for performance analysis and simulation.
The proposal adds metadata at existing TRT-LLM execution boundaries without introducing a new execution framework.
Proposed architecture
- Extend the existing PyTorch profiler and execution-trace infrastructure.
- Use native C++ ATen RecordFunction scopes and Python profiling helpers to emit structured metadata.
- Make custom instrumentation opt-in, with lazy metadata construction when the relevant profiling callbacks are active.
- Preserve existing scheduling, communication, memory-management, and CUDA Graph behavior.
- Avoid adding device-to-host tensor reads or synchronization solely to collect metadata.
- Keep cross-rank matching and combined-DAG construction in downstream post-processing.
Proposed PR breakdown
- Profiling foundation: native scope helpers, metadata encoding, and activation controls.
- Trace capture: profiler configuration and trace-output integration.
- Workflow metadata: execution phases, iteration/microbatch identifiers, live request/token counts, and CUDA Graph padding information.
- MPI metadata: instrumentation at existing MPI communication boundaries.
- NCCL metadata: instrumentation at existing collective and point-to-point communication boundaries.
- Native bindings: expose the profiling functionality through the existing bindings.
- KV-transfer metadata: instrument existing cross-rank KV-cache transfers.
- MoE metadata: instrument existing MoE routing and execution boundaries.
A proposed ninth follow-up would instrument existing CPU↔GPU KV-cache offload and restore paths. It would not change the offload algorithm or transfer ordering.
The PRs are intended to form a surgical, stacked series, with each PR documenting its dependencies.
Validation plan
- Unit tests for metadata encoding and instrumentation activation.
- Checks that inactive instrumentation does not construct metadata unnecessarily.
- Native build and bindings validation.
- GPU validation of emitted metadata and unchanged execution behavior.
- Multi-rank eager and CUDA Graph runs.
- End-to-end dense, MoE, and disaggregated inference tracing.
Full-model end-to-end validation is still pending and will be reported separately. Complete cross-rank DAG reconstruction is a downstream goal, not a capability claimed as validated by this proposal.
Feedback requested
Please review and approve:
- The instrumentation architecture and ownership boundaries.
- The metadata contract and naming conventions.
- The proposed PR breakdown and dependencies.
- The validation requirements for upstream acceptance.
Alternatives
No response
Additional context
No response
Before submitting a new issue...
- Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
Activity