Repository navigation
[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
Conversation
- 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
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
|
A short note about the title tags:
I kept these two fixes in this PR because the new ruff check fails on the first push to |
Summary
Fix #4423
This PR makes the lint versions in
CONTRIBUTE.mdthe same as the CI versions (black==26.10.1,ruff==0.16.0), pins black in CI to26.10.1, and makes the ruff check onmainable to fail. It also fixes the few ruff findings on the current HEAD ofmain(a708209), so that the new check does not fail on the first push after merge.Base:
mainata708209582f3c59837588b2f89a8e2a62c0ca6a0(#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.mdgivesblack==26.3.0 ruff==0.15.7, but CI usesblack==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:
psf/black@stablewith no version, so CI moves to each new black release.main. On push, reviewdog maps the deprecated-fail-on-errorto 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 onmain. There are 2 such findings onmainnow:aiter/aot/flydsl/gemm.pyop_tests/op_benchmarks/triton/model_benchmarking_tool/bench_models.pyChanges
.github/workflows/pre-checks.yaml, black job: addversion: "26.10.1". This is the version thatpsf/black@stableinstalls on the base now, so no verdict changes..github/workflows/pre-checks.yaml, ruff job: replace-fail-on-error=truewith-fail-level=any. Pull requests have no change, because-fail-on-erroralready maps toanyfor the pull request reporter. On push tomain, a ruff finding now fails the job.aiter/aot/flydsl/gemm.py: mode100644to100755(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: changeblack==26.3.0 ruff==0.15.7toblack==26.10.1 ruff==0.16.0.Testing
No GPU code changes. The tests are lint runs on a CPU only. See "Validation and unverified scope" below.
Documentation
Dependencies
Breaking Changes
None
PR Self-Review
Reviewed revision
ee895e2
Behavior and intent
Before this PR, the lint versions in
CONTRIBUTE.mddo not agree with CI, the black version in CI changes with each black release, and the ruff job onmaincannot fail. After this PR,CONTRIBUTE.mdgives the CI versions, CI uses black 26.10.1 until someone changes the pin,mainhas no ruff finding, and a ruff finding onmainfails 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
a708209onmain: run 44548549788 (push event, conclusionsuccess).Successfully installed ruff-0.16.0reviewdog/reviewdog info found version: 0.21.3 for v0.21.3/Linux/x86_64REVIEWDOG_REPORTER: github-check,REVIEWDOG_FILTER_MODE: nofilterreviewdog: -fail-on-error is deprecated. Use -fail-level=any, or -fail-level=error for github-[pr-]check reporter instead.Installing black[colorama]==26.10.1...1879 files would be left unchanged.The reviewdog
ruffcheck run of the base, 135645965872, has conclusionneutraland 2 annotations (EXE001 ingemm.py, I001 inbench_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).Successfully installed ruff-0.16.0reviewdog/reviewdog info found version: 0.21.3 for v0.21.3/Linux/x86_64REVIEWDOG_REPORTER: github-pr-review,REVIEWDOG_FILTER_MODE: diff_context-fail-level=anyInstalling black[colorama]==26.10.1...1879 files would be left unchanged.The ruff job gives no finding and no review comment. The
-fail-on-error is deprecatedwarning 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.0andblack==26.10.1in venvs, reviewdog v0.21.3 and actionlint v1.7.7 release binaries. The trees aregit archiveoutput 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.a708209c753edaruff check .All checks passed!, exit 0black --check .import osactionlint .github/workflows/pre-checks.yamlpython3 -m py_compile bench_models.pyUnverified:
github-checkreporter with-fail-level=any. The first CI run onmainafter merge is the first real run.maincan get a new ruff finding before this PR merges. I will runruff check .on the latestmainagain before merge.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_requesttrigger (notpull_request_target), so code from a fork pull request runs with the read-onlyGITHUB_TOKEN. The two changed inputs are static strings in the workflow file (version: "26.10.1"for the black action,-fail-level=anyfor 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.