-
Notifications
You must be signed in to change notification settings - Fork 2k
[None][feat] add detailed KV cache transfer time breakdown #8521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughRefactors timing instrumentation and const-correctness in TensorRT-LLM batch manager. Replaces simple delay/duration metrics with explicit TimePoint-based measurements, introduces timing phase markers (formatter, preprocess, transmissions, postprocess), renames environment variable from transfer to time output, updates static/mutable semantics in LlmRequest, and adjusts CSV export headers. Changes
Sequence DiagramsequenceDiagram
participant Client
participant Session
participant Formatter
participant Transfer
participant Export
Client->>Session: create TransferSession(recordTiming=true)
Session->>Session: mTimes = make_unique<KVCacheTimes>()
Formatter->>Session: setTime(kTimeFormatter)
Session->>Session: times[kTimeFormatter] = now()
Formatter->>Session: setTime(kTimePreprocess)
Session->>Session: times[kTimePreprocess] = now()
Transfer->>Session: setTime(kTimeTransmissions)
Session->>Session: times[kTimeTransmissions] = now()
Transfer->>Session: appendMeasure(startTime, endTime, size)
Session->>Session: measures.push_back({start, end, size})
Transfer->>Session: setTime(kTimePostprocess)
Session->>Session: times[kTimePostprocess] = now()
Client->>Export: exportMeasure()
Export->>Export: calc delays from times[] and measures
Export->>Export: write "RequestID,RequestInfo,Preparation,..."
Export->>Client: CSV with expanded timing info
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes This refactor spans multiple interconnected systems with both API-breaking changes and semantic shifts. Review requires understanding: (1) const-correctness implications and static method migrations in LlmRequest; (2) the new TimePoint-based measurement model and how it replaces delay/duration calculations; (3) the cascading updates across cache formatters, transceiver, and export logic; (4) the environment variable rename propagation; and (5) test assertion adjustments reflecting the new CSV structure. The heterogeneity of changes across timing infrastructure, header files, and implementations increases cognitive load despite individual file changes being relatively localized. Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cpp (1)
416-436: Possible buffer index mismatch can send the wrong slice.Else-path uses outputSplitCaches[processIdx] while if-path uses outputSplitCaches[bufferIdx]. These indices can differ; sizes/tensors may not correspond to the intended peer, risking corruption or mis-accounting.
Apply consistent indexing:
- size_t remainSendSize = outputSplitCaches[processIdx]->getSize(); - size_t needSendSize = outputSplitCaches[processIdx]->getSize(); + size_t remainSendSize = outputSplitCaches[bufferIdx]->getSize(); + size_t needSendSize = outputSplitCaches[bufferIdx]->getSize(); @@ - auto copySlice = runtime::ITensor::slice( - outputSplitCaches[bufferIdx], needSendSize - remainSendSize, sendSize); + auto copySlice = runtime::ITensor::slice( + outputSplitCaches[bufferIdx], needSendSize - remainSendSize, sendSize); @@ - session.send(processIdx, copyTargetSlice->data(), copyTargetSlice->getSizeInBytes()); + session.send(processIdx, copyTargetSlice->data(), copyTargetSlice->getSizeInBytes());Also set size from the same index:
- size_t size = outputSplitCaches[bufferIdx]->getSizeInBytes(); + size_t size = outputSplitCaches[bufferIdx]->getSizeInBytes();cpp/tensorrt_llm/batch_manager/cacheFormatter.cpp (1)
743-792: Data race: kvCacheSize updates from parallel receive tasks.recvBufferFun calls llmRequest.updateKvCacheSize(...) on multiple threads when parallel receive is enabled. If the setter isn’t atomic/thread‑safe, this is undefined behavior.
Proposed fix: accumulate per-task sizes and update once on the main thread.
@@ - auto recvBufferFun = [&](int deviceId, size_t processIdx) + // Per-connection byte counters + std::vector<size_t> perConnBytes(pickUpConnections.size(), 0); + auto recvBufferFun = [&](int deviceId, size_t processIdx) { @@ - size_t size = 0; + size_t size = 0; @@ - llmRequest.updateKvCacheSize((*recvSplitCaches.at(processIdx)).getSizeInBytes()); auto& buffer = recvSplitCaches[processIdx]; size = buffer->getSizeInBytes(); @@ - size += recvSlice->getSizeInBytes(); - llmRequest.updateKvCacheSize((*recvSlice).getSizeInBytes()); + size += recvSlice->getSizeInBytes(); @@ - auto endTime = llmRequest.getSteadyClockNow(); - session.appendMeasure(startTime, endTime, size); + auto endTime = llmRequest.getSteadyClockNow(); + session.appendMeasure(startTime, endTime, size); + perConnBytes[processIdx] = size; }; @@ - else - { - recvBufferFun(deviceId, 0); - } + else { recvBufferFun(deviceId, 0); } + // Single-thread update to avoid data races + { + size_t total = 0; + for (auto b : perConnBytes) { total += b; } + if (total) { llmRequest.updateKvCacheSize(total); } + }If updateKvCacheSize is an additive API, the above remains correct; otherwise replace with a set/assign variant.
🧹 Nitpick comments (2)
cpp/tensorrt_llm/batch_manager/cacheFormatter.cpp (1)
392-441: Minor: measure size accounting on send path can be wrong in fallback branch.size is taken from outputSplitCaches[bufferIdx], but the fallback copies from a potentially different slice (processIdx). Use the same index for both branches to keep Duration/Bandwidth accurate.
See the related fix suggested in cacheTransceiver.cpp for consistent indexing.
cpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cpp (1)
246-246: Consider calling static method directly for clarity.The method
getSteadyClockNow()is now static (as changed in llmRequest.h), so calling it via the instance (llmRequest.getSteadyClockNow()) works but is less clear than calling it directly asLlmRequest::getSteadyClockNow().Apply this diff to improve clarity:
- auto startTime = llmRequest.getSteadyClockNow(); + auto startTime = LlmRequest::getSteadyClockNow();(Repeat for line 448 and line 279/481 if capturing endTime similarly)
Also applies to: 448-448
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
cpp/include/tensorrt_llm/batch_manager/llmRequest.h(5 hunks)cpp/include/tensorrt_llm/executor/types.h(1 hunks)cpp/tensorrt_llm/batch_manager/cacheFormatter.cpp(9 hunks)cpp/tensorrt_llm/batch_manager/cacheTransceiver.cpp(1 hunks)cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp(10 hunks)cpp/tensorrt_llm/batch_manager/dataTransceiver.h(3 hunks)cpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cpp(9 hunks)cpp/tensorrt_llm/common/envUtils.cpp(1 hunks)cpp/tensorrt_llm/common/envUtils.h(1 hunks)cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp(1 hunks)tests/integration/defs/disaggregated/test_disaggregated.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh}: Namespace closing braces must include a trailing comment with the namespace name (e.g., '} // namespace foo').
Prefer const or constexpr variables over #define for constants.
Declare variables that are not modified after initialization as const.
Avoid magic literals in code; except for 0, nullptr, true, false. Use named constants for comparisons and logic.
Use Allman brace style for formatting.
Place the semicolon of an empty for/while loop on a new line.
Bodies of switch/while/do-while/for must be compound statements (brace-delimited), and if/else must always be followed by brace-delimited statements.
Type names (e.g., classes) must be CamelCase starting with an uppercase letter (e.g., FooBar).
Local variables, methods, and namespaces use lowerCamelCase (e.g., localFooBar).
Non-magic-number global variables that are non-static and not in an anonymous namespace must be lowerCamelCase prefixed with 'g' (e.g., gDontUseGlobalFoos).
Non-magic-number globals that are static or in an anonymous namespace use lowerCamelCase prefixed with 's' (e.g., sMutableStaticGlobal).
Locally visible static variables use lowerCamelCase with 's' prefix (e.g., static std::once_flag sFlag).
Private/protected member variables use 'm' prefix with CamelCase (e.g., mNbFooValues). Public members may omit, but 'm' is encouraged for clarity.
Constants (enums, global constants, static constants, and function-scope magic/literal constants) use uppercase SNAKE_CASE with 'k' prefix (e.g., kDIGIT_NUM).
Function-scope constants that are not magic numbers or literals are named like non-constant variables (e.g., bool const pass = a && b).
If macros are necessary, name them in UPPER_SNAKE_CASE (e.g., FOO_VERSION) and prefer constants over #define.
Use LLVM clang-format; wrap lines at a maximum of 120 columns; use '// clang-format off/on' sparingly with justification.
Use smart pointers for heap allocations; prefer unique_ptr for sole ownership, shared_ptr for shared...
Files:
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cppcpp/tensorrt_llm/nanobind/batch_manager/bindings.cppcpp/tensorrt_llm/batch_manager/cacheFormatter.cppcpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cppcpp/tensorrt_llm/common/envUtils.cppcpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.hcpp/tensorrt_llm/batch_manager/dataTransceiver.cpp
**/*.{cpp,cxx,cc,cu,h,hpp,hh,hxx,cuh}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
C++ filenames should be lowerCamelCase (first letter lowercase) and must be case-insensitive unique within a compilation target.
Files:
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cppcpp/tensorrt_llm/nanobind/batch_manager/bindings.cppcpp/tensorrt_llm/batch_manager/cacheFormatter.cppcpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cppcpp/tensorrt_llm/common/envUtils.cppcpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.hcpp/tensorrt_llm/batch_manager/dataTransceiver.cpp
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use only spaces, no tabs; indent with 4 spaces.
Files:
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cppcpp/tensorrt_llm/nanobind/batch_manager/bindings.cppcpp/tensorrt_llm/batch_manager/cacheFormatter.cppcpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cppcpp/tensorrt_llm/common/envUtils.cpptests/integration/defs/disaggregated/test_disaggregated.pycpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.hcpp/tensorrt_llm/batch_manager/dataTransceiver.cpp
**/*.{h,hpp,hh,hxx,cpp,cxx,cc}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc}: Prefer anonymous namespaces over 'static' for internal linkage of functions.
All templates (class/function/member/static) must be instantiated at least once; non-POD classes should have private data members.
Files:
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cppcpp/tensorrt_llm/nanobind/batch_manager/bindings.cppcpp/tensorrt_llm/batch_manager/cacheFormatter.cppcpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cppcpp/tensorrt_llm/common/envUtils.cppcpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.hcpp/tensorrt_llm/batch_manager/dataTransceiver.cpp
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Files:
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cppcpp/tensorrt_llm/nanobind/batch_manager/bindings.cppcpp/tensorrt_llm/batch_manager/cacheFormatter.cppcpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cppcpp/tensorrt_llm/common/envUtils.cpptests/integration/defs/disaggregated/test_disaggregated.pycpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.hcpp/tensorrt_llm/batch_manager/dataTransceiver.cpp
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.
Files:
tests/integration/defs/disaggregated/test_disaggregated.py
**/*.{h,hpp,hh,hxx}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Document new class interfaces and function prototypes with Doxygen; use //! for single-line and //!< for members.
Files:
cpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.h
**/*.{h,hpp,hh,hxx,cuh}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use include guards named 'TRTLLM_<FILE_NAME_IN_CAPS_WITH_UNDERSCORES>_H' (no leading or trailing underscore; directory names excluded).
Files:
cpp/tensorrt_llm/common/envUtils.hcpp/include/tensorrt_llm/executor/types.hcpp/tensorrt_llm/batch_manager/dataTransceiver.hcpp/include/tensorrt_llm/batch_manager/llmRequest.h
🧠 Learnings (1)
📚 Learning: 2025-08-06T08:18:28.669Z
Learnt from: zhengd-nv
PR: NVIDIA/TensorRT-LLM#6633
File: cpp/tensorrt_llm/batch_manager/dataTransceiverImpl.cpp:145-155
Timestamp: 2025-08-06T08:18:28.669Z
Learning: In cpp/tensorrt_llm/batch_manager/dataTransceiverImpl.cpp, the existing `mMtxForMap` mutex in DataSenderImpl is sufficient to synchronize measurement file operations in the `release` method, as all file operations occur within the same critical section that protects the `mRequestToSession` map access.
Applied to files:
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp
🧬 Code graph analysis (7)
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cpp (1)
cpp/tensorrt_llm/common/envUtils.cpp (2)
getEnvKVCacheTimeOutputPath(383-387)getEnvKVCacheTimeOutputPath(383-383)
cpp/tensorrt_llm/batch_manager/cacheFormatter.cpp (1)
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp (4)
session(777-792)session(777-777)session(937-962)session(937-937)
cpp/tensorrt_llm/batch_manager/mlaCacheFormatter.cpp (1)
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp (4)
session(777-792)session(777-777)session(937-962)session(937-937)
cpp/tensorrt_llm/common/envUtils.h (1)
cpp/tensorrt_llm/common/envUtils.cpp (2)
getEnvKVCacheTimeOutputPath(383-387)getEnvKVCacheTimeOutputPath(383-383)
cpp/tensorrt_llm/batch_manager/dataTransceiver.h (1)
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp (19)
llmRequest(294-294)llmRequest(399-411)llmRequest(399-399)llmRequest(413-430)llmRequest(413-413)llmRequest(737-737)llmRequest(743-743)llmRequest(794-876)llmRequest(794-794)llmRequest(878-894)llmRequest(878-878)llmRequest(908-935)llmRequest(908-908)llmRequest(978-1001)llmRequest(978-978)setTime(108-114)setTime(108-108)appendMeasure(116-122)appendMeasure(116-116)
cpp/include/tensorrt_llm/batch_manager/llmRequest.h (1)
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp (8)
nodiscard(294-310)nodiscard(312-315)nodiscard(322-328)nodiscard(349-397)nodiscard(689-692)nodiscard(694-698)nodiscard(737-741)nodiscard(743-775)
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp (1)
cpp/tensorrt_llm/common/envUtils.cpp (2)
getEnvKVCacheTimeOutputPath(383-387)getEnvKVCacheTimeOutputPath(383-383)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Pre-commit Check
🔇 Additional comments (13)
cpp/tensorrt_llm/common/envUtils.cpp (1)
383-387: Renamed getter looks good; confirm one-time caching is intended.Static init caches the env value for the process lifetime. If dynamic reconfiguration via env is expected, switch to call-by-call getenv or add a reload hook.
cpp/tensorrt_llm/batch_manager/cacheTransceiver.cpp (1)
606-610: Switched gating to KV cache time output path.Matches envUtils rename; behavior unchanged. LGTM.
cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp (1)
386-387: Binding swap to sGlobalSteadyClockOffset is correct.Name matches static member; Python API remains unchanged. LGTM.
cpp/tensorrt_llm/common/envUtils.h (1)
99-100: Header rename aligns with implementation and callers.Signature matches cpp; OK.
tests/integration/defs/disaggregated/test_disaggregated.py (1)
856-862: Tests reflect the new CSV schema.Header check and minimal field count updates look right; recv matching logic unchanged. LGTM.
cpp/tensorrt_llm/batch_manager/cacheFormatter.cpp (2)
184-191: Good: added kTimeFormatter anchors at start of format/unformat.This enables RequestInfo→Formatter deltas. No functional risk.
Also applies to: 494-501
376-389: Time anchors placement looks correct.kTimePreprocess before split/alloc work; kTimeTransmissions after sends/recvs; kTimePostprocess after free/concat. Matches the intended phase breakdown.
Please confirm dataTransceiver’s CSV exporter maps these anchors to “Preparation, Preprocess, Transmissions, Postprocess” as the test expects.
Also applies to: 484-489, 732-739, 838-854
cpp/include/tensorrt_llm/executor/types.h (1)
454-455: No issues found—removal of mutable is correct.The change is valid. Although const methods (
updateKvCacheSize,setKvCacheSize) inllmRequest.hwrite tokvCacheSize, they do so throughmutable executor::RequestPerfMetrics mPerfMetrics(line 2031). Since the container is mutable, writes to its nestedkvCacheSizemember succeed even without individual member mutability, representing tighter and more correct const-correctness.cpp/include/tensorrt_llm/batch_manager/llmRequest.h (1)
1694-1712: LGTM! Const-correctness and static method refactoring are well done.The changes correctly improve const-correctness and convert timing utilities to static methods:
setKvCacheTransferStart/Endmethods are nowconst, allowing them to be called on const LlmRequest references (appropriate sincemPerfMetricsismutable)getSteadyClockNow()converted to static is correct—it uses only static state (sGlobalSteadyClockOffset)- Renaming
mGlobalSteadyClockOffsettosGlobalSteadyClockOffsetfollows the coding guidelines for static variables (s prefix)- Parameter change from
TimePoint const&toTimePointis acceptable for small types and may improve performance by avoiding indirectionAs per coding guidelines.
Also applies to: 1870-1873, 1895-1895, 2031-2031, 2184-2191
cpp/tensorrt_llm/batch_manager/dataTransceiver.cpp (4)
108-122: LGTM! Timing data collection properly implemented.The new methods correctly implement TimePoint-based timing:
setTimestores the current timestamp at named phasesappendMeasurecaptures start/end times and size for each transmission- Both methods properly guard against null
mTimespointer
147-159: Verify unset timepoint handling logic.Lines 150-155 handle unset timepoints by writing
0.0and skippingpreviousTimeupdate. This means subsequent deltas are computed from the last valid timestamp, not from the unset one. While this may be intentional defensive coding, it could produce misleading output (e.g., two consecutive non-zero periods summing to the actual elapsed time).Under what conditions would a timepoint remain unset (default-constructed)? Given that
setTimeis called at each phase (as seen in mlaCacheFormatter.cpp lines 125, 234, 324, 326, 335, 436, 531, 550), all timepoints should be populated. If unset timepoints are not expected in normal operation, consider either:
- Asserting that all timepoints are set (fail-fast on logic errors), or
- Adding a comment explaining when/why timepoints might be unset and clarifying that the reported time periods reflect actual work done (excluding unset phases)
124-169: LGTM! CSV export logic correctly computes timing metrics.The export implementation properly computes:
- Time periods between consecutive phase markers (RequestInfo, Preparation, Preprocess, Transmissions, Postprocess)
- Per-transmission delay, duration, and bandwidth from the
MeasureentriesThe reset of
previousTimetokTimePreprocess(line 160) before processing measures is correct, as individual transmissions occur between preprocessing and postprocessing.
185-185: LGTM! Environment variable renamed consistently.All references updated from
getEnvKVCacheTransferOutputPath()togetEnvKVCacheTimeOutputPath(), aligning with the new focus on detailed time breakdown rather than generic transfer output.Also applies to: 335-335, 390-390, 780-780, 875-875
|
/bot run |
|
PR_Github #22017 [ run ] triggered by Bot. Commit: |
|
PR_Github #22017 [ run ] completed with state |
|
/bot run |
|
PR_Github #22112 [ run ] triggered by Bot. Commit: |
|
PR_Github #22112 [ run ] completed with state |
|
/bot run |
|
PR_Github #22159 [ run ] triggered by Bot. Commit: |
|
PR_Github #22159 [ run ] completed with state |
|
/bot run |
|
PR_Github #22171 [ run ] triggered by Bot. Commit: |
|
PR_Github #22171 [ run ] completed with state |
|
/bot run |
|
PR_Github #22241 [ run ] triggered by Bot. Commit: |
|
PR_Github #22241 [ run ] completed with state |
|
/bot run |
|
PR_Github #22279 [ run ] triggered by Bot. Commit: |
|
PR_Github #22279 [ run ] completed with state |
ba81e6d to
42cec01
Compare
|
/bot run |
|
PR_Github #22341 [ run ] triggered by Bot. Commit: |
42cec01 to
ed247d7
Compare
|
/bot run |
|
PR_Github #22345 [ run ] triggered by Bot. Commit: |
|
PR_Github #22341 [ run ] completed with state |
|
PR_Github #22345 [ run ] completed with state |
|
/bot run |
|
PR_Github #22394 [ run ] triggered by Bot. Commit: |
|
PR_Github #22394 [ run ] completed with state |
Signed-off-by: zhengd-nv <200704041+zhengd-nv@users.noreply.github.com>
f712080 to
486cf48
Compare
|
/bot run |
|
PR_Github #22574 [ run ] triggered by Bot. Commit: |
|
PR_Github #22574 [ run ] completed with state |
Signed-off-by: zhengd-nv <200704041+zhengd-nv@users.noreply.github.com>
Signed-off-by: zhengd-nv <200704041+zhengd-nv@users.noreply.github.com>
Signed-off-by: zhengd-nv <200704041+zhengd-nv@users.noreply.github.com>
Signed-off-by: zhengd-nv <200704041+zhengd-nv@users.noreply.github.com>
Summary by CodeRabbit
New Features
Refactor
Tests
Description
Add more detailed KV cache transfer time and output to the folder specified by env
TRTLLM_KVCACHE_TIME_OUTPUT_PATH.Now the following timepoints are recorded in a transfer session:
sendAsync()is called and prepare for sending; for generation, it's just beforeRequestInfois sent. Need to setreturn_perf_metricsin LLM args.kTimeRequestInfo: For context, it's whenRequestInfois received; for generation, it's afterRequestInfois sent.kTimeFormatter: At the beginning ofCacheFormatter'sformatandunformat.kTimePreprocess: Before the start of any network transmission.kTimeTransmissions: After all transmissions finished.kTimePostprocess: At the end ofCacheFormatter'sformatandunformat.And the time periods (in milliseconds) between adjacent timepoints above are recorded as
RequestInfo: Time waiting for/sending RequestInfoPreparation: Other works before cache formatting/unformattingPreprocess: Allocate buffers and (context) splitting cacheTransmissions: Network transmissions to different peers.Delay,Duration,Bandwidth(Gbps)groups when TP>1 or PP>1.Postprocess: (Generation) concatenating cacheThe output of the file is like follows (after aligned):
rank_0_send.csvrank_0_recv.csvDue to an extra copy when receiving, the effective bandwidth of
recvside is lower thansendside.Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
Details
run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]Launch build/test pipelines. All previously running jobs will be killed.
--reuse-test (optional)pipeline-id(OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.--disable-reuse-test(OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--test-backend "pytorch, cpp"(OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".--detailed-log(OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.--debug(OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in thestage-listparameter 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.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip 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-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.