Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
fetchRecurseSubmodules = false
[submodule "third_party/xllm_ops"]
path = third_party/xllm_ops
url = https://gitcode.com/xLLM-AI/xllm_ops.git
url = https://github.com/xLLM-AI/xllm-ops.git
fetchRecurseSubmodules = true
[submodule "third_party/etcd_cpp_apiv3"]
path = third_party/etcd_cpp_apiv3
Expand All @@ -36,7 +36,7 @@
fetchRecurseSubmodules = false
[submodule "third_party/torch_npu_ops"]
path = third_party/torch_npu_ops
url = https://gitcode.com/xLLM-AI/torch_npu_ops.git
url = https://github.com/xLLM-AI/torch-npu-ops.git
fetchRecurseSubmodules = false
[submodule "third_party/cutlass"]
path = third_party/cutlass
Expand Down
34 changes: 34 additions & 0 deletions tests/core/framework/config/config_json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.

#include <gtest/gtest.h>

#include <algorithm>
#include <filesystem>
#include <fstream>
#include <nlohmann/json.hpp>
Expand All @@ -24,6 +25,7 @@ limitations under the License.
#include "core/common/global_flags.h"
#include "core/framework/config/config_utils.h"
#include "core/framework/config/execution_config.h"
#include "core/framework/config/kernel_config.h"
#include "core/framework/config/kv_cache_config.h"
#include "core/framework/config/model_config.h"
#include "core/framework/config/parallel_config.h"
Expand Down Expand Up @@ -236,6 +238,38 @@ TEST(ConfigJsonTest, FromJsonUsesParsedOverrides) {
EXPECT_EQ(scheduler_config.max_decode_token_per_sequence(), 256);
}

#if defined(USE_NPU)
TEST(KernelConfigTest, MegaMoeDefaultsOffAndReadsJsonOverride) {
KernelConfig kernel_config;
EXPECT_EQ(kernel_config.mega_moe_mode(), "off");
EXPECT_EQ(kernel_config.mega_moe_weight_cache_budget_bytes(),
4LL * 1024 * 1024 * 1024);

const JsonReader json = config::parse_json_string(
R"json({"mega_moe_mode": "on", "mega_moe_weight_cache_budget_bytes": 123456})json");
kernel_config.from_json(json);
EXPECT_EQ(kernel_config.mega_moe_mode(), "on");
EXPECT_EQ(kernel_config.mega_moe_weight_cache_budget_bytes(), 123456);

nlohmann::ordered_json dumped_config;
kernel_config.append_config_json(dumped_config);
ASSERT_TRUE(dumped_config.contains("mega_moe_mode"));
EXPECT_EQ(dumped_config.at("mega_moe_mode").get<std::string>(), "on");
ASSERT_TRUE(
dumped_config.contains("mega_moe_weight_cache_budget_bytes"));
EXPECT_EQ(dumped_config.at("mega_moe_weight_cache_budget_bytes")
.get<int64_t>(),
123456);

const auto& names = KernelConfig::option_category().option_names;
EXPECT_NE(std::find(names.begin(), names.end(), "mega_moe_mode"),
names.end());
EXPECT_NE(std::find(names.begin(), names.end(),
"mega_moe_weight_cache_budget_bytes"),
names.end());
}
#endif

TEST(KVCacheConfigValidationTest, AcceptsSupportedIndexerCacheDtypes) {
KVCacheConfig config;

Expand Down
13 changes: 13 additions & 0 deletions tests/core/framework/parallel_state/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ if(USE_NPU)
hccl
c_sec
nnopbase)

cc_test(
NAME
mega_moe_comm_resource_test
SRCS
mega_moe_comm_resource_test.cpp
DEPS
mega_moe_comm_resource
torch
GTest::gtest_main
hccl
hcomm
)
endif()

if(USE_MLU)
Expand Down
Loading