Skip to content

[ci] chore: add sglang ci for NPU#6015

Open
xiazhahe wants to merge 15 commits intoverl-project:mainfrom
xiazhahe:ci
Open

[ci] chore: add sglang ci for NPU#6015
xiazhahe wants to merge 15 commits intoverl-project:mainfrom
xiazhahe:ci

Conversation

@xiazhahe
Copy link
Copy Markdown
Contributor

@xiazhahe xiazhahe commented Apr 15, 2026

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

Add sglang ci yaml for Ascend NPU && change related scripts.
All CI test cases have been tested locally and executed successfully.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, veomni, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward, fully_async, one_step_off
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Dockerfiles for Ascend NPU support and refactors the run_ppo_trainer_megatron.sh script to conditionally support both CUDA and NPU devices. Review feedback identifies a critical version mismatch between the installed PyTorch version and the sgl-kernel-npu package, which could lead to binary incompatibility. Additionally, improvements are suggested for the Dockerfiles to reduce image size by cleaning up downloaded artifacts and to enhance security by verifying certificates during downloads.

Comment on lines +35 to +43
pip install torch==2.7.1 torchvision==0.22.1 && \
pip install -e python[all_npu] && \
# Install torch_npu
ARCH=$(uname -m) && wget ${PTA_URL}/${PTA_BASE_VERSION}_${ARCH}.whl && pip install ${PTA_BASE_VERSION}_${ARCH}.whl && \
echo "[LOG INFO] Torch_npu version is: ${PTA_BASE_VERSION}_${ARCH}.whl" && \
cd ..

# Install sgl-kernel-npu
RUN wget --no-check-certificate https://github.com/sgl-project/sgl-kernel-npu/releases/download/2026.02.01/sgl-kernel-npu-2026.02.01-torch2.8.0-py311-cann8.5.0-910b-aarch64.zip && \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There is a significant version mismatch between the installed PyTorch version and the sgl-kernel-npu package. You are installing torch==2.7.1 at line 35, but downloading a kernel built for torch2.8.0 at line 43. This will likely result in binary incompatibility and runtime errors when the NPU kernels are loaded. Please ensure that the sgl-kernel-npu version matches the installed PyTorch version.

Comment on lines +35 to +43
pip install torch==2.7.1 torchvision==0.22.1 && \
pip install -e python[all_npu] && \
# Install torch_npu
ARCH=$(uname -m) && wget ${PTA_URL}/${PTA_BASE_VERSION}_${ARCH}.whl && pip install ${PTA_BASE_VERSION}_${ARCH}.whl && \
echo "[LOG INFO] Torch_npu version is: ${PTA_BASE_VERSION}_${ARCH}.whl" && \
cd ..

# Install sgl-kernel-npu
RUN wget --no-check-certificate https://github.com/sgl-project/sgl-kernel-npu/releases/download/2026.02.01/sgl-kernel-npu-2026.02.01-torch2.8.0-py311-cann8.5.0-910b-aarch64.zip && \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There is a significant version mismatch between the installed PyTorch version and the sgl-kernel-npu package. You are installing torch==2.7.1 at line 35, but downloading a kernel built for torch2.8.0 at line 43. This will likely result in binary incompatibility and runtime errors when the NPU kernels are loaded. Please ensure that the sgl-kernel-npu version matches the installed PyTorch version.

Comment on lines +43 to +47
RUN wget --no-check-certificate https://github.com/sgl-project/sgl-kernel-npu/releases/download/2026.02.01/sgl-kernel-npu-2026.02.01-torch2.8.0-py311-cann8.5.0-910b-aarch64.zip && \
unzip sgl-kernel-npu*.zip && \
pip install torch_memory_saver*.whl && \
pip install sgl_kernel_npu*.whl && \
pip install deep_ep*.whl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Dockerfile downloads several large .zip and .whl files into the root directory but does not remove them after installation. Additionally, using --no-check-certificate with wget is a security risk. It is recommended to remove the downloaded artifacts in the same RUN layer to keep the image size small and avoid security warnings.

RUN wget https://github.com/sgl-project/sgl-kernel-npu/releases/download/2026.02.01/sgl-kernel-npu-2026.02.01-torch2.8.0-py311-cann8.5.0-910b-aarch64.zip && \
    unzip sgl-kernel-npu*.zip && \
    pip install torch_memory_saver*.whl && \
    pip install sgl_kernel_npu*.whl && \
    pip install deep_ep*.whl && \
    rm -rf sgl-kernel-npu*.zip *.whl

Comment on lines +43 to +47
RUN wget --no-check-certificate https://github.com/sgl-project/sgl-kernel-npu/releases/download/2026.02.01/sgl-kernel-npu-2026.02.01-torch2.8.0-py311-cann8.5.0-910b-aarch64.zip && \
unzip sgl-kernel-npu*.zip && \
pip install torch_memory_saver*.whl && \
pip install sgl_kernel_npu*.whl && \
pip install deep_ep*.whl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Dockerfile downloads several large .zip and .whl files into the root directory but does not remove them after installation. Additionally, using --no-check-certificate with wget is a security risk. It is recommended to remove the downloaded artifacts in the same RUN layer to keep the image size small and avoid security warnings.

RUN wget https://github.com/sgl-project/sgl-kernel-npu/releases/download/2026.02.01/sgl-kernel-npu-2026.02.01-torch2.8.0-py311-cann8.5.0-910b-aarch64.zip && \
    unzip sgl-kernel-npu*.zip && \
    pip install torch_memory_saver*.whl && \
    pip install sgl_kernel_npu*.whl && \
    pip install deep_ep*.whl && \
    rm -rf sgl-kernel-npu*.zip *.whl

Comment thread .github/workflows/e2e_ppo_trainer_megatron_sglang_ascend.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants