mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
[FDConfig]Remove max_num_batched_tokens/max_num_seqs in parallel config (#4116)
* remove max_num_batched_tokens in parallel config * remove max_num_seqs * update test case * fix test * fix --------- Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@ from fastdeploy.config import (
|
||||
FDConfig,
|
||||
GraphOptimizationConfig,
|
||||
ParallelConfig,
|
||||
SchedulerConfig,
|
||||
)
|
||||
|
||||
|
||||
@@ -14,10 +15,12 @@ class TestConfig(unittest.TestCase):
|
||||
parallel_config = ParallelConfig({"tensor_parallel_size": 16, "expert_parallel_size": 1})
|
||||
graph_opt_config = GraphOptimizationConfig({})
|
||||
cache_config = CacheConfig({})
|
||||
scheduler_config = SchedulerConfig({})
|
||||
fd_config = FDConfig(
|
||||
parallel_config=parallel_config,
|
||||
graph_opt_config=graph_opt_config,
|
||||
cache_config=cache_config,
|
||||
scheduler_config=scheduler_config,
|
||||
ips=["1.1.1.1", "0.0.0.0"],
|
||||
test_mode=True,
|
||||
)
|
||||
@@ -28,10 +31,12 @@ class TestConfig(unittest.TestCase):
|
||||
parallel_config = ParallelConfig({})
|
||||
graph_opt_config = GraphOptimizationConfig({})
|
||||
cache_config = CacheConfig({})
|
||||
scheduler_config = SchedulerConfig({})
|
||||
fd_config = FDConfig(
|
||||
parallel_config=parallel_config,
|
||||
graph_opt_config=graph_opt_config,
|
||||
cache_config=cache_config,
|
||||
scheduler_config=scheduler_config,
|
||||
ips="0.0.0.0",
|
||||
test_mode=True,
|
||||
)
|
||||
@@ -42,26 +47,29 @@ class TestConfig(unittest.TestCase):
|
||||
graph_opt_config = GraphOptimizationConfig({})
|
||||
cache_config = CacheConfig({})
|
||||
cache_config.enable_chunked_prefill = True
|
||||
scheduler_config = SchedulerConfig({})
|
||||
fd_config = FDConfig(
|
||||
parallel_config=parallel_config,
|
||||
graph_opt_config=graph_opt_config,
|
||||
cache_config=cache_config,
|
||||
scheduler_config=scheduler_config,
|
||||
ips="0.0.0.0",
|
||||
test_mode=True,
|
||||
)
|
||||
if not envs.ENABLE_V1_KVCACHE_SCHEDULER:
|
||||
assert fd_config.max_num_batched_tokens == 2048
|
||||
assert fd_config.scheduler_config.max_num_batched_tokens == 2048
|
||||
|
||||
cache_config.enable_chunked_prefill = False
|
||||
fd_config = FDConfig(
|
||||
parallel_config=parallel_config,
|
||||
graph_opt_config=graph_opt_config,
|
||||
cache_config=cache_config,
|
||||
scheduler_config=scheduler_config,
|
||||
ips="0.0.0.0",
|
||||
test_mode=True,
|
||||
)
|
||||
if not envs.ENABLE_V1_KVCACHE_SCHEDULER:
|
||||
assert fd_config.max_num_batched_tokens == 8192
|
||||
assert fd_config.scheduler_config.max_num_batched_tokens == 8192
|
||||
|
||||
def test_fdconfig_init_cache(self):
|
||||
parallel_config = ParallelConfig({})
|
||||
@@ -69,10 +77,12 @@ class TestConfig(unittest.TestCase):
|
||||
cache_config = CacheConfig({})
|
||||
cache_config.cache_transfer_protocol = "rdma,ipc"
|
||||
cache_config.pd_comm_port = "2334"
|
||||
scheduler_config = SchedulerConfig({})
|
||||
fd_config = FDConfig(
|
||||
parallel_config=parallel_config,
|
||||
graph_opt_config=graph_opt_config,
|
||||
cache_config=cache_config,
|
||||
scheduler_config=scheduler_config,
|
||||
splitwise_role="prefill",
|
||||
test_mode=True,
|
||||
)
|
||||
|
Reference in New Issue
Block a user