Update CUTLASS #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update CUTLASS | |
| on: | |
| schedule: | |
| # Run every Monday at 9:00 UTC | |
| - cron: '0 9 * * 1' | |
| workflow_dispatch: | |
| inputs: | |
| force_update: | |
| description: 'Force update even if already on latest' | |
| type: boolean | |
| default: false | |
| jobs: | |
| check-update: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_update: ${{ steps.check.outputs.has_update }} | |
| current_version: ${{ steps.check.outputs.current_version }} | |
| latest_version: ${{ steps.check.outputs.latest_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Check for CUTLASS updates | |
| id: check | |
| run: | | |
| cd third_party/cutlass | |
| # Get current version | |
| CURRENT=$(git describe --tags --abbrev=0 2>/dev/null || echo "unknown") | |
| echo "current_version=$CURRENT" >> $GITHUB_OUTPUT | |
| echo "Current CUTLASS version: $CURRENT" | |
| # Fetch latest tags | |
| git fetch --tags origin | |
| # Get latest v4.x.x tag (exclude pre-releases) | |
| LATEST=$(git tag -l "v4.*" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1) | |
| echo "latest_version=$LATEST" >> $GITHUB_OUTPUT | |
| echo "Latest CUTLASS version: $LATEST" | |
| # Compare versions | |
| if [ "$CURRENT" != "$LATEST" ] || [ "${{ inputs.force_update }}" == "true" ]; then | |
| echo "has_update=true" >> $GITHUB_OUTPUT | |
| echo "Update available: $CURRENT -> $LATEST" | |
| else | |
| echo "has_update=false" >> $GITHUB_OUTPUT | |
| echo "Already on latest version" | |
| fi | |
| create-pr: | |
| needs: check-update | |
| if: needs.check-update.outputs.has_update == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Update CUTLASS submodule | |
| run: | | |
| cd third_party/cutlass | |
| git fetch --tags origin | |
| git checkout ${{ needs.check-update.outputs.latest_version }} | |
| cd ../.. | |
| git add third_party/cutlass | |
| - name: Create branch and commit | |
| id: commit | |
| run: | | |
| BRANCH="deps/cutlass-${{ needs.check-update.outputs.latest_version }}" | |
| echo "branch=$BRANCH" >> $GITHUB_OUTPUT | |
| # Check if branch already exists | |
| if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then | |
| echo "Branch $BRANCH already exists, skipping" | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| git checkout -b "$BRANCH" | |
| git commit -m "chore(deps): update CUTLASS to ${{ needs.check-update.outputs.latest_version }} | |
| - Updated from ${{ needs.check-update.outputs.current_version }} to ${{ needs.check-update.outputs.latest_version }} | |
| - See: https://github.com/NVIDIA/cutlass/releases/tag/${{ needs.check-update.outputs.latest_version }} | |
| 🤖 Generated by GitHub Actions" | |
| git push origin "$BRANCH" | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| if: steps.commit.outputs.skip != 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr create \ | |
| --title "chore(deps): update CUTLASS to ${{ needs.check-update.outputs.latest_version }}" \ | |
| --body "## Summary | |
| This PR updates CUTLASS from \`${{ needs.check-update.outputs.current_version }}\` to \`${{ needs.check-update.outputs.latest_version }}\`. | |
| ## Changes | |
| - Updated CUTLASS submodule to latest release | |
| - See [CUTLASS ${{ needs.check-update.outputs.latest_version }} Release Notes](https://github.com/NVIDIA/cutlass/releases/tag/${{ needs.check-update.outputs.latest_version }}) | |
| ## Testing | |
| - [ ] Build passes on Linux | |
| - [ ] Build passes on Windows | |
| - [ ] Benchmark shows no regression | |
| --- | |
| 🤖 This PR was automatically created by the [Update CUTLASS](${{ github.server_url }}/${{ github.repository }}/actions/workflows/update-cutlass.yml) workflow." \ | |
| --base main \ | |
| --head "${{ steps.commit.outputs.branch }}" |