Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/Ascend950-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,20 @@ jobs:
ccache --zero-stats
NUM_PROCS=$(( $(nproc) / 3 ))
if [ "$NUM_PROCS" -lt 1 ]; then NUM_PROCS=1; fi
# setup.py is at repo root on main, under python/ on older release branches.
if [ -f setup.py ]; then
SETUP_DIR="."
# setup.py or setup_ascend.py is at repo root on main, under python/ on older release branches.
if [ -f setup_ascend.py ]; then
SETUP_DIR="./"
SETUP_PY="setup_ascend.py"
elif [ -f python/setup.py ]; then
SETUP_DIR="python"
SETUP_PY="setup.py"
else
echo "ERROR: setup.py not found" >&2
echo "ERROR: setup.py or setup_ascend.py not found" >&2
exit 1
fi
cd "$SETUP_DIR"
MAX_JOBS="$NUM_PROCS" \
python setup.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/wheelhouse"
python ${SETUP_PY} bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/wheelhouse"

- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/DynamicCVPipeline-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
NUM_PROCS=$(( $(nproc) / 3 ))
if [ "$NUM_PROCS" -lt 1 ]; then NUM_PROCS=1; fi
cd base
MAX_JOBS="$NUM_PROCS" python setup.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"
MAX_JOBS="$NUM_PROCS" python setup_ascend.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"
Comment on lines 80 to +81

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.

[bug · critical]
Critical bug: setup_ascend.py does not exist in the base branch checkout.

The "Checkout base" step (line 53) checks out the base/target branch via ref: ${{ github.base_ref }}. Since setup_ascend.py is a new file added by this PR (listed as ADDED in the changed files), it does not exist in the base branch. The build step cd base && python setup_ascend.py bdist_wheel ... will fail with a FileNotFoundError.

Comparison with other workflow fixes:

The other modified workflow Ascend950-ci.yml wisely uses a conditional check:

if [ -f setup_ascend.py ]; then
  SETUP_PY="setup_ascend.py"
elif [ -f python/setup.py ]; then
  SETUP_PY="setup.py"
else
  echo "ERROR: setup.py or setup_ascend.py not found" >&2
  exit 1
fi

Suggestion: Apply the same pattern here. For the base branch build, fall back to setup.py since setup_ascend.py won't be there. Alternatively, only use setup_ascend.py for the PR checkout (which contains the new file) and keep using setup.py for the base checkout.

Comment on lines 80 to +81

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.

[bug · critical]
Critical: setup_ascend.py does not exist in the base branch checkout, causing the build to fail.

The "Checkout base" step (line 53) checks out the base/target branch at ref: ${{ github.base_ref }}. Since setup_ascend.py is newly added in this PR (it's an ADDED file), it does not exist in the base branch checkout. Running python setup_ascend.py bdist_wheel inside the base/ directory will fail with FileNotFoundError.

Meanwhile, the base branch's setup.py still contains all the Ascend-specific build logic that hasn't yet been extracted (the extraction happens only in this PR), so the base build should continue using setup.py.

Fix: Revert this line back to python setup.py bdist_wheel, since setup.py is the correct entry point for the base branch. Only the PR checkout should use setup_ascend.py.

Comment on lines 80 to +81

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.

bug · high
setup_ascend.py may not exist on the base branch, causing build failure

The "Build triton-ascend base" step (line 81) runs in the base directory, which was checked out via ref: ${{ github.base_ref }} (the target branch of the PR). Since setup_ascend.py is a new file being introduced in this PR, it does not exist on the base branch. This will cause the step to fail with FileNotFoundError.

In contrast, the parallel change in Ascend950-ci.yml uses a robust fallback pattern that checks for setup_ascend.py first and falls back to setup.py if not found. DynamicCVPipeline-ci.yml should adopt a similar approach for consistency and reliability.

Suggested fix:
Either use a check-then-fallback approach (as done in Ascend950-ci.yml), or ensure the base build continues to use setup.py while only the PR build uses setup_ascend.py.

Suggestion:

Suggested change
cd base
MAX_JOBS="$NUM_PROCS" python setup.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"
MAX_JOBS="$NUM_PROCS" python setup_ascend.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"
cd base
if [ -f setup_ascend.py ]; then
SETUP_PY="setup_ascend.py"
elif [ -f setup.py ]; then
SETUP_PY="setup.py"
else
echo "ERROR: setup_ascend.py or setup.py not found" >&2
exit 1
fi
MAX_JOBS="$NUM_PROCS" python ${SETUP_PY} bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"

Comment on lines 80 to +81

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.

bug · high
setup_ascend.py may not exist on the base branch, causing build failure

The "Build triton-ascend base" step (line 81) runs in the base directory, which was checked out via ref: ${{ github.base_ref }} (the target branch of the PR). Since setup_ascend.py is a new file being introduced in this PR, it does not exist on the base branch. This will cause the step to fail with FileNotFoundError.

In contrast, the parallel change in Ascend950-ci.yml uses a robust fallback pattern that checks for setup_ascend.py first and falls back to setup.py if not found. DynamicCVPipeline-ci.yml should adopt a similar approach for consistency and reliability.

Suggested fix:
Either use a check-then-fallback approach (as done in Ascend950-ci.yml), or ensure the base build continues to use setup.py while only the PR build uses setup_ascend.py.

Suggestion:

Suggested change
cd base
MAX_JOBS="$NUM_PROCS" python setup.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"
MAX_JOBS="$NUM_PROCS" python setup_ascend.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"
cd base
if [ -f setup_ascend.py ]; then
SETUP_PY="setup_ascend.py"
elif [ -f setup.py ]; then
SETUP_PY="setup.py"
else
echo "ERROR: setup_ascend.py or setup.py not found" >&2
exit 1
fi
MAX_JOBS="$NUM_PROCS" python ${SETUP_PY} bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/base/wheelhouse"


- name: Build triton-ascend pr
shell: bash
Expand All @@ -98,7 +98,7 @@ jobs:
NUM_PROCS=$(( $(nproc) / 3 ))
if [ "$NUM_PROCS" -lt 1 ]; then NUM_PROCS=1; fi
cd pr
MAX_JOBS="$NUM_PROCS" python setup.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/pr/wheelhouse"
MAX_JOBS="$NUM_PROCS" python setup_ascend.py bdist_wheel --dist-dir="${GITHUB_WORKSPACE}/pr/wheelhouse"
Comment on lines 100 to +101

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.

[bug · low]
Same critical issue applies to the PR build step — but this one will work since the PR checkout does contain setup_ascend.py.

However, for consistency and to avoid future breakage (if the file name changes again), consider adopting the same defensive -f check pattern as Ascend950-ci.yml here as well.

Comment on lines 100 to +101

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.

[bug · low]
The PR build step change to setup_ascend.py is correct.

The PR checkout contains the newly added setup_ascend.py, and the modified setup.py no longer includes the Ascend-specific build logic (patches, coverage, distributed submodule, etc.). So using python setup_ascend.py for the PR build is the right change.

However, for defensive programming and consistency with Ascend950-ci.yml, consider adding a fallback check (e.g., if [ -f setup_ascend.py ]; then ...) to handle any future structural changes gracefully.


- name: generate ttadapter
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-ascend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
NUM_PROCS=$(( $(nproc) / 3 ))
if [ "$NUM_PROCS" -lt 1 ]; then NUM_PROCS=1; fi
MAX_JOBS="$NUM_PROCS" \
${PYTHON} setup.py bdist_wheel
${PYTHON} setup_ascend.py bdist_wheel
${PYTHON} -m pip install dist/*.whl

- name: CCache stats
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ TRITON_BUILD_WITH_CLANG_LLD=true \
TRITON_BUILD_PROTON=OFF \
TRITON_WHEEL_NAME="triton-ascend" \
TRITON_APPEND_CMAKE_ARGS="-DTRITON_BUILD_UT=OFF" \
python3 setup.py install
python3 setup_ascend.py install
```

</details>
Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ TRITON_BUILD_WITH_CLANG_LLD=true \
TRITON_BUILD_PROTON=OFF \
TRITON_WHEEL_NAME="triton-ascend" \
TRITON_APPEND_CMAKE_ARGS="-DTRITON_BUILD_UT=OFF" \
python3 setup.py install
python3 setup_ascend.py install
```

</details>
Expand Down
2 changes: 1 addition & 1 deletion docs/en/installation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ If you need to customize the LLVM build process, follow the steps below to compi
TRITON_BUILD_PROTON=OFF \
TRITON_WHEEL_NAME="triton-ascend" \
TRITON_APPEND_CMAKE_ARGS="-DTRITON_BUILD_UT=OFF" \
python3 setup.py install
python3 setup_ascend.py install
```

## Development Images
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/installation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pip install -e .
TRITON_BUILD_PROTON=OFF \
TRITON_WHEEL_NAME="triton-ascend" \
TRITON_APPEND_CMAKE_ARGS="-DTRITON_BUILD_UT=OFF" \
python3 setup.py install
python3 setup_ascend.py install
```

## 开发镜像
Expand Down
7 changes: 7 additions & 0 deletions init_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from setup_ascend import _get_triton_ascend_patch_file, _checkout_file

patch_files, dev_patch_files = _get_triton_ascend_patch_file()
if dev_patch_files:
_checkout_file(dev_patch_files)
if patch_files:
_checkout_file(patch_files)
Loading
Loading