diff --git a/.github/workflows/nightly-test-npu.yml b/.github/workflows/nightly-test-npu.yml index 452dfcade..6705b0794 100644 --- a/.github/workflows/nightly-test-npu.yml +++ b/.github/workflows/nightly-test-npu.yml @@ -165,7 +165,7 @@ jobs: STREAMS_PER_DEVICE: 32 run: | hf download lmms-lab/MMMU --repo-type dataset - pip install sentence_transformers torchaudio==2.8.0 torch_npu==2.8.0 + pip install sentence_transformers pip install protobuf==6.31.1 zss pre-commit wandb>=0.16.0 tenacity==8.3.0 loguru openpyxl latex2sympy2 zstandard transformers-stream-generator tqdm-multiprocess pycocoevalcap pip install yt-dlp sentencepiece==0.1.99 nltk av ftfy sqlitedict==2.1.0 sacrebleu>=1.5.0 pytablewriter peft==0.2.0 black==24.1.0 isort==5.13.2 peft>=0.2.0 accelerate>=0.29.1 pip install jsonlines httpx==0.25.0 evaluate>=0.4.0 datasets==2.16.1 numexpr xgrammar==0.1.25 numpy==1.26.4 dotenv @@ -178,11 +178,130 @@ jobs: cd test python3 run_suite.py --hw npu --suite nightly-4-npu-a3 --nightly --continue-on-error --timeout-per-file 3600 --auto-partition-id ${{ matrix.part }} --auto-partition-size 1 + nightly-8-npu-a3: + if: ${{ (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') }} + runs-on: linux-aarch64-a3-8 + strategy: + fail-fast: false + matrix: + part: [0] + container: + image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.5.0-a3-ubuntu22.04-py3.11 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + + - name: Install dependencies + run: | + # speed up by using infra cache services + CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local" + sed -Ei "s@(ports|archive).ubuntu.com@${CACHING_URL}:8081@g" /etc/apt/sources.list + pip config set global.index-url http://${CACHING_URL}/pypi/simple + pip config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple" + pip config set global.trusted-host "${CACHING_URL} pypi.tuna.tsinghua.edu.cn" + + bash scripts/ci/npu/npu_ci_install_dependency.sh a3 + # copy required file from our daily cache + cp ~/.cache/modelscope/hub/datasets/otavia/ShareGPT_Vicuna_unfiltered/ShareGPT_V3_unfiltered_cleaned_split.json /tmp + # copy download through proxy + curl -o /tmp/test.jsonl -L https://gh-proxy.test.osinfra.cn/https://raw.githubusercontent.com/openai/grade-school-math/master/grade_school_math/data/test.jsonl + + - name: Print Log Information + run: | + bash scripts/ci/npu/npu_log_print.sh + + - name: Run test + timeout-minutes: 240 + env: + SGLANG_USE_MODELSCOPE: true + SGLANG_IS_IN_CI: true + HF_ENDPOINT: https://hf-mirror.com + TORCH_EXTENSIONS_DIR: /tmp/torch_extensions + PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True" + STREAMS_PER_DEVICE: 32 + run: | + hf download lmms-lab/MMMU --repo-type dataset + pip install sentence_transformers + pip install protobuf==6.31.1 zss pre-commit wandb>=0.16.0 tenacity==8.3.0 loguru openpyxl latex2sympy2 zstandard transformers-stream-generator tqdm-multiprocess pycocoevalcap + pip install yt-dlp sentencepiece==0.1.99 nltk av ftfy sqlitedict==2.1.0 sacrebleu>=1.5.0 pytablewriter peft==0.2.0 black==24.1.0 isort==5.13.2 peft>=0.2.0 accelerate>=0.29.1 + pip install jsonlines httpx==0.25.0 evaluate>=0.4.0 datasets==2.16.1 numexpr xgrammar==0.1.25 numpy==1.26.4 dotenv + git clone --branch v0.3.3 --depth 1 https://github.com/EvolvingLMMs-Lab/lmms-eval.git + cd ./lmms-eval + nohup pip install . > lmmslog.txt 2>&1 & + sleep 120 + export PYTHONPATH=$PYTHONPATH:$(pwd) + cd ../ + cd test + python3 run_suite.py --hw npu --suite nightly-8-npu-a3 --nightly --continue-on-error --timeout-per-file 3600 --auto-partition-id ${{ matrix.part }} --auto-partition-size 1 + + nightly-16-npu-a3: + if: ${{ (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') }} + runs-on: linux-aarch64-a3-16 + strategy: + fail-fast: false + matrix: + part: [0] + container: + image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.5.0-a3-ubuntu22.04-py3.11 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + + - name: Install dependencies + run: | + # speed up by using infra cache services + CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local" + sed -Ei "s@(ports|archive).ubuntu.com@${CACHING_URL}:8081@g" /etc/apt/sources.list + pip config set global.index-url http://${CACHING_URL}/pypi/simple + pip config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple" + pip config set global.trusted-host "${CACHING_URL} pypi.tuna.tsinghua.edu.cn" + + bash scripts/ci/npu/npu_ci_install_dependency.sh a3 + # copy required file from our daily cache + cp ~/.cache/modelscope/hub/datasets/otavia/ShareGPT_Vicuna_unfiltered/ShareGPT_V3_unfiltered_cleaned_split.json /tmp + # copy download through proxy + curl -o /tmp/test.jsonl -L https://gh-proxy.test.osinfra.cn/https://raw.githubusercontent.com/openai/grade-school-math/master/grade_school_math/data/test.jsonl + + - name: Print Log Information + run: | + bash scripts/ci/npu/npu_log_print.sh + + - name: Run test + timeout-minutes: 240 + env: + SGLANG_USE_MODELSCOPE: true + SGLANG_IS_IN_CI: true + HF_ENDPOINT: https://hf-mirror.com + TORCH_EXTENSIONS_DIR: /tmp/torch_extensions + PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True" + STREAMS_PER_DEVICE: 32 + run: | + hf download lmms-lab/MMMU --repo-type dataset + pip install sentence_transformers + pip install protobuf==6.31.1 zss pre-commit wandb>=0.16.0 tenacity==8.3.0 loguru openpyxl latex2sympy2 zstandard transformers-stream-generator tqdm-multiprocess pycocoevalcap + pip install yt-dlp sentencepiece==0.1.99 nltk av ftfy sqlitedict==2.1.0 sacrebleu>=1.5.0 pytablewriter peft==0.2.0 black==24.1.0 isort==5.13.2 peft>=0.2.0 accelerate>=0.29.1 + pip install jsonlines httpx==0.25.0 evaluate>=0.4.0 datasets==2.16.1 numexpr xgrammar==0.1.25 numpy==1.26.4 dotenv + git clone --branch v0.3.3 --depth 1 https://github.com/EvolvingLMMs-Lab/lmms-eval.git + cd ./lmms-eval + nohup pip install . > lmmslog.txt 2>&1 & + sleep 120 + export PYTHONPATH=$PYTHONPATH:$(pwd) + cd ../ + cd test + python3 run_suite.py --hw npu --suite nightly-16-npu-a3 --nightly --continue-on-error --timeout-per-file 3600 --auto-partition-id ${{ matrix.part }} --auto-partition-size 1 + check-all-jobs: if: github.repository == 'sgl-project/sglang' && always() needs: - nightly-1-npu-a3 + - nightly-2-npu-a3 - nightly-4-npu-a3 + - nightly-8-npu-a3 + - nightly-16-npu-a3 runs-on: ubuntu-latest container: image: docker.m.daocloud.io/ubuntu:22.04 diff --git a/python/sglang/test/ascend/gsm8k_ascend_mixin.py b/python/sglang/test/ascend/gsm8k_ascend_mixin.py index 5257d8191..f2053635d 100644 --- a/python/sglang/test/ascend/gsm8k_ascend_mixin.py +++ b/python/sglang/test/ascend/gsm8k_ascend_mixin.py @@ -14,6 +14,7 @@ from sglang.test.test_utils import ( class GSM8KAscendMixin(ABC): model = "" accuracy = 0.00 + timeout_for_server_launch = DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH other_args = [ "--trust-remote-code", "--mem-fraction-static", @@ -42,7 +43,7 @@ class GSM8KAscendMixin(ABC): cls.process = popen_launch_server( cls.model, cls.base_url, - timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + timeout=cls.timeout_for_server_launch, other_args=cls.other_args, env=env, ) @@ -62,7 +63,7 @@ class GSM8KAscendMixin(ABC): port=int(self.base_url.split(":")[-1]), ) metrics = run_eval(args) - self.assertGreater( + self.assertGreaterEqual( metrics["accuracy"], self.accuracy, f'Accuracy of {self.model} is {str(metrics["accuracy"])}, is lower than {self.accuracy}', diff --git a/python/sglang/test/ascend/test_ascend_utils.py b/python/sglang/test/ascend/test_ascend_utils.py new file mode 100644 index 000000000..183f96760 --- /dev/null +++ b/python/sglang/test/ascend/test_ascend_utils.py @@ -0,0 +1,198 @@ +"""Common utilities for testing and benchmarking on NPU""" + +import os + +# Model weights storage directory +MODEL_WEIGHTS_DIR = "/root/.cache/modelscope/hub/models/" +HF_MODEL_WEIGHTS_DIR = "/root/.cache/huggingface/hub/" + +# LLM model weights path +LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "AI-ModelScope/Llama-3.1-8B-Instruct" +) +LLAMA_3_2_1B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "LLM-Research/Llama-3.2-1B") +LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "LLM-Research/Llama-3.2-1B-Instruct" +) +LLAMA_3_2_1B_INSTRUCT_TOOL_CALLING_LORA_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "codelion/Llama-3.2-1B-Instruct-tool-calling-lora" +) +META_LLAMA_3_1_8B_INSTRUCT = os.path.join( + MODEL_WEIGHTS_DIR, "LLM-Research/Meta-Llama-3.1-8B-Instruct" +) + +DEEPSEEK_R1_0528_W8A8_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "vllm-ascend/DeepSeek-R1-0528-W8A8" +) +DEEPSEEK_V2_LITE_W8A8_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "vllm-ascend/DeepSeek-V2-Lite-W8A8" +) + +QWEN2_5_7B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen2.5-7B-Instruct" +) + +AFM_4_5B_BASE_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "arcee-ai/AFM-4.5B-Base") +BAICHUAN2_13B_CHAT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "baichuan-inc/Baichuan2-13B-Chat" +) +C4AI_COMMAND_R_V01_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "CohereForAI/c4ai-command-r-v01" +) +CHATGLM2_6B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "ZhipuAI/chatglm2-6b") +DBRX_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "AI-ModelScope/dbrx-instruct" +) +DEEPSEEK_V3_2_EXP_W8A8_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "DeepSeek-V3.2-Exp-W8A8" +) +ERNIE_4_5_21B_A3B_PT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "baidu/ERNIE-4.5-21B-A3B-PT" +) +EXAONE_3_5_7_8B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct" +) +GEMMA_3_4B_IT_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "google/gemma-3-4b-it") +GLM_4_9B_CHAT_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "ZhipuAI/glm-4-9b-chat") +GRANITE_3_0_3B_A800M_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "ibm-granite/granite-3.0-3b-a800m-instruct" +) +GRANITE_3_1_8B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "ibm-granite/granite-3.1-8b-instruct" +) +GROK_2_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "huihui-ai/grok-2") +INTERNLM2_7B_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Shanghai_AI_Laboratory/internlm2-7b" +) +KIMI_K2_THINKING_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "Kimi/Kimi-K2-Thinking") +LING_LITE_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "inclusionAI/Ling-lite") +LLAMA_4_SCOUT_17B_16E_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "meta-llama/Llama-4-Scout-17B-16E-Instruct" +) +LLAMA_2_7B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "LLM-Research/Llama-2-7B") +MIMO_7B_RL_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "XiaomiMiMo/MiMo-7B-RL") +MINICPM3_4B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "OpenBMB/MiniCPM3-4B") +MISTRAL_7B_INSTRUCT_V0_2_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "mistralai/Mistral-7B-Instruct-v0.2" +) +OLMOE_1B_7B_0924_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "allenai/OLMoE-1B-7B-0924" +) +PERSIMMON_8B_CHAT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Howeee/persimmon-8b-chat" +) +PHI_4_MULTIMODAL_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "microsoft/Phi-4-multimodal-instruct" +) +QWEN3_0_6B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "Qwen/Qwen3-0.6B") +Qwen3_30B_A3B_Instruct_2507_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-30B-A3B-Instruct-2507" +) +QWEN3_32B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "Qwen/Qwen3-32B") +QWEN3_235B_A22B_W8A8_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "vllm-ascend/Qwen3-235B-A22B-W8A8" +) +QWEN3_CODER_480B_A35B_INSTRUCT_W8A8_QUAROT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen3-Coder-480B-A35B-Instruct-w8a8-QuaRot" +) +QWEN3_NEXT_80B_A3B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-Next-80B-A3B-Instruct" +) +QWQ_32B_W8A8_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "vllm-ascend/QWQ-32B-W8A8") +SMOLLM_1_7B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "HuggingFaceTB/SmolLM-1.7B") +STABLELM_2_1_6B_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "stabilityai/stablelm-2-1_6b" +) +XVERSE_MOE_A36B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "xverse/XVERSE-MoE-A36B") +EAGLE3_LLAMA3_1_INSTRUCT_8B_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "sglang-EAGLE3-LLaMA3.1-Instruct-8B" +) +DEEPSEEK_R1_0528_W4A8_PER_CHANNEL_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "DeepSeek-R1-0528-w4a8-per-channel" +) + +# VLM model weights path +DEEPSEEK_VL2_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "deepseek-ai/deepseek-vl2") +GLM_4_5V_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "ZhipuAI/GLM-4.5V") +JANUS_PRO_1B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "deepseek-ai/Janus-Pro-1B") +JANUS_PRO_7B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "deepseek-ai/Janus-Pro-7B") +KIMI_VL_A3B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Kimi/Kimi-VL-A3B-Instruct" +) +LLAMA_3_2_11B_VISION_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "LLM-Research/Llama-3.2-11B-Vision-Instruct" +) +LLAVA_NEXT_72B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "lmms-lab/llava-next-72b") +LLAVA_ONEVISION_QWEN2_7B_OV_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "lmms-lab/llava-onevision-qwen2-7b-ov" +) +LLAVA_V1_6_34B_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "AI-ModelScope/llava-v1.6-34b" +) +MIMO_VL_7B_RL_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "XiaomiMiMo/MiMo-VL-7B-RL") +MINICPM_O_2_6_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "openbmb/MiniCPM-o-2_6") +MINICPM_V_2_6_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "openbmb/MiniCPM-V-2_6") +MISTRAL_SMALL_3_1_24B_INSTRUCT_2503_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "mistralai/Mistral-Small-3.1-24B-Instruct-2503" +) +QWEN2_5_VL_3B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen2.5-VL-3B-Instruct" +) +QWEN2_5_VL_72B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen2.5-VL-72B-Instruct" +) +QWEN3_VL_4B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-VL-4B-Instruct" +) +QWEN3_VL_8B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-VL-8B-Instruct" +) +QWEN3_VL_30B_A3B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-VL-30B-A3B-Instruct" +) +QWEN3_VL_235B_A22B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-VL-235B-A22B-Instruct" +) + +QWEN3_30B_A3B_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "Qwen/Qwen3-30B-A3B") + +# Embedding model weights path +BGE_LARGE_EN_V1_5_WEIGHTS_PATH = os.path.join(MODEL_WEIGHTS_DIR, "bge-large-en-v1.5") +CLIP_VIT_LARGE_PATCH14_336_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "AI-ModelScope/clip-vit-large-patch14-336" +) +E5_MISTRAL_7B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "intfloat/e5-mistral-7b-instruct" +) +GME_QWEN2_VL_2B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Alibaba-NLP/gme-Qwen2-VL-2B-Instruct" +) +GTE_QWEN2_1_5B_INSTRUCT_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "iic/gte_Qwen2-1.5B-instruct" +) +QWEN3_EMBEDDING_8B_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen3-Embedding-8B" +) + +# Rerank model weights path +BGE_RERANKER_V2_M3_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "BAAI/bge-reranker-v2-m3" +) + +# Reward model weights path +SKYWORK_REWARD_GEMMA_2_27B_V0_2_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "AI-ModelScope/Skywork-Reward-Gemma-2-27B-v0.2" +) +INTERNLM2_7B_REWARD_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Shanghai_AI_Laboratory/internlm2-7b-reward" +) +SKYWORK_REWARD_LLAMA_3_1_8B_V0_2_WEIGHTS_PATH = os.path.join( + HF_MODEL_WEIGHTS_DIR, + "models--Skywork--Skywork-Reward-Llama-3.1-8B-v0.2/snapshots/d4117fbfd81b72f41b96341238baa1e3e90a4ce1", +) +QWEN2_5_1_5B_APEACH_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Howeee/Qwen2.5-1.5B-apeach" +) +QWEN2_5_MATH_RM_72B_WEIGHTS_PATH = os.path.join( + MODEL_WEIGHTS_DIR, "Qwen/Qwen2.5-Math-RM-72B" +) diff --git a/python/sglang/test/ascend/vlm_utils.py b/python/sglang/test/ascend/vlm_utils.py index 324030a34..5e723447f 100644 --- a/python/sglang/test/ascend/vlm_utils.py +++ b/python/sglang/test/ascend/vlm_utils.py @@ -30,13 +30,13 @@ class TestVLMModels(CustomTestCase): "--tp-size", 4, ] + timeout_for_server_launch = DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH @classmethod def setUpClass(cls): # Removed argument parsing from here cls.base_url = DEFAULT_URL_FOR_TEST cls.api_key = "sk-123456" - cls.time_out = DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH # Set OpenAI API key and base URL environment variables. Needed for lmm-evals to work. os.environ["OPENAI_API_KEY"] = cls.api_key @@ -134,7 +134,7 @@ class TestVLMModels(CustomTestCase): process = popen_launch_server( self.model, base_url=self.base_url, - timeout=self.time_out, + timeout=self.timeout_for_server_launch, api_key=self.api_key, other_args=self.other_args, env=process_env, diff --git a/test/registered/ascend/basic_function/interface/test_ascend_enable_thinking.py b/test/registered/ascend/basic_function/interface/test_ascend_enable_thinking.py new file mode 100644 index 000000000..7ff93bd30 --- /dev/null +++ b/test/registered/ascend/basic_function/interface/test_ascend_enable_thinking.py @@ -0,0 +1,197 @@ +import json +import unittest + +import requests + +from sglang.srt.utils import kill_process_tree +from sglang.test.ascend.test_ascend_utils import QWEN3_30B_A3B_WEIGHTS_PATH +from sglang.test.ci.ci_register import register_npu_ci +from sglang.test.test_utils import ( + DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + DEFAULT_URL_FOR_TEST, + CustomTestCase, + popen_launch_server, +) + +register_npu_ci(est_time=400, suite="nightly-2-npu-a3", nightly=True) + + +class TestEnableThinking(CustomTestCase): + """Testcase: Testing with the 'enable_thinking' feature enabled/disabled, + both streaming and non-streaming input requests successful + + [Test Category] Interface + [Test Target] /v1/chat/completions + """ + + @classmethod + def setUpClass(cls): + cls.model = QWEN3_30B_A3B_WEIGHTS_PATH + cls.base_url = DEFAULT_URL_FOR_TEST + cls.api_key = "sk-1234" + cls.other_args = [ + "--reasoning-parser", + "qwen3", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--mem-fraction-static", + 0.95, + "--tp", + 2, + ] + cls.process = popen_launch_server( + cls.model, + cls.base_url, + timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + api_key=cls.api_key, + other_args=cls.other_args, + ) + cls.additional_chat_kwargs = {} + + @classmethod + def tearDownClass(cls): + kill_process_tree(cls.process.pid) + + def test_chat_completion_with_reasoning(self): + # Test non-streaming with "enable_thinking": True, reasoning_content should not be empty + client = requests.post( + f"{self.base_url}/v1/chat/completions", + headers={"Authorization": f"Bearer {self.api_key}"}, + json={ + "model": self.model, + "messages": [{"role": "user", "content": "Hello"}], + "temperature": 0, + "separate_reasoning": True, + "chat_template_kwargs": {"enable_thinking": True}, + **self.additional_chat_kwargs, + }, + ) + + self.assertEqual(client.status_code, 200, f"Failed with: {client.text}") + data = client.json() + + self.assertIn("choices", data) + self.assertTrue(len(data["choices"]) > 0) + self.assertIn("message", data["choices"][0]) + self.assertIn("reasoning_content", data["choices"][0]["message"]) + self.assertIsNotNone(data["choices"][0]["message"]["reasoning_content"]) + + def test_chat_completion_without_reasoning(self): + # Test non-streaming with "enable_thinking": False, reasoning_content should be empty + client = requests.post( + f"{self.base_url}/v1/chat/completions", + headers={"Authorization": f"Bearer {self.api_key}"}, + json={ + "model": self.model, + "messages": [{"role": "user", "content": "Hello"}], + "temperature": 0, + "separate_reasoning": True, + "chat_template_kwargs": {"enable_thinking": False}, + **self.additional_chat_kwargs, + }, + ) + + self.assertEqual(client.status_code, 200, f"Failed with: {client.text}") + data = client.json() + + self.assertIn("choices", data) + self.assertTrue(len(data["choices"]) > 0) + self.assertIn("message", data["choices"][0]) + + if "reasoning_content" in data["choices"][0]["message"]: + self.assertIsNone(data["choices"][0]["message"]["reasoning_content"]) + + def test_stream_chat_completion_with_reasoning(self): + # Test streaming with "enable_thinking": True, reasoning_content should not be empty + response = requests.post( + f"{self.base_url}/v1/chat/completions", + headers={"Authorization": f"Bearer {self.api_key}"}, + json={ + "model": self.model, + "messages": [{"role": "user", "content": "Hello"}], + "temperature": 0, + "separate_reasoning": True, + "stream": True, + "chat_template_kwargs": {"enable_thinking": True}, + **self.additional_chat_kwargs, + }, + stream=True, + ) + + self.assertEqual(response.status_code, 200, f"Failed with: {response.text}") + + has_reasoning = False + has_content = False + + print("\n=== Stream With Reasoning ===") + for line in response.iter_lines(): + if line: + line = line.decode("utf-8") + if line.startswith("data:") and not line.startswith("data: [DONE]"): + data = json.loads(line[6:]) + if "choices" in data and len(data["choices"]) > 0: + delta = data["choices"][0].get("delta", {}) + + if "reasoning_content" in delta and delta["reasoning_content"]: + has_reasoning = True + + if "content" in delta and delta["content"]: + has_content = True + + self.assertTrue( + has_reasoning, + "The reasoning content is not included in the stream response", + ) + self.assertTrue( + has_content, "The stream response does not contain normal content" + ) + + def test_stream_chat_completion_without_reasoning(self): + # Test streaming with "enable_thinking": False, reasoning_content should be empty + response = requests.post( + f"{self.base_url}/v1/chat/completions", + headers={"Authorization": f"Bearer {self.api_key}"}, + json={ + "model": self.model, + "messages": [{"role": "user", "content": "Hello"}], + "temperature": 0, + "separate_reasoning": True, + "stream": True, + "chat_template_kwargs": {"enable_thinking": False}, + **self.additional_chat_kwargs, + }, + stream=True, + ) + + self.assertEqual(response.status_code, 200, f"Failed with: {response.text}") + + has_reasoning = False + has_content = False + + print("\n=== Stream Without Reasoning ===") + for line in response.iter_lines(): + if line: + line = line.decode("utf-8") + if line.startswith("data:") and not line.startswith("data: [DONE]"): + data = json.loads(line[6:]) + if "choices" in data and len(data["choices"]) > 0: + delta = data["choices"][0].get("delta", {}) + + if "reasoning_content" in delta and delta["reasoning_content"]: + has_reasoning = True + + if "content" in delta and delta["content"]: + has_content = True + + self.assertFalse( + has_reasoning, + "The reasoning content should not be included in the stream response", + ) + self.assertTrue( + has_content, "The stream response does not contain normal content" + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/basic_function/parameter/test_ascend_log_level.py b/test/registered/ascend/basic_function/parameter/test_ascend_log_level.py new file mode 100644 index 000000000..63e49bcf8 --- /dev/null +++ b/test/registered/ascend/basic_function/parameter/test_ascend_log_level.py @@ -0,0 +1,92 @@ +import os +import unittest + +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.ci.ci_register import register_npu_ci +from sglang.test.test_utils import ( + DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + DEFAULT_URL_FOR_TEST, + CustomTestCase, + popen_launch_server, +) + +register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) + + +class TestLogLevel(CustomTestCase): + """Testcase:Verify set log-level parameter, the printed log level is the same as the configured log level and the inference request is successfully processed. + + [Test Category] Parameter + [Test Target] --log-level + """ + + model = LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH + OUT_LOG_PATH = "./out_log.txt" + ERR_LOG_PATH = "./err_log.txt" + + def _launch_server_and_run_infer(self, other_args): + out_log_file = None + err_log_file = None + process = None + try: + out_log_file = open(self.OUT_LOG_PATH, "w+", encoding="utf-8") + err_log_file = open(self.ERR_LOG_PATH, "w+", encoding="utf-8") + process = popen_launch_server( + self.model, + DEFAULT_URL_FOR_TEST, + timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + other_args=other_args, + return_stdout_stderr=(out_log_file, err_log_file), + ) + health_resp = requests.get(f"{DEFAULT_URL_FOR_TEST}/health_generate") + self.assertEqual(health_resp.status_code, 200) + gen_resp = 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(gen_resp.status_code, 200) + self.assertIn("Paris", gen_resp.text) + out_log_file.seek(0) + return out_log_file.read() + finally: + kill_process_tree(process.pid) + out_log_file.close() + err_log_file.close() + os.remove(self.OUT_LOG_PATH) + os.remove(self.ERR_LOG_PATH) + + def test_log_level(self): + # Verify set --log-level=warning and not set --log-level-http, logs print only warning level (no HTTP info) + other_args = [ + "--log-level", + "warning", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + ] + log_content = self._launch_server_and_run_infer(other_args) + self.assertNotIn("POST /generate HTTP/1.1", log_content) + + def test_log_http_level(self): + # Verify set --log-level=warning and set --log-level-http=info, log level print http info + other_args = [ + "--log-level", + "warning", + "--log-level-http", + "info", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + ] + log_content = self._launch_server_and_run_infer(other_args) + self.assertIn("POST /generate HTTP/1.1", log_content) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/basic_function/parameter/test_ascend_no_chunked_prefill.py b/test/registered/ascend/basic_function/parameter/test_ascend_no_chunked_prefill.py new file mode 100644 index 000000000..1612ec6a5 --- /dev/null +++ b/test/registered/ascend/basic_function/parameter/test_ascend_no_chunked_prefill.py @@ -0,0 +1,39 @@ +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() diff --git a/test/registered/ascend/basic_function/parameter/test_ascend_no_overlap_scheduler.py b/test/registered/ascend/basic_function/parameter/test_ascend_no_overlap_scheduler.py new file mode 100644 index 000000000..376c4b552 --- /dev/null +++ b/test/registered/ascend/basic_function/parameter/test_ascend_no_overlap_scheduler.py @@ -0,0 +1,48 @@ +import unittest + +from sglang.test.ci.ci_register import register_npu_ci +from sglang.test.test_utils import CustomTestCase, run_mmlu_test + +register_npu_ci( + est_time=400, + suite="nightly-1-npu-a3", + nightly=True, + disabled="run failed", +) + + +class TestOverlapSchedule(CustomTestCase): + """Testcase: Verify that the model can successfully process inference requests and achieve an accuracy of ≥ 0.65 when the overlap scheduler is disabled, + covering all combination scenarios of radix cache (enabled/disabled) and chunked prefill (enabled/disabled). + + [Test Category] Parameter + [Test Target] --disable-radix-cache;--disable-overlap + """ + + def test_no_radix_attention_chunked_prefill(self): + run_mmlu_test( + disable_radix_cache=True, + chunked_prefill_size=128, + disable_overlap=True, + ) + + def test_no_radix_attention_no_chunked_prefill(self): + run_mmlu_test( + disable_radix_cache=True, chunked_prefill_size=-1, disable_overlap=True + ) + + def test_radix_attention_chunked_prefill(self): + run_mmlu_test( + disable_radix_cache=False, + chunked_prefill_size=128, + disable_overlap=True, + ) + + def test_radix_attention_no_chunked_prefill(self): + run_mmlu_test( + disable_radix_cache=False, chunked_prefill_size=-1, disable_overlap=True + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/basic_function/parameter/test_ascend_original_logprobs.py b/test/registered/ascend/basic_function/parameter/test_ascend_original_logprobs.py new file mode 100644 index 000000000..e60b88909 --- /dev/null +++ b/test/registered/ascend/basic_function/parameter/test_ascend_original_logprobs.py @@ -0,0 +1,208 @@ +"""Test original log probability alignment between SGLang and Hugging Face. + +This test suite verifies the correctness of the `origin_logprobs` output (temperature=1) +and the `logprobs` output (temperature=0.5) in SGLang by comparing it against +raw logit-based probabilities computed directly from a reference Hugging Face model. + +The test covers the following scenarios: +- Next-token prediction: Verifies that the log probability of the next token from + SGLang matches the Hugging Face model. +- Top-k logprobs: Ensures that the top-k original logprobs returned by SGLang are + consistent with Hugging Face outputs. +- Specified token IDs: Confirms that the original logprobs for specific token IDs + match the values computed from Hugging Face logits. +""" + +import os +import random +import unittest + +import torch +import torch.nn.functional as F +from transformers import AutoModelForCausalLM, AutoTokenizer + +import sglang as sgl +from sglang.test.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH +from sglang.test.ci.ci_register import register_npu_ci + +# ------------------------- Configurable via env ------------------------- # +MODEL_ID = LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH + +PROMPTS = [ + "Hello, my name is", + "The future of AI is", + "The president of the United States is", + "The capital of France is ", +] +TOP_LOGPROBS_NUM = 50 +NUM_RANDOM_TOKEN_IDS = 10 +RTOL = 0.20 +ATOL = 0.00 +# ------------------------------------------------ + +torch.manual_seed(1234) +if torch.cuda.is_available(): + torch.cuda.manual_seed_all(1234) + torch.backends.cuda.matmul.allow_tf32 = False + torch.backends.cudnn.allow_tf32 = False + +register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) + + +class TestOriginalLogprob(unittest.TestCase): + """Testcase: Verify the behavior and log probability alignment of SGLang under two configurations of the environment variable `SGLANG_RETURN_ORIGINAL_LOGPROB` (True/False), + by comparing SGLang's output with reference values from Hugging Face. + + [Test Category] Parameter + [Test Target] SGLANG_RETURN_ORIGINAL_LOGPROB + """ + + def setUp(self): + # ----- HF side (float32 weights) ----- + self.tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, padding_side="right") + self.hf_model = AutoModelForCausalLM.from_pretrained( + MODEL_ID, torch_dtype=torch.float32, device_map="auto" + ) + + # Shared sampling parameters + self.sampling_params = { + "temperature": 0.5, # SGLang uses 0.5, but original logprobs are used 1.0 + "top_p": 1.0, + "top_k": 10, + "max_new_tokens": 1, + } + + # --------------------------------------------------------------------- + # Helper: compare one SGLang block (token_logprobs / top_logprobs / ids_logprobs) + # against a reference HF log‑prob vector. + # --------------------------------------------------------------------- + def assert_logprobs_block_equal( + self, + hf_log_probs: torch.Tensor, # [V] + token_log_probs: list, + top_log_probs: list, + ids_log_probs: list, + random_token_ids: list, + tag: str = "", + ): + vals, idxs, _ = zip(*token_log_probs) + sgl_vals = torch.tensor(vals, device=self.hf_model.device, dtype=torch.float32) + sgl_idxs = torch.tensor(idxs, device=self.hf_model.device, dtype=torch.long) + hf_vals = hf_log_probs[sgl_idxs] + + self.assertTrue( + torch.allclose(hf_vals, sgl_vals, rtol=RTOL, atol=ATOL), + msg=f"[{tag}] token‑level mismatch at indices {sgl_idxs.tolist()}", + ) + + hf_topk, _ = torch.topk(hf_log_probs, k=TOP_LOGPROBS_NUM, dim=-1) + + sgl_topk = torch.tensor( + [float(t[0]) for t in top_log_probs[0] if t and t[0] is not None][ + :TOP_LOGPROBS_NUM + ], + dtype=torch.float32, + device=self.hf_model.device, + ) + + k = min(hf_topk.numel(), sgl_topk.numel()) + self.assertTrue( + torch.allclose(hf_topk[:k], sgl_topk[:k], rtol=RTOL, atol=ATOL), + msg=f"[{tag}] top‑k mismatch", + ) + + indices = torch.tensor( + random_token_ids, dtype=torch.long, device=hf_log_probs.device + ) + + hf_token_ids = hf_log_probs[indices] + + sgl_token_ids = torch.tensor( + [v for v, _, _ in ids_log_probs[0]], + device=self.hf_model.device, + dtype=torch.float32, + ) + self.assertTrue( + torch.allclose(hf_token_ids, sgl_token_ids, rtol=RTOL, atol=ATOL), + msg=f"[{tag}] token‑IDs mismatch", + ) + + # Optional: print max abs diff for quick diagnostics + max_diff = torch.max(torch.abs(hf_vals - sgl_vals)).item() + print(f"[{tag}] max|diff| token‑level = {max_diff:.4f}") + + def test_logprob_match(self): + vocab_size = self.tokenizer.vocab_size + + for env_val in ["True", "False"]: + with self.subTest(return_original_logprob=env_val): + os.environ["SGLANG_RETURN_ORIGINAL_LOGPROB"] = env_val + + # ----- SGLang side ----- + sgl_engine = sgl.Engine( + model_path=MODEL_ID, + skip_tokenizer_init=True, + trust_remote_code=True, + mem_fraction_static=0.60, + attention_backend="ascend", + disable_cuda_graph=True, + ) + + for prompt in PROMPTS: + random_token_ids = sorted( + random.sample(range(vocab_size), NUM_RANDOM_TOKEN_IDS) + ) + + enc = self.tokenizer(prompt, return_tensors="pt") + input_ids = enc["input_ids"].to(self.hf_model.device) + attn_mask = enc["attention_mask"].to(self.hf_model.device) + + with torch.inference_mode(): + hf_out = self.hf_model( + input_ids=input_ids, + attention_mask=attn_mask, + return_dict=True, + ) + logits = hf_out.logits[:, -1, :] # [1, V] + hf_log_probs = F.log_softmax( + logits.float() / self.sampling_params["temperature"], dim=-1 + )[0] + hf_original_log_probs = F.log_softmax(logits.float(), dim=-1)[0] + + outputs = sgl_engine.generate( + input_ids=input_ids[0].tolist(), + sampling_params=self.sampling_params, + return_logprob=True, + top_logprobs_num=TOP_LOGPROBS_NUM, + token_ids_logprob=random_token_ids, + ) + + if isinstance(outputs, list): + outputs = outputs[0] + meta = outputs["meta_info"] + + # Check original logprobs only if enabled + if env_val.lower() == "true": + self.assert_logprobs_block_equal( + hf_log_probs=hf_original_log_probs, + token_log_probs=meta["output_token_logprobs"], + top_log_probs=meta["output_top_logprobs"], + ids_log_probs=meta["output_token_ids_logprobs"], + random_token_ids=random_token_ids, + tag=f"Original logprobs SGLang vs HF: {prompt} ({env_val})", + ) + else: + # Always check regular logprobs + self.assert_logprobs_block_equal( + hf_log_probs=hf_log_probs, + token_log_probs=meta["output_token_logprobs"], + top_log_probs=meta["output_top_logprobs"], + ids_log_probs=meta["output_token_ids_logprobs"], + random_token_ids=random_token_ids, + tag=f"logprobs SGLang vs HF: {prompt} ({env_val})", + ) + sgl_engine.shutdown() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/basic_function/parameter/test_ascend_warmups.py b/test/registered/ascend/basic_function/parameter/test_ascend_warmups.py new file mode 100644 index 000000000..7b1df16af --- /dev/null +++ b/test/registered/ascend/basic_function/parameter/test_ascend_warmups.py @@ -0,0 +1,92 @@ +import os +import unittest + +import requests + +from sglang.srt.utils import kill_process_tree +from sglang.test.ascend.test_ascend_utils import MINICPM_O_2_6_WEIGHTS_PATH +from sglang.test.ci.ci_register import register_npu_ci +from sglang.test.test_utils import ( + DEFAULT_URL_FOR_TEST, + CustomTestCase, + popen_launch_server, +) + +register_npu_ci( + est_time=400, + suite="nightly-4-npu-a3", + nightly=True, + disabled="run failed", +) + + +class TestAscendWarmups(CustomTestCase): + """Testcase: Test that the warm-up task runs successfully when the --warmups voice_chat parameter is specified upon service startup. + + [Test Category] Parameter + [Test Target] --warmups + """ + + model = MINICPM_O_2_6_WEIGHTS_PATH + base_url = DEFAULT_URL_FOR_TEST + + @classmethod + def setUpClass(cls): + other_args = [ + "--trust-remote-code", + "--warmups", + "voice_chat", + "--tp-size", + "4", + "--mem-fraction-static", + "0.8", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + ] + cls.out_log_file = open("./out_log.txt", "w+", encoding="utf-8") + cls.err_log_file = open("./err_log.txt", "w+", encoding="utf-8") + cls.process = popen_launch_server( + cls.model, + cls.base_url, + timeout=3600, + other_args=other_args, + return_stdout_stderr=(cls.out_log_file, cls.err_log_file), + ) + + @classmethod + def tearDownClass(cls): + kill_process_tree(cls.process.pid) + cls.out_log_file.close() + cls.err_log_file.close() + os.remove("./out_log.txt") + os.remove("./err_log.txt") + + def test_warmups_with_voice_chat(self): + # Call the get_server_info API to verify that the warmups parameter configuration takes effect. + response = requests.get(f"{DEFAULT_URL_FOR_TEST}/get_server_info") + self.assertEqual(response.status_code, 200) + self.assertEqual("voice_chat", response.json().get("warmups")) + + # Verify the actual execution of the warm-up task. + self.err_log_file.seek(0) + content = self.err_log_file.read() + self.assertIn("Running warmup voice_chat", content) + + # Verify that the inference API functions properly. + 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() diff --git a/test/registered/ascend/llm_models/test_ascend_afm_4_5b.py b/test/registered/ascend/llm_models/test_ascend_afm_4_5b.py index 7d1437f32..ce905093f 100644 --- a/test/registered/ascend/llm_models/test_ascend_afm_4_5b.py +++ b/test/registered/ascend/llm_models/test_ascend_afm_4_5b.py @@ -1,15 +1,22 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import AFM_4_5B_BASE_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/arcee-ai/AFM-4.5B-Base" - accuracy = 0.00 +class TestAFM(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the arcee-ai/AFM-4.5B-Base model on the GSM8K dataset is no less than 0.375. + + [Test Category] Model + [Test Target] arcee-ai/AFM-4.5B-Base + """ + + model = AFM_4_5B_BASE_WEIGHTS_PATH + accuracy = 0.375 if __name__ == "__main__": diff --git a/test/registered/ascend/llm_models/test_ascend_baichuan2_13b_chat.py b/test/registered/ascend/llm_models/test_ascend_baichuan2_13b_chat.py index 4472662ca..34c7732f2 100644 --- a/test/registered/ascend/llm_models/test_ascend_baichuan2_13b_chat.py +++ b/test/registered/ascend/llm_models/test_ascend_baichuan2_13b_chat.py @@ -1,6 +1,7 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import BAICHUAN2_13B_CHAT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase @@ -8,7 +9,13 @@ register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) class TestBaichuan(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/baichuan-inc/Baichuan2-13B-Chat" + """Testcase: Verify that the inference accuracy of the baichuan-inc/Baichuan2-13B-Chat model on the GSM8K dataset is no less than 0.48. + + [Test Category] Model + [Test Target] baichuan-inc/Baichuan2-13B-Chat + """ + + model = BAICHUAN2_13B_CHAT_WEIGHTS_PATH accuracy = 0.48 other_args = [ "--trust-remote-code", diff --git a/test/registered/ascend/llm_models/test_ascend_charglm2_6b.py b/test/registered/ascend/llm_models/test_ascend_charglm2_6b.py index b598280a7..9681219bf 100644 --- a/test/registered/ascend/llm_models/test_ascend_charglm2_6b.py +++ b/test/registered/ascend/llm_models/test_ascend_charglm2_6b.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import CHATGLM2_6B_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/ZhipuAI/chatglm2-6b" +class TestChatGlm2(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the ZhipuAI/chatglm2-6b model on the GSM8K dataset is no less than 0.25. + + [Test Category] Model + [Test Target] ZhipuAI/chatglm2-6b + """ + + model = CHATGLM2_6B_WEIGHTS_PATH accuracy = 0.25 other_args = [ "--trust-remote-code", diff --git a/test/registered/ascend/llm_models/test_ascend_deepseek_v3_2_exp_w8a8.py b/test/registered/ascend/llm_models/test_ascend_deepseek_v3_2_exp_w8a8.py index 46ad904e7..03132e425 100644 --- a/test/registered/ascend/llm_models/test_ascend_deepseek_v3_2_exp_w8a8.py +++ b/test/registered/ascend/llm_models/test_ascend_deepseek_v3_2_exp_w8a8.py @@ -1,15 +1,28 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import DEEPSEEK_V3_2_EXP_W8A8_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="nightly-16-npu-a3", nightly=True) +register_npu_ci( + est_time=400, + suite="nightly-16-npu-a3", + nightly=True, + disabled="run failed", +) -class TestDeepSeekV3_2ExpW8A8(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/DeepSeek-V3.2-Exp-W8A8" - accuracy = 0.51 +class TestDeepSeekV32(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the vllm-ascend/DeepSeek-V3.2-Exp-W8A8 model on the GSM8K dataset is no less than 0.5. + + [Test Category] Model + [Test Target] vllm-ascend/DeepSeek-V3.2-Exp-W8A8 + """ + + model = DEEPSEEK_V3_2_EXP_W8A8_WEIGHTS_PATH + accuracy = 0.5 + timeout_for_server_launch = 3000 other_args = [ "--trust-remote-code", "--mem-fraction-static", diff --git a/test/registered/ascend/llm_models/test_ascend_exaone_3.py b/test/registered/ascend/llm_models/test_ascend_exaone_3.py index 04541316f..a61ebf03f 100644 --- a/test/registered/ascend/llm_models/test_ascend_exaone_3.py +++ b/test/registered/ascend/llm_models/test_ascend_exaone_3.py @@ -1,15 +1,22 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import EXAONE_3_5_7_8B_INSTRUCT_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct" - accuracy = 0.00 +class TestEXAONE(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct model on the GSM8K dataset is no less than 0.8. + + [Test Category] Model + [Test Target] LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct + """ + + model = EXAONE_3_5_7_8B_INSTRUCT_WEIGHTS_PATH + accuracy = 0.8 other_args = [ "--trust-remote-code", "--mem-fraction-static", diff --git a/test/registered/ascend/llm_models/test_ascend_glm4_9b_chat.py b/test/registered/ascend/llm_models/test_ascend_glm4_9b_chat.py index 6e96fed7c..7652f2e4b 100644 --- a/test/registered/ascend/llm_models/test_ascend_glm4_9b_chat.py +++ b/test/registered/ascend/llm_models/test_ascend_glm4_9b_chat.py @@ -1,15 +1,27 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import GLM_4_9B_CHAT_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="nightly-1-npu-a3", nightly=True) +register_npu_ci( + est_time=400, + suite="nightly-1-npu-a3", + nightly=True, + disabled="run failed", +) class TestGLM49BChat(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/ZhipuAI/glm-4-9b-chat" - accuracy = 0.00 + """Testcase: Verify that the inference accuracy of the ZhipuAI/glm-4-9b-chat model on the GSM8K dataset is no less than 0.79. + + [Test Category] Model + [Test Target] ZhipuAI/glm-4-9b-chat + """ + + model = GLM_4_9B_CHAT_WEIGHTS_PATH + accuracy = 0.79 if __name__ == "__main__": diff --git a/test/registered/ascend/llm_models/test_ascend_granite_3_0_3b_a800m.py b/test/registered/ascend/llm_models/test_ascend_granite_3_0_3b_a800m.py index 4ea622e35..00d3b2a6c 100644 --- a/test/registered/ascend/llm_models/test_ascend_granite_3_0_3b_a800m.py +++ b/test/registered/ascend/llm_models/test_ascend_granite_3_0_3b_a800m.py @@ -1,17 +1,24 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import ( + GRANITE_3_0_3B_A800M_INSTRUCT_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = ( - "/root/.cache/modelscope/hub/models/ibm-granite/granite-3.0-3b-a800m-instruct" - ) - accuracy = 0.00 +class TestGranite(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the ibm-granite/granite-3.0-3b-a800m-instruct model on the GSM8K dataset is no less than 0.38. + + [Test Category] Model + [Test Target] ibm-granite/granite-3.0-3b-a800m-instruct + """ + + model = GRANITE_3_0_3B_A800M_INSTRUCT_WEIGHTS_PATH + accuracy = 0.38 if __name__ == "__main__": diff --git a/test/registered/ascend/llm_models/test_ascend_granite_3_1_8b.py b/test/registered/ascend/llm_models/test_ascend_granite_3_1_8b.py index f5a5f0a84..ac665572a 100644 --- a/test/registered/ascend/llm_models/test_ascend_granite_3_1_8b.py +++ b/test/registered/ascend/llm_models/test_ascend_granite_3_1_8b.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import GRANITE_3_1_8B_INSTRUCT_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/ibm-granite/granite-3.1-8b-instruct" +class TestGranite(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the ibm-granite/granite-3.1-8b-instruct model on the GSM8K dataset is no less than 0.695. + + [Test Category] Model + [Test Target] ibm-granite/granite-3.1-8b-instruct + """ + + model = GRANITE_3_1_8B_INSTRUCT_WEIGHTS_PATH accuracy = 0.695 diff --git a/test/registered/ascend/llm_models/test_ascend_internlm2_7b.py b/test/registered/ascend/llm_models/test_ascend_internlm2_7b.py index 16c2fdf60..888da3c51 100644 --- a/test/registered/ascend/llm_models/test_ascend_internlm2_7b.py +++ b/test/registered/ascend/llm_models/test_ascend_internlm2_7b.py @@ -1,15 +1,22 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import INTERNLM2_7B_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/Shanghai_AI_Laboratory/internlm2-7b" - accuracy = 0.6 +class TestInternlm2(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the Shanghai_AI_Laboratory/internlm2-7b model on the GSM8K dataset is no less than 0.585. + + [Test Category] Model + [Test Target] Shanghai_AI_Laboratory/internlm2-7b + """ + + model = INTERNLM2_7B_WEIGHTS_PATH + accuracy = 0.585 if __name__ == "__main__": diff --git a/test/registered/ascend/llm_models/test_ascend_ling_lite.py b/test/registered/ascend/llm_models/test_ascend_ling_lite.py index 8264805d3..0dc2a7809 100644 --- a/test/registered/ascend/llm_models/test_ascend_ling_lite.py +++ b/test/registered/ascend/llm_models/test_ascend_ling_lite.py @@ -1,15 +1,32 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import LING_LITE_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="nightly-1-npu-a3", nightly=True) +register_npu_ci(est_time=400, suite="nightly-2-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/inclusionAI/Ling-lite" +class TestLingLite(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the inclusionAI/Ling-lite model on the GSM8K dataset is no less than 0.75. + + [Test Category] Model + [Test Target] inclusionAI/Ling-lite + """ + + model = LING_LITE_WEIGHTS_PATH accuracy = 0.75 + other_args = [ + "--trust-remote-code", + "--mem-fraction-static", + "0.8", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + "2", + ] if __name__ == "__main__": diff --git a/test/registered/ascend/llm_models/test_ascend_llama_2_7b.py b/test/registered/ascend/llm_models/test_ascend_llama_2_7b.py index 33a1369cd..1391d5482 100644 --- a/test/registered/ascend/llm_models/test_ascend_llama_2_7b.py +++ b/test/registered/ascend/llm_models/test_ascend_llama_2_7b.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import LLAMA_2_7B_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/LLM-Research/Llama-2-7B" +class TestLlama(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the LLM-Research/Llama-2-7B model on the GSM8K dataset is no less than 0.18. + + [Test Category] Model + [Test Target] LLM-Research/Llama-2-7B + """ + + model = LLAMA_2_7B_WEIGHTS_PATH accuracy = 0.18 diff --git a/test/registered/ascend/llm_models/test_ascend_mimo_7b_rl.py b/test/registered/ascend/llm_models/test_ascend_mimo_7b_rl.py index ea70abf1a..2fe9f802b 100644 --- a/test/registered/ascend/llm_models/test_ascend_mimo_7b_rl.py +++ b/test/registered/ascend/llm_models/test_ascend_mimo_7b_rl.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import MIMO_7B_RL_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/XiaomiMiMo/MiMo-7B-RL" +class TestMiMo7BRL(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the XiaomiMiMo/MiMo-7B-RL model on the GSM8K dataset is no less than 0.75. + + [Test Category] Model + [Test Target] XiaomiMiMo/MiMo-7B-RL + """ + + model = MIMO_7B_RL_WEIGHTS_PATH accuracy = 0.75 diff --git a/test/registered/ascend/llm_models/test_ascend_minicpm3_4b.py b/test/registered/ascend/llm_models/test_ascend_minicpm3_4b.py index f53692999..972d30dd3 100644 --- a/test/registered/ascend/llm_models/test_ascend_minicpm3_4b.py +++ b/test/registered/ascend/llm_models/test_ascend_minicpm3_4b.py @@ -1,14 +1,26 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import MINICPM3_4B_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="nightly-1-npu-a3", nightly=True) +register_npu_ci( + est_time=400, + suite="nightly-1-npu-a3", + nightly=True, + disabled="run failed", +) class TestMiniCPM3(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/OpenBMB/MiniCPM3-4B" + """Testcase: Verify that the inference accuracy of the OpenBMB/MiniCPM3-4B model on the GSM8K dataset is no less than 0.69. + + [Test Category] Model + [Test Target] OpenBMB/MiniCPM3-4B + """ + + model = MINICPM3_4B_WEIGHTS_PATH accuracy = 0.69 other_args = [ "--trust-remote-code", diff --git a/test/registered/ascend/llm_models/test_ascend_mistral_7b.py b/test/registered/ascend/llm_models/test_ascend_mistral_7b.py index 51c194273..f13790134 100644 --- a/test/registered/ascend/llm_models/test_ascend_mistral_7b.py +++ b/test/registered/ascend/llm_models/test_ascend_mistral_7b.py @@ -1,6 +1,7 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import MISTRAL_7B_INSTRUCT_V0_2_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase @@ -8,7 +9,13 @@ register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/mistralai/Mistral-7B-Instruct-v0.2" + """Testcase: Verify that the inference accuracy of the mistralai/Mistral-7B-Instruct-v0.2 model on the GSM8K dataset is no less than 0.375. + + [Test Category] Model + [Test Target] mistralai/Mistral-7B-Instruct-v0.2 + """ + + model = MISTRAL_7B_INSTRUCT_V0_2_WEIGHTS_PATH accuracy = 0.375 diff --git a/test/registered/ascend/llm_models/test_ascend_persimmon_8b_chat.py b/test/registered/ascend/llm_models/test_ascend_persimmon_8b_chat.py index 695386009..1bb336ca1 100644 --- a/test/registered/ascend/llm_models/test_ascend_persimmon_8b_chat.py +++ b/test/registered/ascend/llm_models/test_ascend_persimmon_8b_chat.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import PERSIMMON_8B_CHAT_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/Howeee/persimmon-8b-chat" +class TestPersimmon8BChat(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the Howeee/persimmon-8b-chat model on the GSM8K dataset is no less than 0.17. + + [Test Category] Model + [Test Target] Howeee/persimmon-8b-chat + """ + + model = PERSIMMON_8B_CHAT_WEIGHTS_PATH accuracy = 0.17 diff --git a/test/registered/ascend/llm_models/test_ascend_phi_4_multimodal.py b/test/registered/ascend/llm_models/test_ascend_phi_4_multimodal.py index 728b71a47..19b1e327d 100644 --- a/test/registered/ascend/llm_models/test_ascend_phi_4_multimodal.py +++ b/test/registered/ascend/llm_models/test_ascend_phi_4_multimodal.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import PHI_4_MULTIMODAL_INSTRUCT_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/LLM-Research/Phi-4-multimodal-instruct" +class TestPhi4(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the microsoft/Phi-4-multimodal-instruct model on the GSM8K dataset is no less than 0.8. + + [Test Category] Model + [Test Target] microsoft/Phi-4-multimodal-instruct + """ + + model = PHI_4_MULTIMODAL_INSTRUCT_WEIGHTS_PATH accuracy = 0.8 diff --git a/test/registered/ascend/llm_models/test_ascend_qwen3_0_6b.py b/test/registered/ascend/llm_models/test_ascend_qwen3_0_6b.py new file mode 100644 index 000000000..a1ba1cb5e --- /dev/null +++ b/test/registered/ascend/llm_models/test_ascend_qwen3_0_6b.py @@ -0,0 +1,30 @@ +import unittest + +from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import QWEN3_0_6B_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="nightly-1-npu-a3", nightly=True) + + +class TestQwen306B(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-0.6B model on the GSM8K dataset is no less than 0.38. + + [Test Category] Model + [Test Target] Qwen/Qwen3-0.6B + """ + + model = QWEN3_0_6B_WEIGHTS_PATH + accuracy = 0.38 + other_args = [ + "--chunked-prefill-size", + 256, + "--attention-backend", + "ascend", + "--disable-cuda-graph", + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/llm_models/test_ascend_qwen3_235b_a22b_w8a8.py b/test/registered/ascend/llm_models/test_ascend_qwen3_235b_a22b_w8a8.py new file mode 100644 index 000000000..99e09aa62 --- /dev/null +++ b/test/registered/ascend/llm_models/test_ascend_qwen3_235b_a22b_w8a8.py @@ -0,0 +1,35 @@ +import unittest + +from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import QWEN3_235B_A22B_W8A8_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="nightly-8-npu-a3", nightly=True) + + +class TestQwen3235BA22BW8A8(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the vllm-ascend/Qwen3-235B-A22B-W8A8 model on the GSM8K dataset is no less than 0.955. + + [Test Category] Model + [Test Target] vllm-ascend/Qwen3-235B-A22B-W8A8 + """ + + model = QWEN3_235B_A22B_W8A8_WEIGHTS_PATH + accuracy = 0.955 + other_args = [ + "--trust-remote-code", + "--mem-fraction-static", + "0.8", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + "8", + "--quantization", + "modelslim", + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/llm_models/test_ascend_qwen3_30b.py b/test/registered/ascend/llm_models/test_ascend_qwen3_30b.py new file mode 100644 index 000000000..f495b2170 --- /dev/null +++ b/test/registered/ascend/llm_models/test_ascend_qwen3_30b.py @@ -0,0 +1,39 @@ +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, +) +from sglang.test.ci.ci_register import register_npu_ci +from sglang.test.test_utils import CustomTestCase + +register_npu_ci(est_time=400, suite="nightly-2-npu-a3", nightly=True) + + +class TestQwen330B(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-30B-A3B-Instruct-2507 model on the GSM8K dataset is no less than 0.90. + + [Test Category] Model + [Test Target] Qwen/Qwen3-30B-A3B-Instruct-2507 + """ + + model = Qwen3_30B_A3B_Instruct_2507_WEIGHTS_PATH + accuracy = 0.90 + other_args = [ + "--trust-remote-code", + "--mem-fraction-static", + 0.7, + "--max-running-requests", + 32, + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--cuda-graph-max-bs", + 32, + "--tp-size", + 2, + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/llm_models/test_ascend_qwen3_32b.py b/test/registered/ascend/llm_models/test_ascend_qwen3_32b.py new file mode 100644 index 000000000..eb8806a2c --- /dev/null +++ b/test/registered/ascend/llm_models/test_ascend_qwen3_32b.py @@ -0,0 +1,38 @@ +import unittest + +from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import QWEN3_32B_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="nightly-4-npu-a3", + nightly=True, + disabled="run failed", +) + + +class TestQwen332B(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-32B model on the GSM8K dataset is no less than 0.88. + + [Test Category] Model + [Test Target] Qwen/Qwen3-32B + """ + + model = QWEN3_32B_WEIGHTS_PATH + accuracy = 0.88 + other_args = [ + "--trust-remote-code", + "--mem-fraction-static", + "0.8", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + "4", + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/llm_models/test_ascend_qwen3_coder_480b_a35b.py b/test/registered/ascend/llm_models/test_ascend_qwen3_coder_480b_a35b.py new file mode 100644 index 000000000..cf3c42665 --- /dev/null +++ b/test/registered/ascend/llm_models/test_ascend_qwen3_coder_480b_a35b.py @@ -0,0 +1,43 @@ +import unittest + +from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import ( + QWEN3_CODER_480B_A35B_INSTRUCT_W8A8_QUAROT_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="nightly-16-npu-a3", + nightly=True, + disabled="run failed", +) + + +class TestQwen3Coder480BA35B(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the Qwen3-Coder-480B-A35B-Instruct-w8a8-QuaRot model on the GSM8K dataset is no less than 0.94. + + [Test Category] Model + [Test Target] Qwen3-Coder-480B-A35B-Instruct-w8a8-QuaRot + """ + + model = QWEN3_CODER_480B_A35B_INSTRUCT_W8A8_QUAROT_WEIGHTS_PATH + accuracy = 0.94 + timeout_for_server_launch = 3000 + other_args = [ + "--trust-remote-code", + "--mem-fraction-static", + "0.8", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + "16", + "--quantization", + "modelslim", + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/llm_models/test_ascend_qwq_32b_w8a8.py b/test/registered/ascend/llm_models/test_ascend_qwq_32b_w8a8.py new file mode 100644 index 000000000..6f127dde3 --- /dev/null +++ b/test/registered/ascend/llm_models/test_ascend_qwq_32b_w8a8.py @@ -0,0 +1,35 @@ +import unittest + +from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import QWQ_32B_W8A8_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="nightly-2-npu-a3", nightly=True) + + +class TestQWQ32BW8A8(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the vllm-ascend/QWQ-32B-W8A8 model on the GSM8K dataset is no less than 0.59. + + [Test Category] Model + [Test Target] vllm-ascend/QWQ-32B-W8A8 + """ + + model = QWQ_32B_W8A8_WEIGHTS_PATH + accuracy = 0.59 + other_args = [ + "--trust-remote-code", + "--mem-fraction-static", + "0.8", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + "2", + "--quantization", + "modelslim", + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/llm_models/test_ascend_smollm_1_7b.py b/test/registered/ascend/llm_models/test_ascend_smollm_1_7b.py index 0ccbd1966..cfe3722f7 100644 --- a/test/registered/ascend/llm_models/test_ascend_smollm_1_7b.py +++ b/test/registered/ascend/llm_models/test_ascend_smollm_1_7b.py @@ -1,14 +1,21 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import SMOLLM_1_7B_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="nightly-1-npu-a3", nightly=True) -class TestMistral7B(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/HuggingFaceTB/SmolLM-1.7B" +class TestSmolLM(GSM8KAscendMixin, CustomTestCase): + """Testcase: Verify that the inference accuracy of the HuggingFaceTB/SmolLM-1.7B model on the GSM8K dataset is no less than 0.05. + + [Test Category] Model + [Test Target] HuggingFaceTB/SmolLM-1.7B + """ + + model = SMOLLM_1_7B_WEIGHTS_PATH accuracy = 0.05 other_args = [ "--trust-remote-code", diff --git a/test/registered/ascend/llm_models/test_ascend_stablelm-2-1_6b.py b/test/registered/ascend/llm_models/test_ascend_stablelm-2-1_6b.py index 9261bcf42..07c71b070 100644 --- a/test/registered/ascend/llm_models/test_ascend_stablelm-2-1_6b.py +++ b/test/registered/ascend/llm_models/test_ascend_stablelm-2-1_6b.py @@ -1,6 +1,7 @@ import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin +from sglang.test.ascend.test_ascend_utils import STABLELM_2_1_6B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase @@ -8,7 +9,13 @@ register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) class TestStablelm(GSM8KAscendMixin, CustomTestCase): - model = "/root/.cache/modelscope/hub/models/stabilityai/stablelm-2-1_6b" + """Testcase: Verify that the inference accuracy of the stabilityai/stablelm-2-1_6b model on the GSM8K dataset is no less than 0.195. + + [Test Category] Model + [Test Target] stabilityai/stablelm-2-1_6b + """ + + model = STABLELM_2_1_6B_WEIGHTS_PATH accuracy = 0.195 other_args = [ "--trust-remote-code", diff --git a/test/registered/ascend/test_ascend_memory_consumption.py b/test/registered/ascend/test_ascend_memory_consumption.py index 2e6b09524..71fb7a02a 100644 --- a/test/registered/ascend/test_ascend_memory_consumption.py +++ b/test/registered/ascend/test_ascend_memory_consumption.py @@ -17,7 +17,12 @@ from sglang.test.test_utils import ( popen_launch_server, ) -register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) +register_npu_ci( + est_time=400, + suite="nightly-1-npu-a3", + nightly=True, + disabled="run failed", +) if "ASCEND_RT_VISIBLE_DEVICES" not in os.environ: os.environ["ASCEND_RT_VISIBLE_DEVICES"] = "0,1" diff --git a/test/registered/ascend/vlm_models/test_ascend_deepseek_vl2.py b/test/registered/ascend/vlm_models/test_ascend_deepseek_vl2.py index 9becccff5..57a397620 100644 --- a/test/registered/ascend/vlm_models/test_ascend_deepseek_vl2.py +++ b/test/registered/ascend/vlm_models/test_ascend_deepseek_vl2.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import DEEPSEEK_VL2_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/deepseek-ai/deepseek-vl2" +class TestDeepseekVl2(TestVLMModels): + """Testcase: Verify that the inference accuracy of the deepseek-ai/deepseek-vl2 model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] deepseek-ai/deepseek-vl2 + """ + + model = DEEPSEEK_VL2_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_gemma_3_4b_it.py b/test/registered/ascend/vlm_models/test_ascend_gemma_3_4b_it.py index 8079157e0..289a8e98a 100644 --- a/test/registered/ascend/vlm_models/test_ascend_gemma_3_4b_it.py +++ b/test/registered/ascend/vlm_models/test_ascend_gemma_3_4b_it.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import GEMMA_3_4B_IT_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/google/gemma-3-4b-it" +class TestGemma34bModels(TestVLMModels): + """Testcase: Verify that the inference accuracy of the google/gemma-3-4b-it model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] google/gemma-3-4b-it + """ + + model = GEMMA_3_4B_IT_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_janus_pro_1b.py b/test/registered/ascend/vlm_models/test_ascend_janus_pro_1b.py index f447c4b3a..6409158fc 100644 --- a/test/registered/ascend/vlm_models/test_ascend_janus_pro_1b.py +++ b/test/registered/ascend/vlm_models/test_ascend_janus_pro_1b.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import JANUS_PRO_1B_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/deepseek-ai/Janus-Pro-1B" +class TestJanusPro1B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the deepseek-ai/Janus-Pro-1B model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] deepseek-ai/Janus-Pro-1B + """ + + model = JANUS_PRO_1B_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_janus_pro_7b.py b/test/registered/ascend/vlm_models/test_ascend_janus_pro_7b.py index 4c5249158..9dee3f8d8 100644 --- a/test/registered/ascend/vlm_models/test_ascend_janus_pro_7b.py +++ b/test/registered/ascend/vlm_models/test_ascend_janus_pro_7b.py @@ -1,5 +1,6 @@ import unittest +from sglang.test.ascend.test_ascend_utils import JANUS_PRO_7B_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci @@ -7,7 +8,13 @@ register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) class TestJanusPro7B(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/deepseek-ai/Janus-Pro-7B" + """Testcase: Verify that the inference accuracy of the deepseek-ai/Janus-Pro-7B model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] deepseek-ai/Janus-Pro-7B + """ + + model = JANUS_PRO_7B_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_llama_3_2_11b_vision_instruct.py b/test/registered/ascend/vlm_models/test_ascend_llama_3_2_11b_vision_instruct.py index eba8dec56..c96da8adb 100644 --- a/test/registered/ascend/vlm_models/test_ascend_llama_3_2_11b_vision_instruct.py +++ b/test/registered/ascend/vlm_models/test_ascend_llama_3_2_11b_vision_instruct.py @@ -3,7 +3,12 @@ import unittest from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci -register_npu_ci(est_time=400, suite="nightly-1-npu-a3", nightly=True) +register_npu_ci( + est_time=400, + suite="nightly-1-npu-a3", + nightly=True, + disabled="run failed", +) class TestLlama3211BVisionInstruct(TestVLMModels): diff --git a/test/registered/ascend/vlm_models/test_ascend_mimo_vl_7b_rl.py b/test/registered/ascend/vlm_models/test_ascend_mimo_vl_7b_rl.py index fc4f8164a..12f11ccef 100644 --- a/test/registered/ascend/vlm_models/test_ascend_mimo_vl_7b_rl.py +++ b/test/registered/ascend/vlm_models/test_ascend_mimo_vl_7b_rl.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import MIMO_VL_7B_RL_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/XiaomiMiMo/MiMo-VL-7B-RL" +class TestMiMoModels(TestVLMModels): + """Testcase: Verify that the inference accuracy of the XiaomiMiMo/MiMo-VL-7B-RL model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] XiaomiMiMo/MiMo-VL-7B-RL + """ + + model = MIMO_VL_7B_RL_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_minicpm_o_2_6.py b/test/registered/ascend/vlm_models/test_ascend_minicpm_o_2_6.py index 96bda8e9f..04abb15c5 100644 --- a/test/registered/ascend/vlm_models/test_ascend_minicpm_o_2_6.py +++ b/test/registered/ascend/vlm_models/test_ascend_minicpm_o_2_6.py @@ -1,13 +1,25 @@ import unittest +from sglang.test.ascend.test_ascend_utils import MINICPM_O_2_6_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci -register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) +register_npu_ci( + est_time=400, + suite="nightly-4-npu-a3", + nightly=True, + disabled="run failed", +) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/openbmb/MiniCPM-o-2_6" +class TestMiniCPMModelsO(TestVLMModels): + """Testcase: Verify that the inference accuracy of the openbmb/MiniCPM-o-2_6 model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] openbmb/MiniCPM-o-2_6 + """ + + model = MINICPM_O_2_6_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_minicpm_v_2_6.py b/test/registered/ascend/vlm_models/test_ascend_minicpm_v_2_6.py index e0beb81f1..74a5efd1b 100644 --- a/test/registered/ascend/vlm_models/test_ascend_minicpm_v_2_6.py +++ b/test/registered/ascend/vlm_models/test_ascend_minicpm_v_2_6.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import MINICPM_V_2_6_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/openbmb/MiniCPM-V-2_6" +class TestMiniCPMModelsV(TestVLMModels): + """Testcase: Verify that the inference accuracy of the openbmb/MiniCPM-V-2_6 model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] openbmb/MiniCPM-V-2_6 + """ + + model = MINICPM_V_2_6_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_mistral_small_3_1_24b_instruct_2503.py b/test/registered/ascend/vlm_models/test_ascend_mistral_small_3_1_24b_instruct_2503.py new file mode 100644 index 000000000..14bd9bb27 --- /dev/null +++ b/test/registered/ascend/vlm_models/test_ascend_mistral_small_3_1_24b_instruct_2503.py @@ -0,0 +1,27 @@ +import unittest + +from sglang.test.ascend.test_ascend_utils import ( + MISTRAL_SMALL_3_1_24B_INSTRUCT_2503_WEIGHTS_PATH, +) +from sglang.test.ascend.vlm_utils import TestVLMModels +from sglang.test.ci.ci_register import register_npu_ci + +register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) + + +class TestMistralModels(TestVLMModels): + """Testcase: Verify that the inference accuracy of the mistralai/Mistral-Small-3.1-24B-Instruct-2503 model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] mistralai/Mistral-Small-3.1-24B-Instruct-2503 + """ + + model = MISTRAL_SMALL_3_1_24B_INSTRUCT_2503_WEIGHTS_PATH + mmmu_accuracy = 0.2 + + def test_vlm_mmmu_benchmark(self): + self._run_vlm_mmmu_test() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/vlm_models/test_ascend_phi4_multimodal_instruct.py b/test/registered/ascend/vlm_models/test_ascend_phi4_multimodal_instruct.py index 0ecb49304..c6d2c00bc 100644 --- a/test/registered/ascend/vlm_models/test_ascend_phi4_multimodal_instruct.py +++ b/test/registered/ascend/vlm_models/test_ascend_phi4_multimodal_instruct.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import PHI_4_MULTIMODAL_INSTRUCT_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/microsoft/Phi-4-multimodal-instruct" +class TestPhi4Multimodal(TestVLMModels): + """Testcase: Verify that the inference accuracy of the microsoft/Phi-4-multimodal-instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] microsoft/Phi-4-multimodal-instruct + """ + + model = PHI_4_MULTIMODAL_INSTRUCT_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_3b_instruct.py b/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_3b_instruct.py index 933f4ba28..245e74dff 100644 --- a/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_3b_instruct.py +++ b/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_3b_instruct.py @@ -1,13 +1,20 @@ import unittest +from sglang.test.ascend.test_ascend_utils import QWEN2_5_VL_3B_INSTRUCT_WEIGHTS_PATH from sglang.test.ascend.vlm_utils import TestVLMModels from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) -class TestGemmaModels(TestVLMModels): - model = "/root/.cache/modelscope/hub/models/Qwen/Qwen2.5-VL-3B-Instruct" +class TestQwen25VL3B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen2.5-VL-3B-Instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] Qwen/Qwen2.5-VL-3B-Instruct + """ + + model = QWEN2_5_VL_3B_INSTRUCT_WEIGHTS_PATH mmmu_accuracy = 0.2 def test_vlm_mmmu_benchmark(self): diff --git a/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_72b_instruct.py b/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_72b_instruct.py new file mode 100644 index 000000000..91774b254 --- /dev/null +++ b/test/registered/ascend/vlm_models/test_ascend_qwen2_5_vl_72b_instruct.py @@ -0,0 +1,40 @@ +import unittest + +from sglang.test.ascend.test_ascend_utils import QWEN2_5_VL_72B_INSTRUCT_WEIGHTS_PATH +from sglang.test.ascend.vlm_utils import TestVLMModels +from sglang.test.ci.ci_register import register_npu_ci + +register_npu_ci(est_time=400, suite="nightly-8-npu-a3", nightly=True) + + +class TestQwen25VL72B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen2.5-VL-72B-Instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] Qwen/Qwen2.5-VL-72B-Instruct + """ + + model = QWEN2_5_VL_72B_INSTRUCT_WEIGHTS_PATH + mmmu_accuracy = 0.2 + other_args = [ + "--trust-remote-code", + "--cuda-graph-max-bs", + "32", + "--enable-multimodal", + "--mem-fraction-static", + 0.6, + "--log-level", + "info", + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + 8, + ] + + def test_vlm_mmmu_benchmark(self): + self._run_vlm_mmmu_test() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_235b_a22b_instruct.py b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_235b_a22b_instruct.py new file mode 100644 index 000000000..130c928de --- /dev/null +++ b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_235b_a22b_instruct.py @@ -0,0 +1,41 @@ +import unittest + +from sglang.test.ascend.test_ascend_utils import ( + QWEN3_VL_235B_A22B_INSTRUCT_WEIGHTS_PATH, +) +from sglang.test.ascend.vlm_utils import TestVLMModels +from sglang.test.ci.ci_register import register_npu_ci + +register_npu_ci(est_time=400, suite="nightly-16-npu-a3", nightly=True) + + +class TestQwen3VL235BA22B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-VL-235B-A22B-Instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] Qwen/Qwen3-VL-235B-A22B-Instruct + """ + + model = QWEN3_VL_235B_A22B_INSTRUCT_WEIGHTS_PATH + mmmu_accuracy = 0.2 + other_args = [ + "--trust-remote-code", + "--cuda-graph-max-bs", + "32", + "--enable-multimodal", + "--mem-fraction-static", + 0.8, + "--attention-backend", + "ascend", + "--disable-cuda-graph", + "--tp-size", + 16, + ] + timeout_for_server_launch = 3000 + + def test_vlm_mmmu_benchmark(self): + self._run_vlm_mmmu_test() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_30b_a3b_instruct.py b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_30b_a3b_instruct.py new file mode 100644 index 000000000..2e08ff4f6 --- /dev/null +++ b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_30b_a3b_instruct.py @@ -0,0 +1,25 @@ +import unittest + +from sglang.test.ascend.test_ascend_utils import QWEN3_VL_30B_A3B_INSTRUCT_WEIGHTS_PATH +from sglang.test.ascend.vlm_utils import TestVLMModels +from sglang.test.ci.ci_register import register_npu_ci + +register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) + + +class TestQwen3VL30BA3B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-VL-30B-A3B-Instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] Qwen/Qwen3-VL-30B-A3B-Instruct + """ + + model = QWEN3_VL_30B_A3B_INSTRUCT_WEIGHTS_PATH + mmmu_accuracy = 0.2 + + def test_vlm_mmmu_benchmark(self): + self._run_vlm_mmmu_test() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_4b_instruct.py b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_4b_instruct.py new file mode 100644 index 000000000..802b99d93 --- /dev/null +++ b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_4b_instruct.py @@ -0,0 +1,25 @@ +import unittest + +from sglang.test.ascend.test_ascend_utils import QWEN3_VL_4B_INSTRUCT_WEIGHTS_PATH +from sglang.test.ascend.vlm_utils import TestVLMModels +from sglang.test.ci.ci_register import register_npu_ci + +register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) + + +class TestQwen3VL4B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-VL-4B-Instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] Qwen/Qwen3-VL-4B-Instruct + """ + + model = QWEN3_VL_4B_INSTRUCT_WEIGHTS_PATH + mmmu_accuracy = 0.2 + + def test_vlm_mmmu_benchmark(self): + self._run_vlm_mmmu_test() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_8b_instruct.py b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_8b_instruct.py new file mode 100644 index 000000000..1a59569e9 --- /dev/null +++ b/test/registered/ascend/vlm_models/test_ascend_qwen3_vl_8b_instruct.py @@ -0,0 +1,25 @@ +import unittest + +from sglang.test.ascend.test_ascend_utils import QWEN3_VL_8B_INSTRUCT_WEIGHTS_PATH +from sglang.test.ascend.vlm_utils import TestVLMModels +from sglang.test.ci.ci_register import register_npu_ci + +register_npu_ci(est_time=400, suite="nightly-4-npu-a3", nightly=True) + + +class TestQwen3VL8B(TestVLMModels): + """Testcase: Verify that the inference accuracy of the Qwen/Qwen3-VL-8B-Instruct model on the MMMU dataset is no less than 0.2. + + [Test Category] Model + [Test Target] Qwen/Qwen3-VL-8B-Instruct + """ + + model = QWEN3_VL_8B_INSTRUCT_WEIGHTS_PATH + mmmu_accuracy = 0.2 + + def test_vlm_mmmu_benchmark(self): + self._run_vlm_mmmu_test() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/run_suite.py b/test/run_suite.py index 502ec397e..95e0d93bb 100644 --- a/test/run_suite.py +++ b/test/run_suite.py @@ -41,7 +41,13 @@ PER_COMMIT_SUITES = { "stage-c-test-8-gpu-b200", "stage-c-test-deepep-8-gpu-h200", ], - HWBackend.NPU: [], + HWBackend.NPU: [ + "stage-a-test-1", + "stage-b-test-1-npu-a2", + "stage-b-test-2-npu-a2", + "stage-b-test-4-npu-a3", + "stage-b-test-16-npu-a3", + ], } # Nightly test suites (run nightly, organized by GPU configuration) @@ -76,6 +82,7 @@ NIGHTLY_SUITES = { "nightly-1-npu-a3", "nightly-2-npu-a3", "nightly-4-npu-a3", + "nightly-8-npu-a3", "nightly-16-npu-a3", ], }