[Rust] Rename mem-cache to sglang-radix-tree (#37290)

This commit is contained in:
Jialin Ouyang
2026-09-01 03:03:44 -07:00
committed by GitHub
parent c16a8fc899
commit a77283fb02
30 changed files with 38 additions and 38 deletions
@@ -1,4 +1,4 @@
"""Run the standalone mem-cache crate's native Rust unit tests."""
"""Run the standalone sglang-radix-tree crate's native Rust unit tests."""
import shutil
import subprocess
@@ -12,7 +12,7 @@ from sglang.test.test_utils import CustomTestCase
BUILD_AND_RUN_TIMEOUT_S = 900
RUST_WORKSPACE = Path(__file__).resolve().parents[3] / "rust"
MEM_CACHE_MANIFEST = RUST_WORKSPACE / "mem-cache" / "Cargo.toml"
SGLANG_RADIX_TREE_MANIFEST = RUST_WORKSPACE / "sglang-radix-tree" / "Cargo.toml"
register_cpu_ci(est_time=900, suite="base-a-test-cpu")
@@ -21,19 +21,19 @@ register_cpu_ci(est_time=900, suite="base-a-test-cpu")
envs.SGLANG_SKIP_RUST_TESTS.get(),
"SGLANG_SKIP_RUST_TESTS is set (no rust/ workspace changes per CI check-changes)",
)
class TestMemCacheCargo(CustomTestCase):
def test_mem_cache_native_tests(self):
class TestSGLangRadixTreeCargo(CustomTestCase):
def test_sglang_radix_tree_native_tests(self):
self.assertIsNotNone(
shutil.which("cargo"),
"cargo not found on PATH; install a Rust toolchain "
"(scripts/ci/utils/install_rust_protoc.sh)",
)
self.assertTrue(
MEM_CACHE_MANIFEST.is_file(),
f"mem-cache manifest not found at {MEM_CACHE_MANIFEST}",
SGLANG_RADIX_TREE_MANIFEST.is_file(),
f"sglang-radix-tree manifest not found at {SGLANG_RADIX_TREE_MANIFEST}",
)
build = torch_build_configuration(
compat_header=MEM_CACHE_MANIFEST.parent / "torch_2_13_compat.h",
compat_header=SGLANG_RADIX_TREE_MANIFEST.parent / "torch_2_13_compat.h",
python_module="sglang.srt.mem_cache.rust_tree_core.mem_cache",
)
proc = subprocess.run(
@@ -41,7 +41,7 @@ class TestMemCacheCargo(CustomTestCase):
"cargo",
"test",
"--manifest-path",
str(MEM_CACHE_MANIFEST),
str(SGLANG_RADIX_TREE_MANIFEST),
"--locked",
"--no-default-features",
],
@@ -55,7 +55,7 @@ class TestMemCacheCargo(CustomTestCase):
self.assertEqual(
proc.returncode,
0,
f"mem-cache native tests failed\n"
f"sglang-radix-tree native tests failed\n"
f"--- stdout ---\n{proc.stdout}\n--- stderr ---\n{proc.stderr}",
)
+1 -1
View File
@@ -542,7 +542,7 @@ crate-type = ["cdylib"]
),
(
"sglang.srt.mem_cache.rust_tree_core.mem_cache",
"mem_cache",
"sglang-radix-tree",
"mem_cache",
("python-extension",),
),