NPU Nightly Pipeline Skip Test Case Adaptation and Recovery Testing (#26353)

This commit is contained in:
liuxianglong17
2026-05-29 09:29:25 +08:00
committed by GitHub
parent 1c2857b064
commit 6258947039
17 changed files with 152 additions and 119 deletions
@@ -12,7 +12,6 @@ register_npu_ci(
est_time=400,
suite="nightly-16-npu-a3",
nightly=True,
disabled="run failed",
)
@@ -89,6 +88,7 @@ class TestNpuHierarchicalCacheMla(CustomTestCase):
gsp_question_len=1792,
gsp_output_len=1,
other_server_args=other_args,
timeout_for_server_launch=1000,
)
TTFT = res["mean_ttft_ms"]
TTFTS.append(TTFT)
@@ -11,7 +11,6 @@ register_npu_ci(
est_time=400,
suite="nightly-2-npu-a3",
nightly=True,
disabled="run failed",
)
@@ -0,0 +1,74 @@
import unittest
from types import SimpleNamespace
from sglang.srt.utils import kill_process_tree
from sglang.test.ascend.test_ascend_utils import LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH
from sglang.test.ci.ci_register import register_npu_ci
from sglang.test.run_eval import run_eval
from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
CustomTestCase,
popen_launch_server,
run_bench_serving,
)
register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True)
class TestNoChunkedPrefill(CustomTestCase):
"""Testcase: Verify Llama-3.1-8B-Instruct accuracy ≥ 0.65 and serving normal with chunked prefill disabled.
[Test Category] Parameter
[Test Target] --chunked-prefill-size
"""
@classmethod
def setUpClass(cls):
cls.model = LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH
cls.base_url = DEFAULT_URL_FOR_TEST
other_args = [
"--attention-backend",
"ascend",
"--disable-cuda-graph",
"--chunked-prefill-size",
"-1",
"--disable-radix-cache",
]
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=other_args,
)
@classmethod
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
def test_mmlu(self):
args = SimpleNamespace(
base_url=self.base_url,
model=self.model,
eval_name="mmlu",
num_examples=64,
num_threads=32,
)
metrics = run_eval(args)
self.assertGreaterEqual(metrics["score"], 0.65)
def test_no_chunked_prefill_without_radix_cache(self):
res = run_bench_serving(
model=LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH,
num_prompts=10,
request_rate=float("inf"),
other_server_args=["--disable-radix-cache", "--chunked-prefill-size", "-1"],
)
assert res["completed"] == 10
if __name__ == "__main__":
unittest.main()
@@ -20,7 +20,6 @@ register_npu_ci(
est_time=200,
suite="nightly-8-npu-a3",
nightly=True,
disabled="https://github.com/Ascend/sglang/issues/58",
)
@@ -56,7 +55,11 @@ class TestQwen3Next(CustomTestCase):
"--watchdog-timeout",
9000,
"--disable-radix-cache",
"--disable-cuda-graph",
"--cuda-graph-bs",
2,
4,
6,
8,
"--max-prefill-tokens",
28672,
"--max-total-tokens",
@@ -69,6 +72,9 @@ class TestQwen3Next(CustomTestCase):
-1,
],
env={
# In NPU scenarios, operators only support BF16 precision.
# This environment variable needs to be set for quantizing weights.
"SGLANG_DEEPEP_BF16_DISPATCH": "1",
"PYTORCH_NPU_ALLOC_CONF": "expandable_segments:True",
"STREAMS_PER_DEVICE": "32",
"HCCL_OP_EXPANSION_MODE": "AIV",
@@ -20,7 +20,6 @@ register_npu_ci(
est_time=200,
suite="nightly-8-npu-a3",
nightly=True,
disabled="https://github.com/Ascend/sglang/issues/58",
)
@@ -56,7 +55,11 @@ class TestQwen3Next(CustomTestCase):
"--watchdog-timeout",
9000,
"--disable-radix-cache",
"--disable-cuda-graph",
"--cuda-graph-bs",
2,
4,
6,
8,
"--chunked-prefill-size",
1024,
"--max-prefill-tokens",
@@ -69,11 +72,18 @@ class TestQwen3Next(CustomTestCase):
"low_latency",
],
env={
# The product of the following two environment variables must be greater than --max-prefill-tokens
# divide by dp size
"DEEPEP_NORMAL_LONG_SEQ_PER_ROUND_TOKENS": "3000",
"DEEPEP_NORMAL_LONG_SEQ_ROUND": "10",
# In NPU scenarios, operators only support BF16 precision.
# This environment variable needs to be set for quantizing weights.
"SGLANG_DEEPEP_BF16_DISPATCH": "1",
"PYTORCH_NPU_ALLOC_CONF": "expandable_segments:True",
"STREAMS_PER_DEVICE": "32",
"HCCL_OP_EXPANSION_MODE": "AIV",
"HCCL_ALGO": "level0:NA;level1:ring",
"SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK": "20",
"SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK": "160",
"HCCL_BUFFSIZE": "2048",
**os.environ,
},
@@ -20,7 +20,6 @@ register_npu_ci(
est_time=400,
suite="nightly-1-npu-a3",
nightly=True,
disabled="run failed",
)
@@ -1,39 +0,0 @@
import unittest
from sglang.test.ascend.test_ascend_utils import LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH
from sglang.test.ci.ci_register import register_npu_ci
from sglang.test.test_utils import CustomTestCase, run_bench_serving, run_mmlu_test
register_npu_ci(
est_time=400,
suite="nightly-1-npu-a3",
nightly=True,
disabled="run failed",
)
class TestNoChunkedPrefill(CustomTestCase):
"""Testcase: Verify Llama-3.1-8B-Instruct accuracy ≥ 0.65 and serving normal with chunked prefill disabled.
[Test Category] Parameter
[Test Target] --chunked-prefill-size
"""
def test_no_chunked_prefill(self):
run_mmlu_test(
disable_radix_cache=False, enable_mixed_chunk=False, chunked_prefill_size=-1
)
def test_no_chunked_prefill_without_radix_cache(self):
res = run_bench_serving(
model=LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH,
num_prompts=10,
request_rate=float("inf"),
other_server_args=["--disable-radix-cache", "--chunked-prefill-size", "-1"],
)
assert res["completed"] == 10
if __name__ == "__main__":
unittest.main()
@@ -1,13 +1,13 @@
import unittest
from sglang.test.ascend.test_ascend_utils import run_mmlu_test
from sglang.test.ci.ci_register import register_npu_ci
from sglang.test.test_utils import CustomTestCase, run_mmlu_test
from sglang.test.test_utils import CustomTestCase
register_npu_ci(
est_time=400,
suite="nightly-1-npu-a3",
nightly=True,
disabled="run failed",
)
@@ -16,7 +16,6 @@ register_npu_ci(
est_time=400,
suite="nightly-4-npu-a3",
nightly=True,
disabled="run failed",
)