Unverified Commit 094c116f authored by YanbingJiang's avatar YanbingJiang Committed by GitHub
Browse files

Update python API of activation, topk, norm and rope and remove vllm dependency (#6614)


Co-authored-by: default avatarWu, Chunyuan <chunyuan.wu@intel.com>
Co-authored-by: default avatarjianan-gu <jianan.gu@intel.com>
Co-authored-by: default avatarsdp <sdp@gnr799219.jf.intel.com>
parent e56685ac
...@@ -71,7 +71,7 @@ class TestSharedExpert(CustomTestCase): ...@@ -71,7 +71,7 @@ class TestSharedExpert(CustomTestCase):
) )
atol = rtol = precision[ref.dtype] atol = rtol = precision[ref.dtype]
self.assertTrue(torch.allclose(ref, res, atol=atol, rtol=rtol)) torch.testing.assert_close(ref, res, atol=atol, rtol=rtol)
def test_bf16_shared_expert(self): def test_bf16_shared_expert(self):
for params in itertools.product( for params in itertools.product(
...@@ -129,7 +129,7 @@ class TestSharedExpert(CustomTestCase): ...@@ -129,7 +129,7 @@ class TestSharedExpert(CustomTestCase):
) )
atol = rtol = precision[ref2.dtype] atol = rtol = precision[ref2.dtype]
self.assertTrue(torch.allclose(ref2, res2, atol=atol, rtol=rtol)) torch.testing.assert_close(ref2, res2, atol=atol, rtol=rtol)
def test_int8_shared_expert(self): def test_int8_shared_expert(self):
for params in itertools.product( for params in itertools.product(
...@@ -199,7 +199,7 @@ class TestSharedExpert(CustomTestCase): ...@@ -199,7 +199,7 @@ class TestSharedExpert(CustomTestCase):
) )
atol = rtol = precision[ref_out.dtype] atol = rtol = precision[ref_out.dtype]
self.assertTrue(torch.allclose(ref_out, out, atol=atol, rtol=rtol)) torch.testing.assert_close(ref_out, out, atol=atol, rtol=rtol)
def test_fp8_shared_expert(self): def test_fp8_shared_expert(self):
for params in itertools.product( for params in itertools.product(
......
...@@ -8,8 +8,8 @@ from utils import precision ...@@ -8,8 +8,8 @@ from utils import precision
from sglang.srt.layers.moe.topk import ( from sglang.srt.layers.moe.topk import (
biased_grouped_topk_impl as native_biased_grouped_topk, biased_grouped_topk_impl as native_biased_grouped_topk,
) )
from sglang.srt.layers.moe.topk import fused_topk_native as native_fused_topk from sglang.srt.layers.moe.topk import fused_topk_torch_native as native_fused_topk
from sglang.srt.layers.moe.topk import grouped_topk as native_grouped_topk from sglang.srt.layers.moe.topk import grouped_topk_gpu as native_grouped_topk
from sglang.srt.models.llama4 import Llama4MoE from sglang.srt.models.llama4 import Llama4MoE
from sglang.test.test_utils import CustomTestCase from sglang.test.test_utils import CustomTestCase
......
...@@ -175,9 +175,11 @@ suites = { ...@@ -175,9 +175,11 @@ suites = {
TestFile("cpu/test_decode.py"), TestFile("cpu/test_decode.py"),
TestFile("cpu/test_extend.py"), TestFile("cpu/test_extend.py"),
TestFile("cpu/test_gemm.py"), TestFile("cpu/test_gemm.py"),
TestFile("cpu/test_mla.py"),
TestFile("cpu/test_moe.py"), TestFile("cpu/test_moe.py"),
TestFile("cpu/test_norm.py"), TestFile("cpu/test_norm.py"),
TestFile("cpu/test_qkv_proj_with_rope.py"), TestFile("cpu/test_qkv_proj_with_rope.py"),
TestFile("cpu/test_rope.py"),
TestFile("cpu/test_shared_expert.py"), TestFile("cpu/test_shared_expert.py"),
], ],
"nightly": [ "nightly": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment