migrate NPU PR/nightly test cases to a3-560T (#33346)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: sglang-npu-bot <sglangnpu@163.com>
This commit is contained in:
Sugar920
2026-08-05 01:17:58 +08:00
committed by GitHub
co-authored by Claude sglang-npu-bot
parent 95d0e57e83
commit e76d0acdc9
33 changed files with 502 additions and 487 deletions
@@ -66,6 +66,14 @@ class GSM8KAscendMixin(ABC):
kill_process_tree(cls.process.pid)
def test_gsm8k(self):
from sglang.test.ascend.npu_eval_accuracy_kit import (
_is_pr_pipeline,
run_npu_pr_smoke,
)
if _is_pr_pipeline:
run_npu_pr_smoke(self.base_url)
return
accuracy_threshold = getattr(self, "accuracy", 0.00)
output_throughput_threshold = getattr(self, "output_throughput", 0.00)
@@ -16,16 +16,38 @@ Usage::
gsm8k_accuracy_thres = 0.6
"""
import os
import requests
from sglang.test.kits.eval_accuracy_kit import GSM8KMixin
_NPU_ACCURACY_TOLERANCE = 0.99
_NPU_MAX_ACCURACY_ATTEMPTS = 3
_is_pr_pipeline = os.environ.get("GITHUB_EVENT_NAME") == "pull_request"
def run_npu_pr_smoke(base_url):
"""Send a single inference request for PR pipeline smoke test."""
response = requests.post(
f"{base_url}/generate",
json={
"text": "The capital of France is",
"sampling_params": {"temperature": 0, "max_new_tokens": 32},
},
)
assert response.status_code == 200
assert "Paris" in response.text
class NPUGSM8KMixin(GSM8KMixin):
"""NPU GSM8K accuracy mixin — 1% tolerance + up to 3 retries."""
def test_gsm8k(self):
if _is_pr_pipeline:
run_npu_pr_smoke(self.base_url)
return
threshold = self.gsm8k_score_threshold
if threshold != threshold: # NaN → legacy alias
threshold = self.gsm8k_accuracy_thres