Skip to content

ci: enforce pre-commit style check via GitHub Actions - #741

Merged
Anerudhan merged 2 commits into
NVIDIA:developfrom
Anerudhan:gha-precommit-style
Aug 25, 2026
Merged

ci: enforce pre-commit style check via GitHub Actions#741
Anerudhan merged 2 commits into
NVIDIA:developfrom
Anerudhan:gha-precommit-style

Conversation

@Anerudhan

@Anerudhan Anerudhan commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

What

Adds .github/workflows/pre-commit.yml: a Style check workflow that runs pre-commit run --all-files on every PR and on pushes to develop/main, on a plain ubuntu-latest runner (no GPU). Hook environments are cached keyed on the config hash, so steady-state runs take seconds.

This enforces in CI exactly what CONTRIBUTING.md already asks contributors to run locally — clang-format v21.1.6 for C++/CUDA and black 26.3.1 (line length 160) for Python/notebooks, as pinned in .pre-commit-config.yaml — replacing the internal analysis:clang-format GitLab job (removed separately), which used unpinned tool versions from the CI image and occupied a GPU runner for a pure text check.

Included cleanup

  • One-time black fix for the 3 files the hook currently flags (benchmark/attention_inference/benchmark_single_attention.py, benchmark/attention_inference/configs/qwen3vl_vit.py, test/python/sdpa/frost/test_sdpa_fwd_dsl_sm100.py) so the check passes from day one. benchmark/ was never covered by the old script, which is how these drifted.
  • Fix a stale frost README reference to the internal-only ci/run_style_check_diff.sh (points to pre-commit run --all-files now).

Verification

pre-commit run --all-files passes locally on this branch (clang-format, black, black-jupyter all green). The workflow itself will run on this PR.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Added automated formatting checks for pull requests and pushes to the primary development branches.
    • Formatting checks now provide clear, colorized differences when validation fails.
  • Documentation

    • Updated contributor guidance to use the current pre-commit formatting workflow.
  • Style

    • Standardized formatting across attention benchmarks, vision configuration files, and SDPA tests without changing runtime behavior.

Anerudhan and others added 2 commits August 25, 2026 15:08
pre-commit's black hook (26.3.1, line-length 160) reformats these three
files; clean them up so `pre-commit run --all-files` passes in CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Runs `pre-commit run --all-files` (clang-format v21.1.6 + black 26.3.1,
as pinned in .pre-commit-config.yaml) on every PR and on pushes to
develop/main, on a plain ubuntu-latest runner — no GPU needed. This
replaces the internal analysis:clang-format CI job and enforces the
formatting contract already documented in CONTRIBUTING.md.

Also fix a stale reference to ci/run_style_check_diff.sh in the frost
README (that script is internal-only and superseded by pre-commit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5a9ff017-5536-45de-ab53-c424f896a92e

📥 Commits

Reviewing files that changed from the base of the PR and between 36a06c4 and 6184c1c.

📒 Files selected for processing (5)
  • .github/workflows/pre-commit.yml
  • benchmark/attention_inference/benchmark_single_attention.py
  • benchmark/attention_inference/configs/qwen3vl_vit.py
  • python/cudnn/frost/README.md
  • test/python/sdpa/frost/test_sdpa_fwd_dsl_sm100.py

📝 Walkthrough

Walkthrough

The change adds a pre-commit GitHub Actions workflow, updates the FROST formatting command documentation, and applies formatting-only changes to benchmark, configuration, and test files.

Changes

Pre-commit alignment

Layer / File(s) Summary
Pre-commit CI and contributor workflow
.github/workflows/pre-commit.yml, python/cudnn/frost/README.md
The workflow runs all pre-commit hooks on pull requests and pushes to develop or main. The README documents the same command.
Formatting normalization
benchmark/attention_inference/..., test/python/sdpa/frost/test_sdpa_fwd_dsl_sm100.py
Formatting changes preserve benchmark arguments, configuration values, test arguments, and output behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: vedaanta

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Anerudhan Anerudhan added mod-frontend cuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers. cat-ci CI failures, test flakiness, workflow breakage, or automation issues. orig-nv-eng Reported or requested by NVIDIA engineering. labels Aug 25, 2026
@Anerudhan Anerudhan self-assigned this Aug 25, 2026
@Anerudhan
Anerudhan marked this pull request as ready for review August 25, 2026 22:21
@Anerudhan
Anerudhan merged commit f0dda78 into NVIDIA:develop Aug 25, 2026
7 of 10 checks passed
@Anerudhan Anerudhan mentioned this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat-ci CI failures, test flakiness, workflow breakage, or automation issues. mod-frontend cuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers. orig-nv-eng Reported or requested by NVIDIA engineering.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant