Skip to content

[BugFix][310p] Fix torch-npu cannot import error - #9249

Merged
wangxiyuan merged 2 commits into
vllm-project:mainfrom
Tflowers-0129:518fix-ci-error
May 18, 2026
Merged

wangxiyuan merged 2 commits into
vllm-project:mainfrom
Tflowers-0129:518fix-ci-error

Conversation

@Tflowers-0129

@Tflowers-0129 Tflowers-0129 commented May 18, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where torch_npu could not be imported.

The root cause is related to the torch-npu 2.10.0 upgrade. After the upgrade, if a residual triton directory still exists in the environment, importing torch_npu may indirectly depend on triton.language. However, Triton is not supported on Ascend 310P and should be removed.

In the CI environment, triton had been uninstalled, but the cleanup was incomplete because of the uninstall order. We need to uninstall triton-ascend first and then uninstall triton; otherwise, some Triton-related files may remain.

The correct cleanup order is:

pip uninstall -y triton-ascend
pip uninstall -y triton

Does this PR introduce any user-facing change?

NA

How was this patch tested?

CI

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an import error related to 'torch-npu' by removing the explicit installation of 'triton-ascend' during the Docker image construction. This change ensures a cleaner environment and prevents dependency conflicts that were causing runtime issues.

Highlights

  • Dependency Management: Removed the installation of 'triton-ascend' from the Docker build process to resolve potential import conflicts with 'torch-npu'.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/_e2e_test.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@Tflowers-0129 Tflowers-0129 changed the title [Bugfix][310p] Fix torch-npu cannot import error [BugFix][310p] Fix torch-npu cannot import error May 18, 2026

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

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.

Code Review

This pull request removes the installation of triton-ascend from the Dockerfile.310p and Dockerfile.310p.openEuler files to address potential torch-npu import issues. Feedback from the reviewer indicates that the PR title and summary need to be updated to comply with the repository's style guide. Furthermore, it is recommended to reorder the packages in the pip uninstall command to maintain consistency with other Dockerfiles in the repository.

Comment thread Dockerfile.310p
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
python3 -m pip uninstall -y triton-ascend triton&& \
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://triton-ascend.osinfra.cn/pypi/simple && \
python3 -m pip uninstall -y triton-ascend triton && \

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 Pull Request title and summary do not adhere to the repository's style guide. The title should follow the [Branch][Module][Action] Title format, and the summary should include the required sections. Additionally, for consistency with other Dockerfiles in the repository (e.g., Dockerfile, Dockerfile.openEuler), the package order in the uninstall command should be updated.

Suggested PR Title:

[310p][BugFix] Fix torch-npu cannot import error

Suggested PR Summary:

### What this PR does / why we need it?

This PR removes the installation of `triton-ascend` in the Dockerfiles for Ascend 310P. This change addresses an issue where `torch-npu` fails to import, likely due to incompatibilities or conflicts introduced by the `triton-ascend` package on this specific hardware architecture.

### Does this PR introduce _any_ user-facing change?

No. This is an internal change to the Docker image build process.

### How was this patch tested?

The change is intended to resolve a known import error in the 310P environment.
    python3 -m pip uninstall -y triton triton-ascend && \
References
  1. The PR title and summary must follow the specific format defined in the repository style guide (lines 12-47). (link)

Comment thread Dockerfile.310p.openEuler
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
python3 -m pip uninstall -y triton-ascend triton&& \
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://triton-ascend.osinfra.cn/pypi/simple && \
python3 -m pip uninstall -y triton-ascend triton && \

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

For consistency with other Dockerfiles in the repository (e.g., Dockerfile, Dockerfile.openEuler), please use the same package order in the uninstall command.

    python3 -m pip uninstall -y triton triton-ascend && \

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: Tflowers-0129 <2906339855@qq.com>
@wangxiyuan
wangxiyuan merged commit 9862265 into vllm-project:main May 18, 2026
51 checks passed
@Tflowers-0129
Tflowers-0129 deleted the 518fix-ci-error branch May 19, 2026 00:55
Tian-Fantasea pushed a commit to Tian-Fantasea/vllm-ascend that referenced this pull request May 19, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: Tian <tt553093031@gmail.com>
Tian-Fantasea pushed a commit to Tian-Fantasea/vllm-ascend that referenced this pull request May 19, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: Tian <tt553093031@gmail.com>
shaopeng-666 pushed a commit to shaopeng-666/vllm-ascend that referenced this pull request May 19, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: 李少鹏 <lishaopeng21@huawei.com>
ader47 pushed a commit to ader47/vllm-ascend that referenced this pull request Jun 18, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI 
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
CXY-Katrina pushed a commit to CXY-Katrina/vllm-ascend that referenced this pull request Jun 27, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI 
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
pisceskkk pushed a commit to pisceskkk/vllm-ascend that referenced this pull request Jun 29, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI 
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
shiqiangA pushed a commit to shiqiangA/vllm-ascend that referenced this pull request Aug 20, 2026
### What this PR does / why we need it?

Fixed the recent CI failure on Ascend 310P where `torch_npu` could not
be imported.

The root cause is related to the `torch-npu` 2.10.0 upgrade. After the
upgrade, if a residual `triton` directory still exists in the
environment, importing `torch_npu` may indirectly depend on
`triton.language`. However, Triton is not supported on Ascend 310P and
should be removed.

In the CI environment, `triton` had been uninstalled, but the cleanup
was incomplete because of the uninstall order. We need to uninstall
`triton-ascend` first and then uninstall `triton`; otherwise, some
Triton-related files may remain.

The correct cleanup order is:

```bash
pip uninstall -y triton-ascend
pip uninstall -y triton
```
### Does this PR introduce _any_ user-facing change?

NA

### How was this patch tested?

CI 
- vLLM version: v0.20.2
- vLLM main:
vllm-project/vllm@0d4d334

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants