Upgrade Triton-Ascend project based on upstream Triton project. This skill automates the version upgrade process, creates a new branch with upgraded code, and performs compilation and basic functionality tests.
This skill automates the process of upgrading the Triton-Ascend project to a new version based on the upstream Triton project. It handles code synchronization, conflict resolution, compilation, and testing.
Use this skill when you need to upgrade Triton-Ascend to a new version from the upstream Triton project.
The upgrade process consists of two merge phases:
Find the commit ID in the upstream Triton repository where the target release branch was created. This is the first commit we need to merge.
Actions:
# Add upstream remote if not already added
git remote add upstream https://github.com/triton-lang/triton.git
git fetch upstream
# Find the merge base (common parent) between main and the release branch
git merge-base upstream/main upstream/release/{version}
This command returns the commit ID where the release branch diverged from main - this is the commit we need to merge in Phase 1.
Output: Save the commit ID to .claude/skills/triton-upgrade/output/{version}/upstream-release-commit.txt
Example:
# For release/v3.2.0
COMMIT_ID=$(git merge-base upstream/main upstream/release/v3.2.0)
echo $COMMIT_ID > .claude/skills/triton-upgrade/output/v3.2.0/upstream-release-commit.txt
Create a new release branch in triton-ascend from the current main branch. The branch name should match the upstream release branch name.
Actions:
git checkout main
git pull origin main
git checkout -b release/{version}
Output: New branch release/{version} created
Merge the upstream commit from Step 1 into the new release branch.
Actions:
git merge {upstream-commit-id}
Expected: Merge conflicts will occur because both triton-ascend and upstream Triton may have modified the same files.
Analyze and resolve all merge conflicts from the first merge.
Actions:
git status to identify conflicted filesgit log and git showgit addOutput: Save conflict resolution notes to .claude/skills/triton-upgrade/output/{version}/phase1-conflicts.md
Build triton-ascend and resolve any compilation errors.
Actions:
# Build command (adjust as needed)
python setup.py build
# or
pip install -e .
Output: Save build logs and fixes to .claude/skills/triton-upgrade/output/{version}/phase1-build.log
Run the most basic operator (add) to verify basic functionality.
Actions:
Test example:
import triton
import triton.language as tl
# Simple add kernel test
# [Add test code here]
Output: Save test results to .claude/skills/triton-upgrade/output/{version}/phase1-test.log
Commit all changes from Phase 1.
Actions:
git add .
git commit -m "Merge upstream release/{version} creation point
- Merged upstream commit {commit-id}
- Resolved conflicts in [list files]
- Fixed compilation errors
- Verified basic functionality with add operator test"
Merge the remaining commits from the upstream release branch (bugfixes and updates after branch creation).
Actions:
# Add upstream remote if not already added
git remote add upstream https://github.com/triton-lang/triton.git
git fetch upstream
# Merge the release branch
git merge upstream/release/{version}
Expected: Additional merge conflicts may occur.
Resolve conflicts from the second merge, similar to Step 4.
Actions:
Output: Save conflict resolution notes to .claude/skills/triton-upgrade/output/{version}/phase2-conflicts.md
Build again and fix any new compilation errors.
Actions:
Output: Save build logs to .claude/skills/triton-upgrade/output/{version}/phase2-build.log
Run the add operator test again to ensure functionality still works.
Actions:
Output: Save test results to .claude/skills/triton-upgrade/output/{version}/phase2-test.log
Commit all Phase 2 changes and push the branch to GitHub.
Actions:
git add .
git commit -m "Complete merge of upstream release/{version}
- Merged all commits from upstream release/{version} branch
- Resolved conflicts in [list files]
- Fixed compilation errors
- Verified basic functionality"
git push origin release/{version}
Output: GitHub branch release/{version} with all upgraded code
.claude/skills/triton-upgrade/
├── SKILL.md # This file
├── scripts/ # Automation scripts
├── references/ # Reference documents and guides
└── output/ # Output files for each upgrade
└── {version}/ # Version-specific output
This upgrade process uses a two-phase merge approach:
This approach helps isolate conflicts and makes it easier to understand and resolve issues.
When resolving conflicts:
git log and git show to understand why each change was madeAll output files should be saved under .claude/skills/triton-upgrade/output/{version}/:
upstream-release-commit.txt - The upstream commit ID for the release branch creationphase1-conflicts.md - Conflict resolution notes for Phase 1phase1-build.log - Build logs for Phase 1phase1-test.log - Test results for Phase 1phase2-conflicts.md - Conflict resolution notes for Phase 2phase2-build.log - Build logs for Phase 2phase2-test.log - Test results for Phase 2release/{version} (e.g., release/v3.2.0)The upgrade is considered complete when:
npx skills add opensourceways/Triton-Ascend Version Upgrade下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Category:other