Add Arm64 CPU Phase 1A CI bootstrap (#22123)
Co-authored-by: Ma Mingfei <mingfei.ma@intel.com>
This commit is contained in:
co-authored by
Ma Mingfei
parent
3c3f0bd55e
commit
55224fff08
@@ -0,0 +1,35 @@
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from sglang.srt.server_args import ServerArgs
|
||||
|
||||
|
||||
class TestServerArgsCPUBackend(unittest.TestCase):
|
||||
def _make_server_args(self, attention_backend=None):
|
||||
server_args = ServerArgs.__new__(ServerArgs)
|
||||
server_args.device = "cpu"
|
||||
server_args.attention_backend = attention_backend
|
||||
server_args.sampling_backend = None
|
||||
return server_args
|
||||
|
||||
@patch("sglang.srt.server_args.is_host_cpu_arm64", return_value=True)
|
||||
def test_arm_cpu_defaults_to_torch_native(self, _mock_is_arm64):
|
||||
server_args = self._make_server_args()
|
||||
|
||||
ServerArgs._handle_cpu_backends(server_args)
|
||||
|
||||
self.assertEqual(server_args.attention_backend, "torch_native")
|
||||
self.assertEqual(server_args.sampling_backend, "pytorch")
|
||||
|
||||
@patch("sglang.srt.server_args.is_host_cpu_arm64", return_value=False)
|
||||
def test_x86_cpu_defaults_to_intel_amx(self, _mock_is_arm64):
|
||||
server_args = self._make_server_args()
|
||||
|
||||
ServerArgs._handle_cpu_backends(server_args)
|
||||
|
||||
self.assertEqual(server_args.attention_backend, "intel_amx")
|
||||
self.assertEqual(server_args.sampling_backend, "pytorch")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -44,6 +44,21 @@ suite_amd = {
|
||||
# by test/run_suite.py using the registry system.
|
||||
}
|
||||
|
||||
# Keep the Arm64 bootstrap suite limited to hosted-runner-safe unit kernels.
|
||||
# `test_extend.py`, `test_mamba.py`, and `test_mla.py` still hit the
|
||||
# x86-specific BF16 BRGEMM/VNNI path on Arm and need dedicated fallbacks.
|
||||
suite_arm64 = {
|
||||
"per-commit-cpu-arm64": [
|
||||
TestFile("cpu/test_activation.py"),
|
||||
TestFile("cpu/test_decode.py"),
|
||||
TestFile("cpu/test_norm.py"),
|
||||
TestFile("cpu/test_qwen3.py"),
|
||||
TestFile("cpu/test_rope.py"),
|
||||
TestFile("cpu/test_server_args_backend.py"),
|
||||
TestFile("cpu/test_topk.py"),
|
||||
],
|
||||
}
|
||||
|
||||
# Add Intel Xeon tests
|
||||
suite_xeon = {
|
||||
"per-commit-cpu": [
|
||||
@@ -66,6 +81,7 @@ suite_xeon = {
|
||||
TestFile("cpu/test_qkv_proj_with_rope.py"),
|
||||
TestFile("cpu/test_qwen3.py"),
|
||||
TestFile("cpu/test_rope.py"),
|
||||
TestFile("cpu/test_server_args_backend.py"),
|
||||
TestFile("cpu/test_shared_expert.py"),
|
||||
TestFile("cpu/test_topk.py"),
|
||||
],
|
||||
@@ -83,6 +99,7 @@ suite_xpu = {
|
||||
}
|
||||
|
||||
suites.update(suite_amd)
|
||||
suites.update(suite_arm64)
|
||||
suites.update(suite_xeon)
|
||||
suites.update(suite_xpu)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user