Skip to content

Commit cdf8891

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/main' into pr2235-musa-python-overlay-20260819
2 parents 97a1e87 + 7433c5f commit cdf8891

130 files changed

Lines changed: 9102 additions & 3621 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/src/content/docs/en/cli_reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ xLLM uses gflags to manage service startup parameters. `--model <PATH>` is the o
170170
| `enable_pd_ooc` | `bool` | `false` | Whether to enable online-offline co-location in disaggregated PD mode. |
171171
| `disagg_pd_port` | `int32` | `7777` | Listening port for the disaggregated PD bRPC server. |
172172
| `instance_role` | `string` | `"DEFAULT"` | Instance role, for example `DEFAULT`, `PREFILL`, `DECODE`, or `MIX`. |
173-
| `kv_cache_transfer_type` | `string` | `"Mooncake"` | KV Cache transfer type, for example `Mooncake`, `LlmDataDist`, or `HCCL`. |
174173
| `kv_cache_transfer_mode` | `string` | `"PUSH"` | KV Cache transfer mode, for example `PUSH` or `PULL`. |
175174
| `transfer_listen_port` | `int32` | `26000` | Listening port for KV Cache Transfer. |
176175
| `kv_push_dst_rotate` | `bool` | `false` | Rotate the destination-worker traversal order in `push_kv_blocks` per KV-split rank to spread incast across decode workers. |

docs/src/content/docs/zh/cli_reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ xLLM 使用 gflags 管理服务启动参数。`--model <PATH>` 是唯一必填
170170
| `enable_pd_ooc` | `bool` | `false` | 是否在 PD 分离模式下启用在线/离线混部。 |
171171
| `disagg_pd_port` | `int32` | `7777` | PD 分离 bRPC server 的监听端口。 |
172172
| `instance_role` | `string` | `"DEFAULT"` | 当前实例角色,例如 `DEFAULT``PREFILL``DECODE``MIX`|
173-
| `kv_cache_transfer_type` | `string` | `"Mooncake"` | KV Cache 传输类型,例如 `Mooncake``LlmDataDist``HCCL`|
174173
| `kv_cache_transfer_mode` | `string` | `"PUSH"` | KV Cache 传输模式,例如 `PUSH``PULL`|
175174
| `transfer_listen_port` | `int32` | `26000` | KV Cache Transfer 的监听端口。 |
176175
| `kv_push_dst_rotate` | `bool` | `false` |`push_kv_blocks` 中按 KV-split rank 轮转遍历目标 worker,用于分散对 decode worker 的流量。 |

tests/core/framework/batch/batch_test.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,25 @@ TEST(BatchInputBuilderTest, DSV4FirstChunkSlicesFullRemoteAllocation) {
517517
2u);
518518
}
519519

520+
TEST(BatchInputBuilderTest, DSV4KvSplitMapsOneSourceBlockToTwoDecodeBlocks) {
521+
BlockManager::Options options;
522+
options.num_blocks(8).block_size(32);
523+
BlockManagerImpl manager(options);
524+
std::vector<Block> blocks = manager.allocate(2);
525+
Sequence sequence = make_basic_sequence({1});
526+
sequence.add_blocks(BlockType::C4, blocks);
527+
const TransferKVInfo full_info =
528+
make_info({100, 101, 102, 103}, BlockType::C4);
529+
530+
const TransferKVInfo info =
531+
BatchInputBuilderTestPeer::build_step_transfer_info(
532+
full_info, &sequence, /*seq_len=*/64, /*kv_split_size=*/2);
533+
534+
expect_mapping(info, BlockType::C4, block_ids(blocks), {100, 101, 102, 103});
535+
EXPECT_EQ(sequence.kv_state().next_group_transfer_block_idx(BlockType::C4),
536+
2u);
537+
}
538+
520539
TEST(BatchInputBuilderTest, DSV4LaterChunkSkipsExpiredSWABlocks) {
521540
BlockManager::Options options;
522541
options.num_blocks(8).block_size(16);

tests/core/framework/config/config_json_test.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ inline constexpr std::string_view kInlineConfig = R"json({
4040
"max_tokens_per_batch": 8192,
4141
"max_seqs_per_batch": 64,
4242
"model_impl": "py",
43+
"disable_graph_warmup": true,
4344
"python_graph_backend": "cudagraphs"
4445
})json";
4546

@@ -112,6 +113,7 @@ class ConfigFlagGuard final {
112113
old_max_seqs_per_batch_(FLAGS_max_seqs_per_batch),
113114
old_model_impl_(FLAGS_model_impl),
114115
old_python_model_path_(FLAGS_python_model_path),
116+
old_disable_graph_warmup_(FLAGS_disable_graph_warmup),
115117
old_python_graph_backend_(FLAGS_python_graph_backend) {}
116118

117119
~ConfigFlagGuard() {
@@ -122,6 +124,7 @@ class ConfigFlagGuard final {
122124
FLAGS_max_seqs_per_batch = old_max_seqs_per_batch_;
123125
FLAGS_model_impl = old_model_impl_;
124126
FLAGS_python_model_path = old_python_model_path_;
127+
FLAGS_disable_graph_warmup = old_disable_graph_warmup_;
125128
FLAGS_python_graph_backend = old_python_graph_backend_;
126129
}
127130

@@ -133,6 +136,7 @@ class ConfigFlagGuard final {
133136
int32_t old_max_seqs_per_batch_;
134137
std::string old_model_impl_;
135138
std::string old_python_model_path_;
139+
bool old_disable_graph_warmup_;
136140
std::string old_python_graph_backend_;
137141
};
138142

@@ -263,17 +267,25 @@ TEST(ConfigJsonTest, FromJsonUsesParsedOverrides) {
263267
// model and python_model_path are command-line-only: from_json neither reads
264268
// them nor touches their gflags, so both keep their pre-call values.
265269
EXPECT_EQ(model_config.python_model_path(), "");
270+
EXPECT_TRUE(execution_config.disable_graph_warmup());
266271
EXPECT_EQ(execution_config.python_graph_backend(), "cudagraphs");
267272

268273
EXPECT_EQ(FLAGS_model_impl, "py");
269274
EXPECT_EQ(FLAGS_python_model_path, old_python_model_path);
275+
EXPECT_TRUE(FLAGS_disable_graph_warmup);
270276
EXPECT_EQ(FLAGS_python_graph_backend, "cudagraphs");
271277

272278
EXPECT_EQ(kv_cache_config.kv_cache_dtype(), "auto");
273279
EXPECT_EQ(kv_cache_config.indexer_cache_dtype(), "auto");
274280
EXPECT_EQ(scheduler_config.max_decode_token_per_sequence(), 256);
275281
}
276282

283+
TEST(ExecutionConfigTest, GraphWarmupIsEnabledByDefault) {
284+
const ExecutionConfig execution_config;
285+
286+
EXPECT_FALSE(execution_config.disable_graph_warmup());
287+
}
288+
277289
TEST(KVCacheConfigValidationTest, AcceptsSupportedIndexerCacheDtypes) {
278290
KVCacheConfig config;
279291

tests/core/framework/config/disagg_pd_config_test.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,20 @@ struct PrefixRoleCase {
3434
void set_values_requiring_mlu_normalization(DisaggPDConfig& disagg_pd_config,
3535
KVCacheConfig& kv_cache_config,
3636
SchedulerConfig& scheduler_config) {
37-
disagg_pd_config.kv_cache_transfer_type("LlmDataDist")
38-
.kv_cache_transfer_mode("PULL")
39-
.enable_pd_ooc(true);
37+
disagg_pd_config.kv_cache_transfer_mode("PULL").enable_pd_ooc(true);
4038
kv_cache_config.kv_cache_dtype("fp8").enable_prefix_cache(true);
4139
scheduler_config.enable_schedule_overlap(true);
4240
}
4341

4442
void expect_normalized_values(const DisaggPDConfig& disagg_pd_config,
4543
const KVCacheConfig& kv_cache_config,
4644
const SchedulerConfig& scheduler_config) {
47-
EXPECT_EQ(disagg_pd_config.kv_cache_transfer_type(), "Mooncake");
4845
EXPECT_EQ(disagg_pd_config.kv_cache_transfer_mode(), "PULL");
4946
EXPECT_FALSE(disagg_pd_config.enable_pd_ooc());
5047
EXPECT_EQ(kv_cache_config.kv_cache_dtype(), "auto");
5148
EXPECT_FALSE(scheduler_config.enable_schedule_overlap());
5249
}
5350

54-
TEST(DisaggPDConfigTest, DefaultsToMooncakeTransfer) {
55-
const DisaggPDConfig disagg_pd_config;
56-
57-
EXPECT_EQ(disagg_pd_config.kv_cache_transfer_type(), "Mooncake");
58-
}
59-
6051
TEST(DisaggPDConfigTest, KeepsMluPrefixCacheForPrefillSideRoles) {
6152
const PrefixRoleCase cases[] = {
6253
{"PREFILL", true},
@@ -83,23 +74,14 @@ TEST(DisaggPDConfigTest, KeepsMluPrefixCacheForPrefillSideRoles) {
8374
}
8475
}
8576

86-
TEST(DisaggPDConfigTest, ExposesParallelHeterogeneousShardPullOption) {
87-
DisaggPDConfig disagg_pd_config;
88-
EXPECT_FALSE(disagg_pd_config.enable_heterogeneous_pd());
89-
EXPECT_TRUE(disagg_pd_config.enable_pd_parallel_shard_pull());
90-
91-
disagg_pd_config.enable_heterogeneous_pd(true);
92-
disagg_pd_config.enable_pd_parallel_shard_pull(false);
93-
EXPECT_TRUE(disagg_pd_config.enable_heterogeneous_pd());
94-
EXPECT_FALSE(disagg_pd_config.enable_pd_parallel_shard_pull());
95-
77+
TEST(DisaggPDConfigTest, OmitsRemovedHeterogeneousPullOptions) {
9678
const std::vector<std::string>& option_names =
9779
DisaggPDConfig::option_category().option_names;
98-
EXPECT_NE(
80+
EXPECT_EQ(
9981
std::find(
10082
option_names.begin(), option_names.end(), "enable_heterogeneous_pd"),
10183
option_names.end());
102-
EXPECT_NE(std::find(option_names.begin(),
84+
EXPECT_EQ(std::find(option_names.begin(),
10385
option_names.end(),
10486
"enable_pd_parallel_shard_pull"),
10587
option_names.end());

tests/core/framework/kv_cache/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
include(cc_test)
22

3+
cc_test(
4+
NAME
5+
cache_layout_builder_test
6+
SRCS
7+
cache_layout_builder_test.cpp
8+
DEPS
9+
:kv_cache
10+
GTest::gtest_main
11+
)
12+
target_link_libraries(cache_layout_builder_test
13+
PUBLIC
14+
Python::Python
15+
$<$<BOOL:${USE_NPU}>:ascendcl>
16+
$<$<BOOL:${USE_NPU}>:hccl>
17+
$<$<BOOL:${USE_NPU}>:c_sec>
18+
$<$<BOOL:${USE_NPU}>:nnopbase>)
19+
320
cc_test(
421
NAME
522
kv_cache_estimation_test

0 commit comments

Comments
 (0)