[CI] migrate ascend-gptq from test/srt to test/registered (#19628)

This commit is contained in:
SoluMilken
2026-03-14 00:28:57 -07:00
committed by GitHub
parent f9e4221b71
commit c95dc88f86
6 changed files with 115 additions and 236 deletions
@@ -0,0 +1,32 @@
import unittest
from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin
from sglang.test.ascend.test_ascend_utils import QWEN3_1_7B_GPTQ_INT8_WEIGHTS_PATH
from sglang.test.ci.ci_register import register_npu_ci
from sglang.test.test_utils import CustomTestCase
register_npu_ci(est_time=400, suite="per-commit-1-npu-a2")
class TestQwen317BGPTQInt8(GSM8KAscendMixin, CustomTestCase):
"""Testcase: Verify that the inference accuracy of the Qwen/Qwen3-1.7B-GPTQ-Int8 model on the GSM8K dataset is no less than 0.65.
[Test Category] Model
[Test Target] Qwen/Qwen3-1.7B-GPTQ-Int8
"""
model = QWEN3_1_7B_GPTQ_INT8_WEIGHTS_PATH
accuracy = 0.65
other_args = [
"--trust-remote-code",
"--mem-fraction-static",
"0.8",
"--attention-backend",
"ascend",
"--quantization",
"gptq",
]
if __name__ == "__main__":
unittest.main()
@@ -2,7 +2,7 @@ import unittest
from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin
from sglang.test.ascend.test_ascend_utils import (
Qwen3_30B_A3B_Instruct_2507_WEIGHTS_PATH,
QWEN3_30B_A3B_INSTRUCT_2507_WEIGHTS_PATH,
)
from sglang.test.ci.ci_register import register_npu_ci
from sglang.test.test_utils import CustomTestCase
@@ -17,7 +17,7 @@ class TestQwen330B(GSM8KAscendMixin, CustomTestCase):
[Test Target] Qwen/Qwen3-30B-A3B-Instruct-2507
"""
model = Qwen3_30B_A3B_Instruct_2507_WEIGHTS_PATH
model = QWEN3_30B_A3B_INSTRUCT_2507_WEIGHTS_PATH
accuracy = 0.90
other_args = [
"--trust-remote-code",
-73
View File
@@ -1,73 +0,0 @@
import unittest
from types import SimpleNamespace
from urllib.parse import urlparse
from sglang.srt.utils import kill_process_tree
from sglang.test.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k
from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
CustomTestCase,
popen_launch_server,
)
TEST_MODEL_MATRIX = {
"Qwen/Qwen3-1.7B-GPTQ-Int8": {
"accuracy": 0.65,
},
}
class TestAscendGPTQInt8(CustomTestCase):
@classmethod
def setUpClass(cls):
cls.models = TEST_MODEL_MATRIX.keys()
cls.base_url = DEFAULT_URL_FOR_TEST
cls.url = urlparse(DEFAULT_URL_FOR_TEST)
cls.common_args = [
"--trust-remote-code",
"--mem-fraction-static",
0.8,
"--attention-backend",
"ascend",
"--quantization",
"gptq",
]
def test_a_gsm8k(self):
for model in self.models:
with self.subTest(model=model):
print(f"##=== Testing accuracy: {model} ===##")
process = popen_launch_server(
model,
self.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
*self.common_args,
],
)
try:
args = SimpleNamespace(
num_shots=5,
data_path=None,
num_questions=1319,
max_new_tokens=512,
parallel=128,
host=f"http://{self.url.hostname}",
port=int(self.url.port),
)
metrics = run_eval_few_shot_gsm8k(args)
self.assertGreaterEqual(
metrics["accuracy"],
TEST_MODEL_MATRIX[model]["accuracy"],
)
finally:
kill_process_tree(process.pid)
if __name__ == "__main__":
unittest.main()
-1
View File
@@ -85,7 +85,6 @@ suite_ascend = {
"per-commit-1-npu-a2": [
TestFile("ascend/test_ascend_autoround_dense.py", 400),
TestFile("ascend/test_ascend_autoround_moe.py", 400),
TestFile("ascend/test_ascend_gptq.py", 400),
TestFile("ascend/test_ascend_gptq_moe.py", 400),
TestFile("ascend/test_ascend_graph_tp1_bf16.py", 400),
TestFile("ascend/test_ascend_piecewise_graph_prefill.py", 400),