Skip to content

Commit bbebcfe

Browse files
committed
GC_DP_FIX
1 parent 329306d commit bbebcfe

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

ucm/integration/vllm/ucm_connector.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def _create_store(
312312

313313
name = self.connector_configs[0]["ucm_connector_name"]
314314
module_path = self.connector_configs[0].get("ucm_connector_module_path", None)
315+
dp_rank = self._vllm_config.parallel_config.rank
315316
config = copy.deepcopy(self.connector_configs[0]["ucm_connector_config"])
316317
config.setdefault("share_buffer_enable", self.is_mla)
317318
if "storage_backends" in config:
@@ -326,6 +327,7 @@ def _create_store(
326327
config["shard_size"] = kv_cache_layout.shard_size * self.blocks_per_chunk
327328
config["block_size"] = kv_cache_layout.block_size * self.blocks_per_chunk
328329
config["local_rank_size"] = self.tp_size if self.is_mla else 1
330+
config["posix_gc_enable"] = False
329331
if cpu_affinity_cores:
330332
config["cpu_affinity_cores"] = list(cpu_affinity_cores)
331333
else:
@@ -336,10 +338,6 @@ def _create_store(
336338
* (1 if self.is_mla else self.num_head * 2)
337339
* self.blocks_per_chunk
338340
)
339-
# GC only enabled for Scheduler with data_parallel_rank == 0
340-
dp_rank = self._vllm_config.parallel_config.data_parallel_rank
341-
if self._role == KVConnectorRole.WORKER or dp_rank != 0:
342-
config["posix_gc_enable"] = False
343341

344342
logger.info(f"create {name} with config: {config}")
345343
return UcmConnectorFactoryV1.create_connector(name, config, module_path)

ucm/store/posix/cc/global_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct Config {
5050
size_t posixGcCheckIntervalSec{30};
5151
size_t posixCapacityGb{0};
5252
double posixGcTriggerThresholdRatio{0.7};
53-
size_t posixGcMaxRecycleCountPerShard{1000};
53+
size_t posixGcMaxRecycleCountPerShard{5000};
5454
double posixGcShardSampleRatio{0.1};
5555
};
5656

ucm/store/posix/cc/space_manager.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ namespace UC::PosixStore {
2929

3030
Status SpaceManager::Setup(const Config& config)
3131
{
32+
hotnessTrackerEnable_ = config.deviceId == -1;
3233
gcEnable_ = config.posixGcEnable && config.posixCapacityGb > 0;
3334
auto s = layout_.Setup(config);
3435
if (s.Failure()) [[unlikely]] { return s; }
35-
if (gcEnable_) {
36+
if (hotnessTrackerEnable_) {
3637
s = hotnessTracker_.Setup(&layout_);
3738
if (s.Failure()) [[unlikely]] { return s; }
39+
}
40+
if (gcEnable_) {
3841
s = gcMgr_.Setup(&layout_, config);
3942
if (s.Failure()) [[unlikely]] { return s; }
4043
}
@@ -129,7 +132,7 @@ void SpaceManager::OnLookupPrefix(PrefixLookupContext& ctx)
129132
}
130133
break;
131134
}
132-
if (gcEnable_) { hotnessTracker_.Touch(*(ctx.blocks + i)); }
135+
if (hotnessTrackerEnable_) { hotnessTracker_.Touch(*(ctx.blocks + i)); }
133136
}
134137
ctx.waiter->Done();
135138
}

ucm/store/posix/cc/space_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class SpaceManager {
4949
ThreadPool<PrefixLookupContext> prefixLookupSrv_;
5050
HotnessTracker hotnessTracker_;
5151
ShardGarbageCollector gcMgr_;
52+
bool hotnessTrackerEnable_{false};
5253
bool gcEnable_{false};
5354

5455
public:

0 commit comments

Comments
 (0)