Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
397bb90
encoder-decoder models migration plan
cascade812 Apr 21, 2026
eda8b71
fix verify error
cascade812 Apr 21, 2026
6787ffd
update
cascade812 Apr 22, 2026
66ce32f
update
cascade812 Apr 22, 2026
854b17f
update
cascade812 Apr 22, 2026
4887555
add config is_encoder_decoder
cascade812 Apr 23, 2026
b0bc711
update design doc and model definitions
cascade812 Apr 23, 2026
b7bbec8
weight loading
cascade812 Apr 24, 2026
24cbaac
precision conversion
cascade812 Apr 24, 2026
4f0c048
update design doc
cascade812 Apr 24, 2026
1ca5227
dual-pool construction
cascade812 Apr 24, 2026
9deff75
trtllm attention backend on blackwell
cascade812 Apr 25, 2026
44d213c
pre-blackwell attention
cascade812 Apr 27, 2026
9fde06c
v1 cache support
cascade812 Apr 27, 2026
4d03a6b
request admission an schedule
cascade812 Apr 30, 2026
9687059
request plumb and test t5-small
cascade812 May 4, 2026
aab4514
fix beam search and batch size > 1
cascade812 May 7, 2026
485754c
clean up unnecessary comment
cascade812 May 7, 2026
b88d0a6
address rebase issues
cascade812 May 12, 2026
7311ad7
delete md
cascade812 May 12, 2026
a7b29d2
update user interface
cascade812 May 14, 2026
5498912
fix pre-commit
cascade812 May 14, 2026
ac25b43
Merge remote-tracking branch 'origin/main' into guiju/en_de3
cascade812 May 14, 2026
9b13f07
revert api change
cascade812 May 14, 2026
7a035bf
Merge remote-tracking branch 'origin' into guiju/en_de3
cascade812 May 15, 2026
e741c6f
address comment
cascade812 May 15, 2026
102d009
test: update encoder metadata fixture
cascade812 May 16, 2026
4054f84
rename
cascade812 May 16, 2026
12cb0cd
address comment
cascade812 May 20, 2026
d33c256
address comments
cascade812 May 20, 2026
69c1d06
Merge remote-tracking branch 'origin' into guiju/en_de3
cascade812 May 20, 2026
61448ba
fix tests
cascade812 May 20, 2026
721cf19
pre-commit
cascade812 May 20, 2026
95476b9
address comments
cascade812 Jun 4, 2026
a497282
Merge remote-tracking branch 'origin/main' into guiju/en_de3
cascade812 Jun 4, 2026
56fe82c
add bart test
cascade812 Jun 5, 2026
127708f
address comment
cascade812 Jun 5, 2026
c61712e
address ci error
cascade812 Jun 7, 2026
997f277
add pytest node id
cascade812 Jun 8, 2026
649586d
remove non-exist pytest node IDs
cascade812 Jun 8, 2026
1483064
Merge remote-tracking branch 'origin/main' into guiju/en_de3
cascade812 Jun 8, 2026
f1fd611
fix ci error
cascade812 Jun 9, 2026
2641898
merge main and resolve conflicts
cascade812 Jun 9, 2026
d3d176c
Merge branch 'main' into guiju/en_de3
cascade812 Jun 10, 2026
cbe3834
[TRTLLM-12339][chore] Early-dispatch cross-KV path in KVCacheManager
eopXD Jun 11, 2026
c229881
Merge pull request #1 from eopXD/eopxd/kvcm-cross-early-dispatch
cascade812 Jun 11, 2026
f38033e
address comments
cascade812 Jun 11, 2026
5c16050
Merge remote-tracking branch 'origin/main' into guiju/en_de3
cascade812 Jun 11, 2026
7c2d137
Merge branch 'main' into guiju/en_de3
cascade812 Jun 11, 2026
82f829f
add b200 test
cascade812 Jun 12, 2026
8953df8
Merge remote-tracking branch 'origin/main' into guiju/en_de3
cascade812 Jun 12, 2026
e75a9ab
address merge error
cascade812 Jun 13, 2026
3601a96
Merge remote-tracking branch 'origin/main' into guiju/en_de3
cascade812 Jun 13, 2026
d44cf91
Merge branch 'main' into guiju/en_de3
cascade812 Jun 13, 2026
8eeb2f5
fix merge error
cascade812 Jun 14, 2026
dd6adc9
Merge branch 'main' into guiju/en_de3
cascade812 Jun 15, 2026
8edb703
Merge remote-tracking branch 'origin' into guiju/en_de3
cascade812 Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions cpp/include/tensorrt_llm/batch_manager/capacityScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ class MaxRequestsScheduler : public BaseCapacityScheduler

/// @brief Schedule requests using the MAX_UTILIZATION policy
/// @details Try reserving resources to advance requests by one step,
/// may pause previously started requests.
/// may pause previously started requests. When a
/// ``crossKvCacheManager`` is supplied, requests in the
/// ``ENCODER_INIT`` state may be admitted for encoder compute
/// without consuming self- or cross-KV blocks; the later
/// ``CONTEXT_INIT`` decoder admission owns cross-pool budgeting.
class MaxUtilizationScheduler : public BaseCapacityScheduler
{
public:
Expand All @@ -96,8 +100,9 @@ class MaxUtilizationScheduler : public BaseCapacityScheduler
LlmRequestState noScheduleAfterState = LlmRequestState::kGENERATION_COMPLETE);

[[nodiscard]] std::tuple<RequestVector, RequestVector> operator()(
kv_cache_manager::BaseKVCacheManager& kvCacheManager, OptionalRef<BasePeftCacheManager const> peftCacheManager,
RequestList const& activeRequests) const;
kv_cache_manager::BaseKVCacheManager& kvCacheManager,
OptionalRef<kv_cache_manager::BaseKVCacheManager> crossKvCacheManager,
OptionalRef<BasePeftCacheManager const> peftCacheManager, RequestList const& activeRequests) const;

private:
SizeType32 mMaxNumRequests;
Expand All @@ -106,6 +111,12 @@ class MaxUtilizationScheduler : public BaseCapacityScheduler
};

/// @brief Schedule requests using the GUARANTEED_NO_EVICT policy
/// @details When a ``crossKvCacheManager`` is supplied, requests in the
/// ``ENCODER_INIT`` state may be admitted for encoder compute
/// without consuming self- or cross-KV blocks. The later
/// ``CONTEXT_INIT`` decoder admission owns cross-pool budgeting.
/// A non-const ``OptionalRef`` is accepted for API uniformity
/// with ``MaxUtilizationScheduler``.
class GuaranteedNoEvictScheduler : public BaseCapacityScheduler
{
public:
Expand All @@ -115,14 +126,14 @@ class GuaranteedNoEvictScheduler : public BaseCapacityScheduler

[[nodiscard]] std::tuple<RequestVector, RequestVector> operator()(
kv_cache_manager::BaseKVCacheManager const& kvCacheManager,
OptionalRef<kv_cache_manager::BaseKVCacheManager const> crossKvCacheManager,
Comment thread
cascade812 marked this conversation as resolved.
Resolved
OptionalRef<kv_cache_manager::BaseKVCacheManager> crossKvCacheManager,
OptionalRef<BasePeftCacheManager const> peftCacheManager, RequestList const& activeRequests) const;

protected:
template <bool StaticBatchScheduling>
[[nodiscard]] std::tuple<RequestVector, RequestVector> impl(
kv_cache_manager::BaseKVCacheManager const& kvCacheManager,
OptionalRef<kv_cache_manager::BaseKVCacheManager const> crossKvCacheManager,
OptionalRef<kv_cache_manager::BaseKVCacheManager> crossKvCacheManager,
OptionalRef<BasePeftCacheManager const> peftCacheManager, RequestList const& activeRequests) const;

private:
Expand All @@ -139,7 +150,7 @@ class StaticBatchScheduler : public GuaranteedNoEvictScheduler

[[nodiscard]] std::tuple<RequestVector, RequestVector> operator()(
kv_cache_manager::BaseKVCacheManager const& kvCacheManager,
OptionalRef<kv_cache_manager::BaseKVCacheManager const> crossKvCacheManager,
OptionalRef<kv_cache_manager::BaseKVCacheManager> crossKvCacheManager,
OptionalRef<BasePeftCacheManager const> peftCacheManager, RequestList const& activeRequests) const;
};

Expand All @@ -158,7 +169,11 @@ class CapacityScheduler : public Algorithm
*
* @param kvCacheManager Required in MaxUtilizationScheduler (as a ref) and in GuaranteedNoEvictScheduler and
* StaticBatchScheduler (as a const ref).
* @param crossKvCacheManager Optional used in GuaranteedNoEvictScheduler and StaticBatchScheduler.
* @param crossKvCacheManager Optional cross-attention KV cache manager. Used by
* MaxUtilizationScheduler (mutates: ``startScheduling`` / ``schedulingRemoveSequence``)
* and GuaranteedNoEvictScheduler / StaticBatchScheduler (read-only). Required for
* encoder-decoder admission. Encoder-init requests only require this pool
* to be configured; decoder context admission budgets blocks from it.
* @param peftCacheManager Optional used in MaxUtilizationScheduler, GuaranteedNoEvictScheduler and
* StaticBatchScheduler.
* @param activeRequests
Expand All @@ -168,7 +183,7 @@ class CapacityScheduler : public Algorithm
[[nodiscard]] std::tuple<RequestVector, RequestVector, RequestVector> operator()(RequestList const& activeRequests,
OptionalRef<kv_cache_manager::BaseKVCacheManager> kvCacheManager = std::nullopt,
OptionalRef<BasePeftCacheManager const> peftCacheManager = std::nullopt,
OptionalRef<kv_cache_manager::BaseKVCacheManager const> crossKvCacheManager = std::nullopt) const;
OptionalRef<kv_cache_manager::BaseKVCacheManager> crossKvCacheManager = std::nullopt) const;

/// @brief Sets the reorder policy to use AgentTreePolicy with the given configuration.
/// @param agentPercentage The ratio of agent requests to schedule (0.0-1.0, -1.0 for random).
Expand Down
Loading
Loading