Skip to content

Commit d8e8bb5

Browse files
feat: use shared memory for intra-process communication instead of BRPC. (#276)
1 parent 4d8f7c5 commit d8e8bb5

33 files changed

+2328
-554
lines changed

xllm/core/common/global_flags.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ DEFINE_int32(sleep_time_second,
275275
3,
276276
"The sleep time for worker try to connect to server next time.");
277277

278+
DEFINE_bool(enable_shm,
279+
true,
280+
"Whether to enable shared memory for executing model.");
278281
// --- function call config ---
279282

280283
DEFINE_string(tool_call_parser,

xllm/core/common/global_flags.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,6 @@ DECLARE_int64(cache_size_per_token);
199199

200200
DECLARE_int64(buffer_size_per_seq);
201201

202-
DECLARE_bool(enable_beam_search_kernel);
202+
DECLARE_bool(enable_beam_search_kernel);
203+
204+
DECLARE_bool(enable_shm);

xllm/core/common/options.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ class Options {
175175
PROPERTY(bool, enable_offline_inference) = false;
176176
// for offline inference: the path to spawn worker binary
177177
PROPERTY(std::string, spawn_worker_path) = "";
178+
179+
// whether the worker and master are on the same machine.
180+
PROPERTY(bool, is_local) = false;
178181
};
179182

180183
} // namespace xllm

xllm/core/distributed_runtime/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ cc_library(
2020
remote_worker.h
2121
worker_server.h
2222
worker_service.h
23+
comm_channel.h
24+
shm_channel.h
2325
SRCS
2426
disagg_pd_service.cpp
2527
disagg_pd_service_impl.cpp
@@ -29,6 +31,8 @@ cc_library(
2931
remote_worker.cpp
3032
worker_server.cpp
3133
worker_service.cpp
34+
comm_channel.cpp
35+
shm_channel.cpp
3236
DEPS
3337
:api_service
3438
:runtime

0 commit comments

Comments
 (0)