Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
0b96b5a
docs: add SSD explicit-delete-only GC design spec
Gzure Jun 25, 2026
6ccbdc6
docs: reuse existing LRU for GC candidate ordering
Gzure Jun 25, 2026
69c77d4
docs: add sequence diagrams to SSD GC design spec
Gzure Jun 25, 2026
3e12d8b
docs: convert sequence diagrams to mermaid format
Gzure Jun 25, 2026
98ccb4e
docs: fix mermaid syntax errors in sequence diagrams
Gzure Jun 25, 2026
f1f5981
docs: add SSD explicit-delete GC implementation plan
Gzure Jun 25, 2026
e4f9574
feat(storage): implement explicit-delete SSD GC tombstone + candidate…
Gzure Jun 25, 2026
7b2d7ff
feat(storage): implement CompactBucket copy-on-write compaction
Gzure Jun 25, 2026
fd60ebb
feat(storage): implement background GC thread with lifecycle
Gzure Jun 25, 2026
0eb682c
test(storage): add explicit-delete GC tombstone/compaction/concurrenc…
Gzure Jun 25, 2026
88a7d50
feat(client): wire MarkRemoved into FileStorage forwarding and RealCl…
Gzure Jun 25, 2026
aaea514
docs: document explicit-delete GC config requirements
Gzure Jun 25, 2026
04ab3a7
fix(storage): parse GC ratio env vars with std::stod not stoll
Gzure Jun 25, 2026
3b6fea5
fix(file_storage): move MarkRemoved/BatchMarkRemoved to public section
Gzure Jun 25, 2026
0e1f30c
fix(storage): make CompactBucket public for testing and explicit use
Gzure Jun 25, 2026
6419ff6
fix(storage): CompactBucket self-deadlock, key remap ordering, test q…
Gzure Jun 25, 2026
73570da
test(e2e): add RealClient-based integration tests for SSD GC
Gzure Jun 25, 2026
1c24232
test(e2e): add multi-process SSD GC integration test (Plan B)
Gzure Jun 25, 2026
00773be
fix(e2e): add main() to gc_e2e_test (e2e tests don't link gtest_main)
Gzure Jun 25, 2026
7c90990
fix(e2e): guard getenv nullptr in gc_e2e_test SetUp
Gzure Jun 25, 2026
d05fc78
fix(e2e): use force=true on remove/batchRemove to bypass lease
Gzure Jun 25, 2026
e0e96e4
fix(e2e): wait for bucket file offload, not memory read
Gzure Jun 25, 2026
285f53f
test(e2e): add diagnostics to PutAndWaitOffloaded timeout
Gzure Jun 26, 2026
c3b1c9e
fix(e2e): don't set root_fs_dir on master, let FileStorage offload
Gzure Jun 26, 2026
f0304f6
test(e2e): match production offload config (lease ttl + env vars)
Gzure Jun 26, 2026
9124326
debug(e2e): add temporary GC_E2E_DEBUG logs to PushOffloadingQueue call
Gzure Jun 26, 2026
dea7809
debug(e2e): add GC_E2E_DEBUG logs to FileStorage::Heartbeat
Gzure Jun 26, 2026
6069613
debug(e2e): add GC_E2E_DEBUG logs to BatchQuerySlices and empty batch…
Gzure Jun 26, 2026
da93be1
debug(e2e): add GC_E2E_DEBUG logs at AllocateOffloadingBuckets and lo…
Gzure Jun 26, 2026
80f0b1b
fix(e2e): set bucket_keys_limit=1 so single key fills a bucket
Gzure Jun 26, 2026
eaa222a
refactor(e2e): remove debug logs, strengthen GC validation
Gzure Jun 26, 2026
8f20a5d
fix(e2e): PutBatchAndWaitOffloaded must wait for .bucket file
Gzure Jun 26, 2026
07c89a6
fix(e2e): revert to bucket_keys_limit=1, use PutAndWaitOffloaded
Gzure Jun 26, 2026
65fe518
fix(e2e): relax bucket count assertion to >0, detect reclamation by c…
Gzure Jun 26, 2026
9bf3d23
fix(real_client): convert user key to tenant-scoped storage key for M…
Gzure Jun 26, 2026
e9e5448
debug(e2e): add GC_E2E_DEBUG logs to MarkRemoved, SelectGCCandidate, …
Gzure Jun 26, 2026
7504ddf
debug(e2e): dump object_bucket_map_ keys on MarkRemoved miss
Gzure Jun 26, 2026
eb92a80
fix(e2e): wait for offload settlement before remove + remove debug logs
Gzure Jun 26, 2026
1a6ae42
fix(e2e): increase gc_interval to 15s, settle 12s to avoid premature GC
Gzure Jun 26, 2026
cc5c940
fix(e2e): detect compaction by bucket file set change, not count decr…
Gzure Jun 26, 2026
e3b2307
debug(e2e): log all bucket deleted_bytes_ in SelectGCCandidate scan
Gzure Jun 26, 2026
ea5940f
fix(e2e): snapshot bucket files after settle, detect compaction by co…
Gzure Jun 26, 2026
8e7a7a5
feat(storage): cross-bucket merge compaction
Gzure Jun 26, 2026
18995ed
feat(storage): delete empty buckets immediately without waiting for m…
Gzure Jun 26, 2026
3ebebc1
add remove/batchRemove
Gzure Jun 26, 2026
6ea9bc0
add remove/batchRemove
Gzure Jun 26, 2026
0bb3369
add remove/batchRemove
Gzure Jun 26, 2026
2961b42
debug: add MarkRemoved log to confirm key lookup in production
Gzure Jun 26, 2026
4ed8c01
fix: CompactBucket force compact, remove duplicate offload + debug log
Gzure Jun 26, 2026
5a0c306
fix(bench): use force=true for remove/batchRemove in stress_cluster_b…
Gzure Jun 26, 2026
b061471
debug: add GC_DEBUG logs to remove_internal, MarkRemoved, GCThreadFunc
Gzure Jun 27, 2026
a66a288
feat(ssd-gc): add RemoveHeartbeat RPC for cross-node tombstone marking
Gzure Jun 27, 2026
2a30eed
add removeHeartBeat
Gzure Jun 27, 2026
7753f9f
add removeHeartBeat
Gzure Jun 27, 2026
7def480
debug: add RemoveObjectHeartbeat logging to diagnose empty results
Gzure Jun 27, 2026
552e3c5
fix: missing closing brace in Heartbeat RemoveObjectHeartbeat block
Gzure Jun 27, 2026
afe0eeb
debug: add null check and logging to RemoveObjectHeartbeat call
Gzure Jun 27, 2026
fc4c3e2
feat(bench): use distinct key prefix for remove/batch_remove scenarios
Gzure Jun 27, 2026
4d97cbc
fix(storage): CompactBuckets - group by metadata before IO, handle re…
Gzure Jun 27, 2026
aba593e
debug: log group_count/group_size when CompactBuckets defers
Gzure Jun 27, 2026
535a794
fix: LogRequest with UUID pair causes segfault — use .first/.second
Gzure Jun 27, 2026
9cadb42
debug: temporarily disable RemoveObjectHeartbeat to isolate segfault
Gzure Jun 27, 2026
af90e00
debug: disable RemoveObjectHeartbeat RPC registration to isolate segf…
Gzure Jun 27, 2026
f93d612
cleanup: remove all debug logs, re-enable RemoveObjectHeartbeat RPC
Gzure Jun 27, 2026
1374ea1
restore CompactBuckets deferred log
Gzure Jun 27, 2026
89bef02
add removeHeartBeat
Gzure Jun 27, 2026
9640ad7
docs: update design spec with RemoveObjectHeartbeat + cross-bucket merge
Gzure Jun 30, 2026
c33b7e8
fix(docs): remove commas/brackets/semicolons from mermaid text
Gzure Jul 2, 2026
7e00a3d
perf: use batch_read in BatchLoad to raise NVMe queue depth (QD 1→32)
Gzure Jul 2, 2026
0b2833d
cleanup: remove spec/plan docs, trim verbose comments
Gzure Jul 2, 2026
736a052
master_client添加RPC调用trace_id关联日志
Gzure Jul 7, 2026
3907976
Revert "master_client添加RPC调用trace_id关联日志"
Gzure Jul 7, 2026
87078a9
invoke_rpc捕获trace_id传入request_config_t
Gzure Jul 7, 2026
ef4a644
Revert "invoke_rpc捕获trace_id传入request_config_t"
Gzure Jul 7, 2026
ed1c1f1
merge supercache
Gzure Aug 8, 2026
87c189d
Merge pull request #23 from Gzure/supercache_dev_ssd_remove
zchuango Aug 10, 2026
8feb97c
feat: add UB CPU staging for device buffers
Aug 13, 2026
5c1533e
fix: avoid URMA registration for UB device buffers
Aug 13, 2026
bfc5619
Merge pull request #26 from LinQuickDev/supercache
wangyuqi0429 Aug 14, 2026
b96bcdc
fix(tracing): 添加缺失的 span 结束调用
yyyuanhao426-hash Aug 14, 2026
efe4fdb
Merge pull request #30 from wangyuqi0429/supercache-snapshot
zchuango Aug 17, 2026
55c89b5
修复合并问题
Gzure Aug 17, 2026
5a45775
1.修复 HA + OpLog 路径,确保删除任务一定入队;2. 将 Heartbeat 改成 fetch/ack,避免任务因 RPC 丢…
Gzure Aug 17, 2026
1425f5a
1.修复 HA + OpLog 路径,确保删除任务一定入队;2. 将 Heartbeat 改成 fetch/ack,避免任务因 RPC 丢…
Gzure Aug 17, 2026
2928817
1.修复 HA + OpLog 路径,确保删除任务一定入队;2. 将 Heartbeat 改成 fetch/ack,避免任务因 RPC 丢…
Gzure Aug 17, 2026
98874a0
Merge pull request #31 from Gzure/ssd_remove_fix
Gzure Aug 17, 2026
b874ea5
feat(spdiag): 为 vLLM 调用路径添加 PerfPoint 打点与 MC_LOG 日志
ZhiningPan Aug 27, 2026
56abcdc
fix(spdiag): 用 steady_clock 替代 PerfPoint::ElapsedMicros
ZhiningPan Aug 27, 2026
8347ca3
bench: 新增 store_connector_bench 专测 vLLM 路径打点
ZhiningPan Aug 28, 2026
7c32eb3
merge: bring in supercache PR #28 (SpDiag perf counter End cleanup)
Aug 28, 2026
556c36b
fix(bench): 改用 numa_alloc_local 分配 buffer
ZhiningPan Aug 29, 2026
6a1e4b0
fix(bench): 修正 IS_EXIST/GET 的成功判断逻辑
ZhiningPan Aug 29, 2026
99dc0aa
Merge pull request #41 from WillowWang0216/supercache-ub
zchuango Aug 31, 2026
86c3482
Merge pull request #42 from ZhiningPan/feat-spdiag-logging
zchuango Aug 31, 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
26 changes: 26 additions & 0 deletions docs/source/deployment/ssd/ssd-offload.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,32 @@ Groups multiple objects into bucket files. Reduces filesystem overhead, supports

Best for: general-purpose use, large-scale deployments.

#### Explicit-Delete GC (tombstone compaction)

To enable SSD space reclamation via `Remove`/`BatchRemove` (without LRU
eviction deleting live keys), set:

| Environment Variable | Required Value | Description |
|---|---|---|
| `MOONCAKE_OFFLOAD_BUCKET_EVICTION_POLICY` | `lru` | Keeps `last_access_ns_` updated for GC cold-bucket selection |
| `MOONCAKE_OFFLOAD_DISABLE_SSD_EVICTION` | `true` | Makes `PrepareEviction` a no-op so no bucket is ever evicted by LRU |

GC tuning (optional):

| Environment Variable | Default | Description |
|---|---|---|
| `MOONCAKE_OFFLOAD_BUCKET_GC_ENABLE` | `true` | Enable background tombstone compaction |
| `MOONCAKE_OFFLOAD_BUCKET_GC_INTERVAL_MS` | `1000` | GC scan interval |
| `MOONCAKE_OFFLOAD_BUCKET_GC_DELETED_RATIO` | `0.25` | Compact bucket when deleted bytes / data size >= this |
| `MOONCAKE_OFFLOAD_BUCKET_GC_HIGH_WATERMARK_RATIO` | `0.90` | Force compaction of any tombstone bucket when total size / max >= this |
| `MOONCAKE_OFFLOAD_BUCKET_GC_MAX_BUCKETS_PER_ROUND` | `1` | Max old buckets collected per GC round for cross-bucket merge |
| `MOONCAKE_OFFLOAD_BUCKET_GC_MERGE_ENABLE` | `true` | Enable cross-bucket merge: collect live keys from multiple tombstone buckets into one new bucket. When false, each bucket is compacted independently |

**Important:** Only keys removed via `Remove`/`BatchRemove` are reclaimed.
`RemoveByRegex`/`RemoveAll` do not trigger this GC. When no tombstone space
is reclaimable and SSD is full, `BatchOffload` returns an error instead of
deleting live keys.

### `file_per_key_storage_backend`

Stores each object in an individual file. Simple and easy to inspect, but generates many small files at scale.
Expand Down
35 changes: 35 additions & 0 deletions mooncake-integration/store/mooncake_perf_points.def
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,38 @@ PERF_KEY_DEF(MASTER_BG_DISCARD_EXPIRED, "master_service.cpp::EvictionThreadFun
PERF_KEY_DEF(MASTER_BG_SNAPSHOT_PERSIST, "master_service.cpp::SnapshotThreadFunc", "SnapshotPersist")
PERF_KEY_DEF(MASTER_BG_CLIENT_MONITOR, "master_service.cpp::ClientMonitorFunc", "ClientMonitorScan")
PERF_KEY_DEF(MASTER_BG_CLIENT_UNMOUNT, "master_service.cpp::ClientMonitorFunc", "ExpiredClientUnmount")

// ============================================================
// === vLLM MooncakeStoreConnector 路径打点(vllm 0.26.1rc0)===
// === 覆盖 S2-S9 入口 + T1-T8 下沉 + Client 服务层 ===
// ============================================================

// === store_py.cpp Python 绑定层(vllm 直接调用入口,S2-S9)===
PERF_KEY_DEF(STORE_PY_SETUP, "store_py.cpp::setup", "Setup")
PERF_KEY_DEF(STORE_PY_REGISTER_BUFFER, "store_py.cpp::register_buffer", "RegisterBuffer")
PERF_KEY_DEF(STORE_PY_BATCH_PUT_MULTI, "store_py.cpp::batch_put_from_multi_buffers","BatchPutMultiBuf")
PERF_KEY_DEF(STORE_PY_BATCH_GET_INTO_MULTI, "store_py.cpp::batch_get_into_multi_buffers","BatchGetIntoMultiBuf")
PERF_KEY_DEF(STORE_PY_BATCH_IS_EXIST, "store_py.cpp::batch_is_exist", "BatchIsExist")
PERF_KEY_DEF(STORE_PY_BATCH_GET_REPLICA_DESC, "store_py.cpp::batch_get_replica_desc", "BatchGetReplicaDesc")
PERF_KEY_DEF(STORE_PY_REMOVE_ALL, "store_py.cpp::remove_all", "RemoveAll")
PERF_KEY_DEF(STORE_PY_CLOSE, "store_py.cpp::close", "Close")

// === RealClient 核心逻辑层(下沉路径,T1-T8)===
PERF_KEY_DEF(RC_SETUP_REAL, "real_client.cpp::setup_real", "SetupReal")
PERF_KEY_DEF(RC_SETUP_INTERNAL, "real_client.cpp::setup_internal", "SetupInternal")
PERF_KEY_DEF(RC_TEARDOWN_ALL, "real_client.cpp::tearDownAll", "TeardownAll")
PERF_KEY_DEF(RC_TEARDOWN_ALL_INTERNAL, "real_client.cpp::tearDownAll_internal", "TeardownAllInternal")
PERF_KEY_DEF(RC_REMOVE_ALL, "real_client.cpp::removeAll", "RemoveAll")
PERF_KEY_DEF(RC_REMOVE_ALL_INTERNAL, "real_client.cpp::removeAll_internal", "RemoveAllInternal")
PERF_KEY_DEF(RC_BATCH_IS_EXIST, "real_client.cpp::batchIsExist", "BatchIsExist")
PERF_KEY_DEF(RC_BATCH_IS_EXIST_INTERNAL, "real_client.cpp::batchIsExist_internal", "BatchIsExistInternal")
PERF_KEY_DEF(RC_REGISTER_BUFFER, "real_client.cpp::register_buffer", "RegisterBuffer")
PERF_KEY_DEF(RC_REGISTER_BUFFER_INTERNAL, "real_client.cpp::register_buffer_internal","RegisterBufferInternal")
PERF_KEY_DEF(RC_BATCH_PUT_MULTI, "real_client.cpp::batch_put_from_multi_buffers", "BatchPutMultiBuf")
PERF_KEY_DEF(RC_BATCH_PUT_MULTI_INTERNAL, "real_client.cpp::batch_put_from_multi_buffers_internal","BatchPutMultiBufInternal")
PERF_KEY_DEF(RC_BATCH_GET_INTO_MULTI, "real_client.cpp::batch_get_into_multi_buffers", "BatchGetIntoMultiBuf")
PERF_KEY_DEF(RC_BATCH_GET_INTO_MULTI_INTERNAL, "real_client.cpp::batch_get_into_multi_buffers_internal","BatchGetIntoMultiBufInternal")
PERF_KEY_DEF(RC_BATCH_GET_REPLICA_DESC, "real_client.cpp::batch_get_replica_desc", "BatchGetReplicaDesc")

// === Client 服务层(vllm 路径下沉,部分已有打点)===
PERF_KEY_DEF(CLIENT_BATCH_QUERY, "client_service.cpp::BatchQuery", "BatchQuery")
96 changes: 86 additions & 10 deletions mooncake-integration/store/store_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "memory_alloc.h"
#include "ssd_register_client.h"
#include "device/accelerator_registry.h"
#include "mooncake_logging.h" // MC_LOG

#include <cstdlib> // for atexit
#include <memory>
Expand Down Expand Up @@ -2084,19 +2085,25 @@ PYBIND11_MODULE(store, m) {
const std::string &tenant_id = "default",
bool enable_client_http_server = false,
int client_http_port = DEFAULT_CLIENT_HTTP_PORT) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_SETUP,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
auto real_client = self.init_real_client();
std::shared_ptr<mooncake::TransferEngine> transfer_engine =
nullptr;
if (!engine.is_none()) {
transfer_engine =
engine.cast<std::shared_ptr<TransferEngine>>();
}
return real_client->setup_real(
auto ret = real_client->setup_real(
local_hostname, metadata_server, global_segment_size,
local_buffer_size, protocol, rdma_devices,
master_server_addr, transfer_engine, "", enable_ssd_offload,
ssd_offload_path, tenant_id, enable_client_http_server,
client_http_port);
pt.End(ret == 0 ? 0 : -1);
// MC_LOG 在下沉层 setup_real 输出(Q1b)
return ret;
},
py::arg("local_hostname"), py::arg("metadata_server"),
py::arg("global_segment_size"), py::arg("local_buffer_size"),
Expand All @@ -2109,6 +2116,9 @@ PYBIND11_MODULE(store, m) {
.def(
"setup",
[](MooncakeStorePyWrapper &self, const py::dict &config_dict) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_SETUP,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
auto real_client = self.init_real_client();

// Convert py::dict to ConfigDict (all values as strings)
Expand All @@ -2120,8 +2130,11 @@ PYBIND11_MODULE(store, m) {
}

auto result = real_client->setup_internal(config);
return result.has_value() ? 0
: static_cast<int>(result.error());
int ret = result.has_value() ? 0
: static_cast<int>(result.error());
pt.End(ret == 0 ? 0 : -1);
// MC_LOG 在下沉层 setup_real 输出(Q1b)
return ret;
},
py::arg("config"),
"Setup the store with a configuration dictionary.\n"
Expand Down Expand Up @@ -2230,8 +2243,20 @@ PYBIND11_MODULE(store, m) {
.def(
"remove_all",
[](MooncakeStorePyWrapper &self, bool force) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_REMOVE_ALL,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
auto t0 = std::chrono::steady_clock::now();
py::gil_scoped_release release;
return self.store_->removeAll(force);
auto ret = self.store_->removeAll(force);
auto t1 = std::chrono::steady_clock::now();
auto elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(
t1 - t0).count();
pt.End(ret == 0 ? 0 : -1);
// 下沉 removeAll 不加 MC_LOG,入口层输出汇总(Q1b)
MC_LOG(INFO) << "[remove_all] elapsed_us=" << elapsed_us
<< " success=" << (ret == 0 ? 1 : 0);
return ret;
},
py::arg("force") = false,
"Remove all objects from the store. If force=True, skip lease "
Expand All @@ -2255,17 +2280,43 @@ PYBIND11_MODULE(store, m) {
"batch_is_exist",
[](MooncakeStorePyWrapper &self,
const std::vector<std::string> &keys) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_BATCH_IS_EXIST,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
py::gil_scoped_release release;
return self.store_->batchIsExist(keys);
auto ret = self.store_->batchIsExist(keys);
pt.End(0);
// MC_LOG 在下沉层 batchIsExist 输出 per-key(Q1b)
return ret;
},
py::arg("keys"),
"Check if multiple objects exist. Returns list of results: 1 if "
"exists, 0 if not exists, -1 if error")
.def("close",
[](MooncakeStorePyWrapper &self) {
if (!self.store_) return 0;
SpDiag::PerfPoint pt(PerfKey::STORE_PY_CLOSE,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
auto t0 = std::chrono::steady_clock::now();
if (!self.store_) {
auto t1 = std::chrono::steady_clock::now();
auto elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(
t1 - t0).count();
pt.End(0);
// 无下沉 MC_LOG,入口层输出汇总(Q1b)
MC_LOG(INFO) << "[close] elapsed_us=" << elapsed_us
<< " success=1";
return 0;
}
int rc = self.store_->tearDownAll();
self.store_.reset();
auto t1 = std::chrono::steady_clock::now();
auto elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(
t1 - t0).count();
pt.End(rc == 0 ? 0 : -1);
// 下沉 tearDownAll 不加 MC_LOG,入口层输出汇总(Q1b)
MC_LOG(INFO) << "[close] elapsed_us=" << elapsed_us
<< " success=" << (rc == 0 ? 1 : 0);
return rc;
})
.def("health_check", &MooncakeStorePyWrapper::health_check,
Expand Down Expand Up @@ -2649,10 +2700,16 @@ PYBIND11_MODULE(store, m) {
"register_buffer",
[](MooncakeStorePyWrapper &self, uintptr_t buffer_ptr,
size_t size) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_REGISTER_BUFFER,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
// Register memory buffer for RDMA operations
void *buffer = reinterpret_cast<void *>(buffer_ptr);
py::gil_scoped_release release;
return self.store_->register_buffer(buffer, size);
auto ret = self.store_->register_buffer(buffer, size);
pt.End(ret == 0 ? 0 : -1);
// MC_LOG 在下沉层 register_buffer 输出汇总(Q1b)
return ret;
},
py::arg("buffer_ptr"), py::arg("size"),
"Register a memory buffer for direct access operations")
Expand Down Expand Up @@ -2897,13 +2954,20 @@ PYBIND11_MODULE(store, m) {
const std::vector<std::vector<uintptr_t>> &all_buffer_ptrs,
const std::vector<std::vector<size_t>> &all_sizes,
const ReplicateConfig &config = ReplicateConfig{}) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_BATCH_PUT_MULTI,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
if (!self.is_client_initialized()) {
LOG(ERROR) << "Client is not initialized";
pt.End(-1);
return std::vector<int>{};
}
py::gil_scoped_release release;
return self.store_->batch_put_from_multi_buffers(
auto ret = self.store_->batch_put_from_multi_buffers(
keys, CastAddrs2Ptrs(all_buffer_ptrs), all_sizes, config);
pt.End(ret.empty() ? -1 : 0);
// MC_LOG 在下沉层 *_internal 输出 汇总+per-key(Q1b)
return ret;
},
py::arg("keys"), py::arg("all_buffer_ptrs"), py::arg("all_sizes"),
py::arg("config") = ReplicateConfig{},
Expand All @@ -2917,10 +2981,16 @@ PYBIND11_MODULE(store, m) {
const std::vector<std::vector<uintptr_t>> &all_buffer_ptrs,
const std::vector<std::vector<size_t>> &all_sizes,
bool prefer_alloc_in_same_node = false) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_BATCH_GET_INTO_MULTI,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
py::gil_scoped_release release;
return self.store_->batch_get_into_multi_buffers(
auto ret = self.store_->batch_get_into_multi_buffers(
keys, CastAddrs2Ptrs(all_buffer_ptrs), all_sizes,
prefer_alloc_in_same_node);
pt.End(ret.empty() ? -1 : 0);
// MC_LOG 在下沉层 *_internal 输出 汇总+per-key(Q1b)
return ret;
},
py::arg("keys"), py::arg("all_buffer_ptrs"), py::arg("all_sizes"),
py::arg("prefer_alloc_in_same_node") = false,
Expand All @@ -2938,8 +3008,14 @@ PYBIND11_MODULE(store, m) {
"batch_get_replica_desc",
[](MooncakeStorePyWrapper &self,
const std::vector<std::string> &keys) {
SpDiag::PerfPoint pt(PerfKey::STORE_PY_BATCH_GET_REPLICA_DESC,
SpDiag::PerfLevel::KEY_MODULE);
pt.Start();
py::gil_scoped_release release;
return self.store_->batch_get_replica_desc(keys);
auto ret = self.store_->batch_get_replica_desc(keys);
pt.End(0);
// MC_LOG 在下沉层 batch_get_replica_desc 输出 per-key(Q1b)
return ret;
},
py::arg("keys"))
.def(
Expand Down
10 changes: 10 additions & 0 deletions mooncake-store/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ target_link_libraries(
stress_cluster_bench PRIVATE mooncake_store transfer_engine asio_shared
gflags::gflags glog::glog pthread)

# Benchmark for vLLM Store Connector path
# Triggers: batch_put_from_multi_buffers / batchIsExist /
# batch_get_into_multi_buffers (and setup/register_buffer/tearDownAll).
# Used to verify SpDiag perf points and MC_LOG logging.
add_executable(store_connector_bench store_connector_bench.cpp)
target_link_libraries(
store_connector_bench PRIVATE mooncake_store transfer_engine asio_shared
gflags::gflags glog::glog pthread)


# Benchmark for RealClient::get_into_ranges with configurable value size,
# fragments per key and keys per query.
add_executable(stress_cluster_ranges_bench stress_cluster_ranges_bench.cpp)
Expand Down
Loading
Loading