[NPU]add nightly-test-npu (#14143)

This commit is contained in:
Cherry_ming
2025-12-05 00:43:35 +08:00
committed by GitHub
parent b01fc161eb
commit 1808df48fe
36 changed files with 1285 additions and 1 deletions
+8 -1
View File
@@ -31,10 +31,15 @@ from transformers import (
)
from sglang.srt.entrypoints.engine import Engine
from sglang.srt.utils import load_image
from sglang.srt.utils import is_npu, load_image
from sglang.srt.utils.hf_transformers_utils import get_tokenizer
from sglang.test.test_utils import DEFAULT_PORT_FOR_SRT_TEST_RUNNER, calculate_rouge_l
if is_npu():
from sglang.srt.hardware_backend.npu.utils import init_npu_backend
init_npu_backend()
DEFAULT_PROMPTS = [
"Apple is red. Banana is Yellow. " * 800 + "Apple is",
"The capital of the United Kingdom is",
@@ -72,6 +77,8 @@ def get_dtype_str(torch_dtype):
return "float16"
if torch_dtype is torch.float32:
return "float32"
if torch_dtype is torch.bfloat16:
return "bfloat16"
else:
raise NotImplementedError()