Skip to content

[Triton/Gluon] [FlyDSL] [CI] Make the lint versions in CONTRIBUTE.md the same as the CI versions (black==26.10.1, ruff==0.16.0) - #8314

Merged
zufayu merged 2 commits into
ROCm:mainfrom
menglcai-amd:ci/ruff-gate-and-lint-version-pin
Nov 27, 2026
Merged

zufayu merged 2 commits into
ROCm:mainfrom
menglcai-amd:ci/ruff-gate-and-lint-version-pin

Conversation

@menglcai-amd

@menglcai-amd menglcai-amd commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix #4423

This PR makes the lint versions in CONTRIBUTE.md the same as the CI versions (black==26.10.1, ruff==0.16.0), pins black in CI to 26.10.1, and makes the ruff check on main able to fail. It also fixes the few ruff findings on the current HEAD of main (a708209), so that the new check does not fail on the first push after merge.

Base: main at a708209582f3c59837588b2f89a8e2a62c0ca6a0 (#8306). All CI evidence and all test results below are for this base and for this PR on this base, unless a row gives a different commit.

Motivation

#4423: CONTRIBUTE.md gives black==26.3.0 ruff==0.15.7, but CI uses black==26.10.1 ruff==0.16.0. With the guide versions, a contributor gets a different lint verdict from CI.

Two more gaps cause the same problem:

  1. The black job uses psf/black@stable with no version, so CI moves to each new black release.
  2. The ruff job cannot fail on main. On push, reviewdog maps the deprecated -fail-on-error to error level, and ruff reports every finding as a warning. Thus a finding that the pull request CI does not show (it shows only findings near changed lines) stays on main. There are 2 such findings on main now:

Changes

  • .github/workflows/pre-checks.yaml, black job: add version: "26.10.1". This is the version that psf/black@stable installs on the base now, so no verdict changes.
  • .github/workflows/pre-checks.yaml, ruff job: replace -fail-on-error=true with -fail-level=any. Pull requests have no change, because -fail-on-error already maps to any for the pull request reporter. On push to main, a ruff finding now fails the job.
  • aiter/aot/flydsl/gemm.py: mode 100644 to 100755 (fixes EXE001). No content change.
  • op_tests/op_benchmarks/triton/model_benchmarking_tool/bench_models.py: move 6 import lines in the same import section (fixes I001, ruff autofix). No other change.
  • CONTRIBUTE.md: change black==26.3.0 ruff==0.15.7 to black==26.10.1 ruff==0.16.0.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

No GPU code changes. The tests are lint runs on a CPU only. See "Validation and unverified scope" below.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None

PR Self-Review

Reviewed revision

ee895e2

Behavior and intent

Before this PR, the lint versions in CONTRIBUTE.md do not agree with CI, the black version in CI changes with each black release, and the ruff job on main cannot fail. After this PR, CONTRIBUTE.md gives the CI versions, CI uses black 26.10.1 until someone changes the pin, main has no ruff finding, and a ruff finding on main fails the job. The ruff job on pull requests does not change.

Validation and unverified scope

CI versions on the base

CI run of the base a708209 on main: run 44548549788 (push event, conclusion success).

Job Log line
Check Code Style with Ruff Successfully installed ruff-0.16.0
same reviewdog/reviewdog info found version: 0.21.3 for v0.21.3/Linux/x86_64
same REVIEWDOG_REPORTER: github-check, REVIEWDOG_FILTER_MODE: nofilter
same reviewdog: -fail-on-error is deprecated. Use -fail-level=any, or -fail-level=error for github-[pr-]check reporter instead.
Check Code Style with Black Installing black[colorama]==26.10.1...
same 1879 files would be left unchanged.

The reviewdog ruff check run of the base, 135645965872, has conclusion neutral and 2 annotations (EXE001 in gemm.py, I001 in bench_models.py), but the job passes.

CI of this PR

CI of this PR c753eda: 10 jobs passed and 36 jobs were skipped. No job failed. The skipped jobs are GPU tests, and this PR changes no file that starts them. Black and Ruff are in run 44557189019 (pull_request event).

Job Log line
Check Code Style with Ruff Successfully installed ruff-0.16.0
same reviewdog/reviewdog info found version: 0.21.3 for v0.21.3/Linux/x86_64
same REVIEWDOG_REPORTER: github-pr-review, REVIEWDOG_FILTER_MODE: diff_context
same -fail-level=any
Check Code Style with Black Installing black[colorama]==26.10.1...
same 1879 files would be left unchanged.
Check GitHub Actions workflows pass

The ruff job gives no finding and no review comment. The -fail-on-error is deprecated warning of the base is not in the log.

Local tests

Host: Ubuntu 24.04, x86_64, Python 3.12.3, CPU only. ruff==0.16.0 and black==26.10.1 in venvs, reviewdog v0.21.3 and actionlint v1.7.7 release binaries. The trees are git archive output of the base and of this PR, so the file modes are the git modes. The "ruff step" is the command of the CI ruff step with -reporter=local -filter-mode=nofilter -fail-level=any, because the GitHub reporters need the GitHub API.

Test Base a708209 This PR c753eda
ruff check . 2 findings (EXE001, I001), exit 1 All checks passed!, exit 0
black --check . 1879 files unchanged, exit 0 1879 files unchanged, exit 0
ruff step EXE001 and I001, exit 1 0 findings, exit 0
ruff step, plus a test file with import os - F401, exit 1
actionlint .github/workflows/pre-checks.yaml - exit 0
python3 -m py_compile bench_models.py - exit 0

Unverified:

  • The github-check reporter with -fail-level=any. The first CI run on main after merge is the first real run.
  • main can get a new ruff finding before this PR merges. I will run ruff check . on the latest main again before merge.
  • I did not run bench_models.py. The change only moves import lines.

PR-specific question

This PR changes no permissions, no trigger and no secret use. The workflow keeps the pull_request trigger (not pull_request_target), so code from a fork pull request runs with the read-only GITHUB_TOKEN. The two changed inputs are static strings in the workflow file (version: "26.10.1" for the black action, -fail-level=any for reviewdog). No pull request text or file content becomes part of a command.

Changed op tests

op_tests/op_benchmarks/triton/model_benchmarking_tool/bench_models.py: this is a benchmark tool, not a test. The change moves 6 import lines inside the same import section to fix ruff I001. It adds no test and changes no tested behavior.

AI assistance: I used an AI coding assistant to help write this change and this description. I ran and checked all the tests above.

- pre-checks.yaml: pin black to 26.10.1 (the version that
  psf/black@stable installs now) with the action `version` input.
- pre-checks.yaml: replace the deprecated -fail-on-error with
  -fail-level=any. For the github-check reporter (push to main),
  -fail-on-error maps to error level, and ruff reports every finding as
  WARNING, so the job never failed on main.
- aiter/aot/flydsl/gemm.py: restore mode 100755 (lost in ROCm#7439). The file
  has a shebang, and ruff EXE001 reports it on main.
- bench_models.py: fix ruff I001 (import order). ROCm#6728 added the
  bench_moe_gemm_a4w4 and bench_moe_gemm_a8w4 modules, so ruff now sorts
  their imports as first-party. Move only these 6 lines (ruff autofix).
- CONTRIBUTE.md: install the CI versions (black 26.10.1, ruff 0.16.0).

Refs ROCm#4423
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 8314 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@menglcai-amd
menglcai-amd marked this pull request as ready for review November 19, 2026 15:50
@menglcai-amd
menglcai-amd requested review from a team and a balanced review from Copilot November 19, 2026 15:50

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot changed the title [CI] Make the lint versions in CONTRIBUTE.md the same as the CI versions (black==26.10.1, ruff==0.16.0) [Triton/Gluon] [FlyDSL] [CI] Make the lint versions in CONTRIBUTE.md the same as the CI versions (black==26.10.1, ruff==0.16.0) Nov 19, 2026
@aiter-bot

aiter-bot commented Nov 19, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision ee895e23676e · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

Before this PR, the lint versions in `CONTRIBUTE.md` do not agree with CI, the black version in CI changes with each black release, and the ruff job on `main` cannot fail. After this PR, `CONTRIBUTE.md` gives the CI versions, CI uses black 26.10.1 until someone changes the pin, `main` has no ruff finding, and a ruff finding on `main` fails the job. The ruff job on pull requests does not change.

Validation and unverified scope

#### CI versions on the base

CI run of the base `a708209` on `main`: [run 44548549788](https://github.com/ROCm/aiter/actions/runs/44548549788) (push event, conclusion `success`).

| Job | Log line |
|-----|----------|
| [Check Code Style with Ruff](https://github.com/ROCm/aiter/actions/runs/44548549788/job/135645673626) | `Successfully installed ruff-0.16.0` |
| same | `reviewdog/reviewdog info found version: 0.21.3 for v0.21.3/Linux/x86_64` |
| same | `REVIEWDOG_REPORTER: github-check`, `REVIEWDOG_FILTER_MODE: nofilter` |
| same | `reviewdog: -fail-on-error is deprecated. Use -fail-level=any, or -fail-level=error for github-[pr-]check reporter instead.` |
| [Check Code Style with Black](https://github.com/ROCm/aiter/actions/runs/44548549788/job/135645674639) | `Installing black[colorama]==26.10.1...` |
| same | `1879 files would be left unchanged.` |

The reviewdog `ruff` check run of the base, [135645965872](https://github.com/ROCm/aiter/runs/135645965872), has conclusion `neutral` and 2 annotations (EXE001 in `gemm.py`, I001 in `bench_models.py`), but the job passes.

#### CI of this PR

CI of this PR `c753eda`: 10 jobs passed and 36 jobs were skipped. No job failed. The skipped jobs are GPU tests, and this PR changes no file that starts them. Black and Ruff are in [run 44557189019](https://github.com/ROCm/aiter/actions/runs/44557189019) (pull_request event).

| Job | Log line |
|-----|----------|
| [Check Code Style with Ruff](https://github.com/ROCm/aiter/actions/runs/44557189019/job/135676323099) | `Successfully installed ruff-0.16.0` |
| same | `reviewdog/reviewdog info found version: 0.21.3 for v0.21.3/Linux/x86_64` |
| same | `REVIEWDOG_REPORTER: github-pr-review`, `REVIEWDOG_FILTER_MODE: diff_context` |
| same | `-fail-level=any` |
| [Check Code Style with Black](https://github.com/ROCm/aiter/actions/runs/44557189019/job/135676323733) | `Installing black[colorama]==26.10.1...` |
| same | `1879 files would be left unchanged.` |
| [Check GitHub Actions workflows](https://github.com/ROCm/aiter/actions/runs/44557189044/job/135676322852) | pass |

The ruff job gives no finding and no review comment. The `-fail-on-error is deprecated` warning of the base is not in the log.

#### Local tests

Host: Ubuntu 24.04, x86_64, Python 3.12.3, CPU only. `ruff==0.16.0` and `black==26.10.1` in venvs, reviewdog v0.21.3 and actionlint v1.7.7 release binaries. The trees are `git archive` output of the base and of this PR, so the file modes are the git modes. The "ruff step" is the command of the CI ruff step with `-reporter=local -filter-mode=nofilter -fail-level=any`, because the GitHub reporters need the GitHub API.

| Test | Base `a708209` | This PR `c753eda` |
|------|----------------|-------------------|
| `ruff check .` | 2 findings (EXE001, I001), exit 1 | `All checks passed!`, exit 0 |
| `black --check .` | 1879 files unchanged, exit 0 | 1879 files unchanged, exit 0 |
| ruff step | EXE001 and I001, exit 1 | 0 findings, exit 0 |
| ruff step, plus a test file with `import os` | - | F401, exit 1 |
| `actionlint .github/workflows/pre-checks.yaml` | - | exit 0 |
| `python3 -m py_compile bench_models.py` | - | exit 0 |

Unverified:

- The `github-check` reporter with `-fail-level=any`. The first CI run on `main` after merge is the first real run.
- `main` can get a new ruff finding before this PR merges. I will run `ruff check .` on the latest `main` again before merge.
- I did not run `bench_models.py`. The change only moves import lines.

PR-specific question

This PR changes no permissions, no trigger and no secret use. The workflow keeps the `pull_request` trigger (not `pull_request_target`), so code from a fork pull request runs with the read-only `GITHUB_TOKEN`. The two changed inputs are static strings in the workflow file (`version: "26.10.1"` for the black action, `-fail-level=any` for reviewdog). No pull request text or file content becomes part of a command.

Changed op tests

`op_tests/op_benchmarks/triton/model_benchmarking_tool/bench_models.py`: this is a benchmark tool, not a test. The change moves 6 import lines inside the same import section to fix ruff I001. It adds no test and changes no tested behavior.

AI assistance: I used an AI coding assistant to help write this change and this description. I ran and checked all the tests above.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot could not review the current head (for example, quota or service failure)

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@menglcai-amd

Copy link
Copy Markdown
Contributor Author

A short note about the title tags: [Triton/Gluon] and [FlyDSL] come only from two small lint fixes. This PR changes no kernel.

  • bench_models.py (Triton benchmark tool): move 6 import lines to fix ruff I001.
  • aiter/aot/flydsl/gemm.py: file mode 100644 to 100755 to fix ruff EXE001.

I kept these two fixes in this PR because the new ruff check fails on the first push to main without them. If you prefer one PR per backend, I am happy to split it.

@zufayu
zufayu self-requested a review November 20, 2026 01:29
@zufayu zufayu self-assigned this Nov 20, 2026
Copilot AI balanced review requested due to automatic review settings November 20, 2026 05:00

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@zufayu
zufayu merged commit 27a3ab6 into ROCm:main Nov 27, 2026
84 of 87 checks passed
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.

[Documentation]: CONTRIBUTE.md specifies ruff==0.15.7 but CI uses a newer version that enforces additional rules

4 participants