Skip to main content

Ascend NPU Accuracy Evaluation

This document describes how to perform accuracy evaluation for SGLang models running on Ascend NPU using a tool: EvalScope. The following scenarios are covered:
  • Online Testing: Evaluate via API interface after starting SGLang server
  • Text Models: Using Qwen2.5-7B-Instruct as example
  • Multimodal Models: Using Qwen2.5-VL-7B-Instruct as example

Environment Setup

Ensure sufficient disk space before proceeding. The Docker image requires at least 30GB of free space. If you need to download model weights, check the model size at ModelScope to reserve enough space.
First, launch the SGLang environment using the provided container image:
Command

Using EvalScope

EvalScope is a comprehensive model evaluation framework from ModelScope, supporting both accuracy evaluation and performance stress testing.

Install EvalScope

Command

Online Text Model Testing

This section covers online evaluation scenarios where the SGLang server is already running.

Start SGLang Server

Command
For more details of SGLang server, refer to the Ascend NPU Quick Start

Execute Accuracy Evaluation

EvalScope connects to the SGLang server via OpenAI-compatible API. The following example uses the GSM8K dataset:
Command
Upon completion, results similar to the following will be displayed:
Note: Output format may vary slightly across different EvalScope versions. The above example is from EvalScope 1.6.x. Ensure the --model parameter matches the model name returned by the SGLang server’s /v1/models endpoint. When starting the server with an HF path (e.g., Qwen/Qwen2.5-7B-Instruct), use that path directly. For local paths, pass the full path or the model name returned by /v1/models.

Common Datasets for Online Evaluation

Command

Online Multimodal Model Testing

Start Multimodal Model Server

Command

Execute Multimodal Accuracy Evaluation

Command
For more details, refer to the EvalScope documentation.

Troubleshooting

SGLang Server Startup Failure

  1. Verify device mapping: A2 uses davinci[0-7], A3 uses davinci[0-15]
  2. Confirm image tag matches device type: A2 uses ...-910b, A3 uses ...-a3
  3. Check NPU status with npu-smi info
  4. First run requires model download; set HF_ENDPOINT=https://hf-mirror.com if network access is restricted

EvalScope Connection Failure to Server

  1. Confirm SGLang server started successfully (look for Application startup complete in logs)
  2. Verify --api-url points to the correct port (SGLang defaults to 30000)
  3. Ensure URL ends with /v1, e.g., http://localhost:30000/v1

EvalScope SSL certificate verification failed

When using EvalScope commands without specifying a dataset or model path, it will attempt to download automatically, which may encounter an SSL certificate verification error:
Temporary workaround (test only): Navigate to /usr/local/python3.11.14/lib/python3.11/site-packages/requests/sessions.py, find the class Session definition, and set self.verify = False.
This disables TLS certificate validation globally for the Python requests library. Use it only as a temporary diagnostic step in isolated test environments — never in production.
Stable solution: The error is caused by a corporate TLS proxy injecting a self-signed certificate. Point requests to the proxy’s CA bundle:
This is a common workaround for corporate proxy environments. If it does not resolve your issue, consult your IT department — proxy configurations vary across organizations.
If you cannot obtain the CA certificate, download datasets manually as shown in Download Dataset Error below.

EvalScope Request Retry Timeout

If EvalScope keeps retrying requests with errors like:
This is usually caused by the HTTP proxy intercepting requests to the local SGLang server. Disable the proxy with:
Command

Download Dataset Error

For this error
You can add --no-check-certificate
For additional assistance, refer to SGLang GitHub Issues.