Skip to content

Commit 49bafc0

Browse files
committed
feat: upgrade Mooncake to v0.3.6.
1 parent 5bec75f commit 49bafc0

File tree

6 files changed

+20
-35
lines changed

6 files changed

+20
-35
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
33

44
option(USE_NPU "Enable NPU support" OFF)
55
option(USE_MLU "Enable MLU support" OFF)
6+
add_compile_definitions(YLT_ENABLE_IBV)
7+
add_definitions(-DYLT_ENABLE_IBV)
8+
set(YLT_ENABLE_IBV ON)
69

710
if(DEVICE_ARCH STREQUAL "ARM")
811
set(CMAKE_SYSTEM_PROCESSOR aarch64)

third_party/Mooncake

Submodule Mooncake updated from fb26af7 to be89497

third_party/custom_patch/Mooncake.patch

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ index 8483085..9d263dd 100644
2626
add_subdirectory(benchmarks)
2727
\ No newline at end of file
2828
diff --git a/mooncake-store/include/offset_allocator/offset_allocator.hpp b/mooncake-store/include/offset_allocator/offset_allocator.hpp
29-
index fde978b..ac54f8c 100644
29+
index b6d55c8..2d80158 100644
3030
--- a/mooncake-store/include/offset_allocator/offset_allocator.hpp
3131
+++ b/mooncake-store/include/offset_allocator/offset_allocator.hpp
3232
@@ -6,7 +6,7 @@
@@ -38,40 +38,24 @@ index fde978b..ac54f8c 100644
3838

3939
namespace mooncake::offset_allocator {
4040
typedef unsigned char uint8;
41-
diff --git a/mooncake-store/include/storage_backend.h b/mooncake-store/include/storage_backend.h
42-
index a30f0c6..3bfeffb 100644
43-
--- a/mooncake-store/include/storage_backend.h
44-
+++ b/mooncake-store/include/storage_backend.h
45-
@@ -4,8 +4,8 @@
46-
#include <vector>
47-
#include <mutex>
48-
#include <fstream>
49-
-#include <types.h>
50-
-#include <file_interface.h>
51-
+#include "types.h"
52-
+#include "file_interface.h"
53-
#include <filesystem>
54-
#include <thread>
55-
#include <chrono>
5641
diff --git a/mooncake-store/include/types.h b/mooncake-store/include/types.h
57-
index d2830a3..39c3b27 100644
42+
index 077926b..b36862b 100644
5843
--- a/mooncake-store/include/types.h
5944
+++ b/mooncake-store/include/types.h
60-
@@ -10,8 +10,11 @@
61-
#include <variant>
45+
@@ -8,7 +8,10 @@
46+
#include <unordered_map>
6247
#include <vector>
6348

6449
-#include "Slab.h"
6550
+#include "cachelib_memory_allocator/Slab.h"
66-
#include "allocator.h"
6751
+namespace iguana {
6852
+using std::contiguous_iterator;
6953
+}
7054
#include "ylt/struct_json/json_reader.h"
7155
#include "ylt/struct_json/json_writer.h"
7256

7357
diff --git a/mooncake-store/src/ha_helper.cpp b/mooncake-store/src/ha_helper.cpp
74-
index c1f4ded..e4b982b 100644
58+
index 796838a..8e72b80 100644
7559
--- a/mooncake-store/src/ha_helper.cpp
7660
+++ b/mooncake-store/src/ha_helper.cpp
7761
@@ -1,3 +1,6 @@
@@ -81,7 +65,7 @@ index c1f4ded..e4b982b 100644
8165
#include "ha_helper.h"
8266
#include "etcd_helper.h"
8367
#include "rpc_service.h"
84-
@@ -169,4 +172,6 @@ MasterServiceSupervisor::~MasterServiceSupervisor() {
68+
@@ -174,4 +177,6 @@ MasterServiceSupervisor::~MasterServiceSupervisor() {
8569
}
8670
}
8771

@@ -113,7 +97,7 @@ index f515671..7a019b6 100644
11397
+#pragma GCC pop_options
11498
\ No newline at end of file
11599
diff --git a/mooncake-store/src/utils.cpp b/mooncake-store/src/utils.cpp
116-
index b775851..736d61d 100644
100+
index 9678f57..f41eb10 100644
117101
--- a/mooncake-store/src/utils.cpp
118102
+++ b/mooncake-store/src/utils.cpp
119103
@@ -1,6 +1,6 @@

xllm/core/framework/block/block_manager_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ bool BlockManagerPool::allocate(Sequence* sequence, size_t num_tokens) {
247247
for (int i = hbm_cache_token_num / options_.block_size();
248248
i < host_cache_token_num / options_.block_size();
249249
i++) {
250-
load_block_transfer_infos_[dp_rank].push_back(
250+
load_block_transfer_infos_[dp_rank].emplace_back(
251251
BlockTransferInfo(host_blocks[i].id(),
252252
hbm_blocks[i].id(),
253253
host_blocks[i].get_immutable_hash_value(),

xllm/core/framework/kv_cache/kv_cache_store.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ bool KVCacheStore::init(const StoreConfig& config,
1616
CHECK(!is_initialized_) << "KVCacheStore is initialized.";
1717
config_ = config;
1818
host_kv_caches_ = host_kv_caches;
19+
std::optional<std::string> device_names = std::nullopt;
1920
if (config_.protocol == "rdma") {
20-
if (getenv("DEVICE_NAME")) {
21-
auto name = getenv("DEVICE_NAME");
22-
LOG(INFO) << "device name: " << name;
23-
args_ = mooncake::rdma_args(name);
21+
if (getenv("DEVICE_NAMES")) {
22+
device_names = getenv("DEVICE_NAMES");
23+
LOG(INFO) << "device_names: " << device_names.value();
2424
} else {
2525
LOG(WARNING) << "env DEVICE_NAME not exist, set protocol as tcp";
2626
config_.protocol = "tcp";
27-
args_ = nullptr;
2827
}
2928
}
3029

3130
auto client_opt = mooncake::Client::Create(config_.localhost_name,
3231
config_.metadata_connstring,
3332
config_.protocol,
34-
args_,
33+
device_names,
3534
config_.master_server_entry);
3635

3736
rep_config_.replica_num = config_.replica_num;
3837
// rep_config_.preferred_segment = config_.localhost_name;
3938

4039
if (!client_opt.has_value()) {
41-
LOG(FATAL) << "mooncake::Client::Create fail!";
42-
return false;
40+
LOG(FATAL) << "mooncake::Client::Create fail! Failed to create client with "
41+
"host_name: "
42+
<< config_.localhost_name;
4343
}
4444
client_ptr_ = client_opt.value();
4545

xllm/core/framework/kv_cache/kv_cache_store.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ class KVCacheStore {
6767
StoreConfig config_;
6868
mooncake::ReplicateConfig rep_config_;
6969

70-
void** args_ = nullptr;
71-
7270
std::vector<xllm::KVCache>* host_kv_caches_;
7371

7472
uint64_t key_cache_size_per_layer_;

0 commit comments

Comments
 (0)