Skip to content

Conversation

@Meihan-chen
Copy link
Contributor

@Meihan-chen Meihan-chen commented Nov 24, 2025

What this PR does / why we need it?

Add Triton Ascend and its dependency Ascend Bisheng toolkit

Does this PR introduce any user-facing change?

How was this patch tested?

@github-actions
Copy link

👋 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.

Copy link
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 adds support for Triton on Ascend NPUs by introducing a new dependency triton-ascend and a script to install its required Ascend BiSheng toolkit. The changes update the Dockerfiles to run this installation script and modify dependency files. My review focuses on the new installation script tools/triton_ascend.sh, where I've identified critical issues related to environment setup within Docker, as well as opportunities to improve robustness and image size. The main issue is that the script attempts to modify ~/.bashrc, which is ineffective for the build process and will likely cause the installation of triton-ascend to fail. I've provided a revised script and instructions on how to correctly integrate it into the Docker build process.

Comment on lines +1 to +13
#!/bin/bash

BISHENG_DIR="/vllm-workspace/Ascend-BiSheng"
BISHENG_PACKAGE="Ascend-BiSheng-toolkit_aarch64.run"
BISHENG_URL="https://vllm-ascend.obs.cn-north-4.myhuaweicloud.com/vllm-ascend/${BISHENG_PACKAGE}"
BISHENG_INSTALLER_PATH="${BISHENG_DIR}/${BISHENG_PACKAGE}"
BISHENG_ENV_FILE="/usr/local/Ascend/8.3.RC1/bisheng_toolkit/set_env.sh"

mkdir -p "${BISHENG_DIR}"
wget -P "${BISHENG_DIR}" "${BISHENG_URL}"
chmod a+x "${BISHENG_INSTALLER_PATH}"
"${BISHENG_INSTALLER_PATH}" --install
echo "source ${BISHENG_ENV_FILE}" >> ~/.bashrc No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This script has several issues regarding correctness in a Docker context, image size optimization, and robustness.

  1. Ineffective Environment Setup: The command echo "source ${BISHENG_ENV_FILE}" >> ~/.bashrc will not set up the environment for subsequent commands within the same Docker RUN layer. The environment variables are needed for the pip install of triton-ascend. This line should be removed, and the environment file should be sourced directly in the Dockerfile.

  2. No Cleanup: The downloaded installer is not removed after installation, which unnecessarily increases the Docker image size. It's a best practice to clean up temporary files in the same RUN layer they are created.

  3. Hardcoded Path: The BISHENG_ENV_FILE path is hardcoded. This can be brittle if the toolkit version or installation path changes. While it may work now, consider making this more dynamic if possible.

  4. Error Handling: The script lacks set -e, which means it might not fail immediately if a command like wget or the installer fails, potentially leading to a broken build.

Here is a suggested revision that addresses these points. Note that you will also need to modify your Dockerfiles to source the environment file (/usr/local/Ascend/8.3.RC1/bisheng_toolkit/set_env.sh) after running this script.

Suggested change
#!/bin/bash
BISHENG_DIR="/vllm-workspace/Ascend-BiSheng"
BISHENG_PACKAGE="Ascend-BiSheng-toolkit_aarch64.run"
BISHENG_URL="https://vllm-ascend.obs.cn-north-4.myhuaweicloud.com/vllm-ascend/${BISHENG_PACKAGE}"
BISHENG_INSTALLER_PATH="${BISHENG_DIR}/${BISHENG_PACKAGE}"
BISHENG_ENV_FILE="/usr/local/Ascend/8.3.RC1/bisheng_toolkit/set_env.sh"
mkdir -p "${BISHENG_DIR}"
wget -P "${BISHENG_DIR}" "${BISHENG_URL}"
chmod a+x "${BISHENG_INSTALLER_PATH}"
"${BISHENG_INSTALLER_PATH}" --install
echo "source ${BISHENG_ENV_FILE}" >> ~/.bashrc
#!/bin/bash
set -e
BISHENG_DIR="/vllm-workspace/Ascend-BiSheng"
BISHENG_PACKAGE="Ascend-BiSheng-toolkit_aarch64.run"
BISHENG_URL="https://vllm-ascend.obs.cn-north-4.myhuaweicloud.com/vllm-ascend/${BISHENG_PACKAGE}"
BISHENG_INSTALLER_PATH="${BISHENG_DIR}/${BISHENG_PACKAGE}"
mkdir -p "${BISHENG_DIR}"
wget -P "${BISHENG_DIR}" "${BISHENG_URL}"
chmod a+x "${BISHENG_INSTALLER_PATH}"
"${BISHENG_INSTALLER_PATH}" --install
# Clean up the installer to reduce Docker image size
rm -rf "${BISHENG_DIR}"

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant