-
Notifications
You must be signed in to change notification settings - Fork 600
[CI] Add Triton Ascend #4409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[CI] Add Triton Ascend #4409
Conversation
Signed-off-by: Meihan-chen <[email protected]>
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
There was a problem hiding this 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.
| #!/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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script has several issues regarding correctness in a Docker context, image size optimization, and robustness.
-
Ineffective Environment Setup: The command
echo "source ${BISHENG_ENV_FILE}" >> ~/.bashrcwill not set up the environment for subsequent commands within the same DockerRUNlayer. The environment variables are needed for thepip installoftriton-ascend. This line should be removed, and the environment file should be sourced directly in theDockerfile. -
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
RUNlayer they are created. -
Hardcoded Path: The
BISHENG_ENV_FILEpath 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. -
Error Handling: The script lacks
set -e, which means it might not fail immediately if a command likewgetor 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.
| #!/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}" |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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?