mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #3068] [RFC]: Add Go DummyClient support and a multi-process benchmark #787
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#787
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BGQ99 on GitHub (Jul 23, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/3068
Motivation
Mooncake provides a C++
DummyClientthat communicates with a standalonemooncake_client, but the Go bindings currently lack the APIs needed to createand configure a
DummyClient, access the shared-memory buffers prepared duringsetup, and exercise the single-object
PutFrompath.This RFC proposes adding the required bindings and a multi-process Go benchmark
for validating multiple independent application processes sharing one
standalone
mooncake_client.An implementation is available in
kvcache-ai/Mooncake#3015.
It ports the relevant work from
zchuango/Mooncake#29
onto the current Mooncake
mainbranch.Runtime Architecture
The request path is:
Go worker -> DummyClient -> RPC -> standalone
mooncake_client-> RealClient -> Mooncake Store
The standalone
mooncake_clientowns theRealClientand exposes the requiredRPC handlers. Each benchmark worker is an independent operating-system process
with its own
DummyClient, address space, and registered shared-memory context.Separate processes are required because goroutines would still share one address
space and would not reproduce the intended multi-client shared-memory setup.
Proposed Changes
1. Expose DummyClient through the Go and C bindings
Allow the Store bindings to explicitly create either a
RealClientor aDummyClient.The proposed Go API uses:
New()to create the defaultRealClient;NewWithType(MOONCAKE_CLIENT_DUMMY)to create aDummyClient.The public Go API uses the Go-defined
ClientTypetype and does not expose CGotypes to callers.
2. Preserve the existing Go Setup API
Keep the existing seven-argument Go
Setupmethod forRealClientand add:DummySetup(memPoolSize, localBufferSize, serverAddress, ipcSocketPath)Go does not support optional function parameters. Extending the existing
Setupsignature would therefore break existing Go call sites.3. Preserve C API compatibility
Keep the existing C creation and setup APIs unchanged for current direct C
callers, and add explicit entry points for dummy clients:
mooncake_store_create()as the defaultRealClientconstructor;mooncake_store_create_with_type(client_type);mooncake_store_setup(...);mooncake_store_setup_dummy(...).The Go wrapper will use the new entry points for
DummyClient. Existing directC callers remain source-compatible, while the additional symbols provide the
configuration required by the Go binding.
Feedback on the exact function names and parameter layout is welcome, but this
RFC does not propose changing the signatures of the existing C APIs.
4. Provide access to DummyClient registered buffers
The benchmark must access the shared-memory buffers prepared during
DummyClientsetup before callingPutFromandGetInto.The current implementation exposes operations to:
The current implementation exposes these operations through the public Store
binding.
5. Complete the single-object PutFrom path
DummyClientalready supports batchput_from, while the Go benchmark uses thesingle-object
PutFromAPI.The current implementation adds a dedicated
RealClient::put_from_dummy_helperRPC. It:DummyClientaddress into a pointer valid in the standalonemooncake_clientprocess;RealClientsingle-objectput_fromimplementation.The handler is registered in both the production
mooncake_clientand the testRPC server.
The current proposal retains a dedicated single-object RPC. This keeps the
single-object API explicit, preserves its direct forwarding path, and reuses
the existing
RealClientsingle-object implementation. Reusing the batch RPCwith a one-object request was considered, but not selected because it would
make the single-object API depend on batch semantics internally.
6. Add a multi-process Go benchmark
The benchmark:
os/exec;DummyClientper worker;PutFrom;GetInto;Using separate processes, rather than goroutines, provides independent address
spaces,
DummyClientinstances, shared-memory contexts, and CPU affinity.Shared-Memory Safety
Pointers are process-local virtual addresses.
RealClientmust not directlydereference an address received from
DummyClient.The RPC request includes the
DummyClientaddress, size, device ID, and clientID.
RealClientuses the corresponding shared-memory context to translate thedummy address into a valid local pointer.
Before accessing registered memory, the Go benchmark validates:
intrange;Go slices are constructed using the actual accessible buffer length.
Scope
Included:
DummyClientbindings;DummySetup;DummyClientbuffers;PutFromsupport;DummyClientbenchmark.Explicitly excluded from this proposal:
mooncake-store/benchmarks/stress_cluster_bench.cpp;Validation
The current implementation has been validated by:
mooncake_store,mooncake_master, andmooncake_client;examples/basicprogram;failures;
failures, and no verification errors;
Verify Errors: 1andnon-zero worker and master exit statuses;
cargo check --lockedagainst the compatibility-preservingC API;
gofmt, targeted pre-commit hooks, and the project C/C++ formatcheck.
These checks provide small-scale functional validation, not full performance,
high-concurrency, or stress coverage.
Current Status
The implementation PR is ready for review. All 12 existing inline review threads
have been addressed and resolved.
References
zchuango/Mooncake#29
kvcache-ai/Mooncake#3015
@github-actions[bot] commented on GitHub (Jul 23, 2026):
Thanks for opening this issue, @BGQ99!
300298448A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@github-actions[bot] commented on GitHub (Oct 26, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.