Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import requests

from sglang.srt.utils import kill_process_tree
from sglang.test.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH
from sglang.test.ascend.test_ascend_utils import (
LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH,
QWEN3_4B_GGUF_Q4_K_M_WEIGHTS_PATH,
)
from sglang.test.ci.ci_register import register_npu_ci
from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
Expand Down Expand Up @@ -279,5 +282,52 @@ def test_model_skip_tokenizer_request(self):
self.assertIn("output_ids", response.text)


class TestNpuLoadFormatGguf(CustomTestCase):
"""Testcase: verify --load-format=gguf explicitly loads GGUF model and inference succeeds

[Test Category] Parameter
[Test Target] --load-format=gguf
"""

@classmethod
def setUpClass(cls):
cls.model = QWEN3_4B_GGUF_Q4_K_M_WEIGHTS_PATH
cls.base_url = DEFAULT_URL_FOR_TEST
other_args = [
"--trust-remote-code",
"--mem-fraction-static",
"0.8",
"--attention-backend",
"ascend",
"--disable-cuda-graph",
"--load-format",
"gguf",
]
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_load_format_gguf(self):
response = requests.post(
f"{DEFAULT_URL_FOR_TEST}/generate",
json={
"text": "The capital of France is",
"sampling_params": {
"temperature": 0,
"max_new_tokens": 32,
},
},
)
self.assertEqual(response.status_code, 200)
self.assertIn("Paris", response.text)


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,6 @@ def test_msprobe_dump_config_eager_mode(self):
self.assertEqual(response.status_code, 200)
self.assertIn("Paris", response.text)

self.err_log_file.seek(0)
err_log = self.err_log_file.read()
self.assertIn(
"When msProbe is enabled",
err_log,
"Expected stderr to contain 'When msProbe is enabled', proving "
"--msprobe-dump-config was parsed and cuda graph + warmup were disabled",
)
self.assertNotIn(
"Please install msprobe",
err_log,
"Expected stderr NOT to contain 'Please install msprobe', proving "
"mindstudio-probe is installed and PrecisionDebugger was created",
)

# msprobe writes dump.json into per-step subdirectories
# (e.g. step31/dump.json), not at the root of the dump dir.
dump_files = []
Expand Down
Loading
Loading