[AMD] Support Hierarchical Caching on AMD GPUs (#8236)

This commit is contained in:
Hubert Lu
2025-08-28 15:27:07 -07:00
committed by GitHub
parent 5343058875
commit 711390a971
10 changed files with 105 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
import unittest
from types import SimpleNamespace
from sglang.srt.utils import kill_process_tree
from sglang.srt.utils import is_hip, kill_process_tree
from sglang.test.run_eval import run_eval
from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST,
@@ -11,6 +11,8 @@ from sglang.test.test_utils import (
popen_launch_server,
)
_is_hip = is_hip()
class TestHiCache(CustomTestCase):
@classmethod
@@ -26,7 +28,7 @@ class TestHiCache(CustomTestCase):
"--mem-fraction-static",
0.7,
"--hicache-size",
100,
100 if not _is_hip else 200,
],
)

View File

@@ -1,7 +1,7 @@
import unittest
from types import SimpleNamespace
from sglang.srt.utils import kill_process_tree
from sglang.srt.utils import is_hip, kill_process_tree
from sglang.test.run_eval import run_eval
from sglang.test.test_utils import (
DEFAULT_MLA_MODEL_NAME_FOR_TEST,
@@ -11,6 +11,12 @@ from sglang.test.test_utils import (
popen_launch_server,
)
_is_hip = is_hip()
if _is_hip:
hicache_args = ["--hicache-size", 200]
else:
hicache_args = ["--hicache-ratio", 2]
class TestHierarchicalMLA(CustomTestCase):
@classmethod
@@ -24,9 +30,8 @@ class TestHierarchicalMLA(CustomTestCase):
other_args=[
"--trust-remote-code",
"--enable-hierarchical-cache",
"--hicache-ratio",
2,
],
]
+ hicache_args,
)
@classmethod

View File

@@ -1,7 +1,7 @@
import unittest
from types import SimpleNamespace
from sglang.srt.utils import kill_process_tree
from sglang.srt.utils import is_hip, kill_process_tree
from sglang.test.run_eval import run_eval
from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST,
@@ -11,6 +11,8 @@ from sglang.test.test_utils import (
popen_launch_server,
)
_is_hip = is_hip()
class TestHiCache(CustomTestCase):
@classmethod
@@ -26,7 +28,7 @@ class TestHiCache(CustomTestCase):
"--mem-fraction-static",
0.7,
"--hicache-size",
100,
100 if not _is_hip else 200,
"--page-size",
"64",
"--hicache-storage-backend",

View File

@@ -162,6 +162,9 @@ suites = {
# Add AMD tests
suite_amd = {
"per-commit-amd": [
TestFile("hicache/test_hicache.py", 116),
TestFile("hicache/test_hicache_mla.py", 127),
TestFile("hicache/test_hicache_storage.py", 127),
TestFile("lora/test_lora.py", 200),
TestFile("lora/test_lora_eviction.py", 200),
TestFile("lora/test_lora_backend.py", 99),