Skip to content

[lint] Add group_norm* to CLANGTIDY and CLANGFORMAT - #190794

Closed
benjaminglass1 wants to merge 3 commits into
gh/benjaminglass1/165/basefrom
gh/benjaminglass1/165/head
Closed

benjaminglass1 wants to merge 3 commits into
gh/benjaminglass1/165/basefrom
gh/benjaminglass1/165/head

Conversation

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/190794

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 9883c9b with merge base 526b9ce (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
benjaminglass1 added a commit that referenced this pull request Jul 22, 2026

@slayton58 slayton58 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.

The amount of changes looks scary here, but given it's all formatting changes, it looks good.

@benjaminglass1

Copy link
Copy Markdown
Collaborator Author

@slayton58 Yes, I just want to assert here that I did not manually do anything in this PR other than add files to the lint set. Everything else was clang-format.

@Skylion007 Skylion007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly a formatting change right?

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.

Pull request overview

Expands CLANGFORMAT/CLANGTIDY coverage to include group_norm* sources so these files are consistently auto-formatted and linted as part of the lintrunner configuration.

Changes:

  • Extend .lintrunner.toml include patterns to cover aten/src/ATen/native/**/group_norm* (format) and relevant group_norm* paths (tidy).
  • Apply resulting formatting changes to aten/src/ATen/native/group_norm.cpp (mostly reflow/argument formatting and include ordering).
  • Apply resulting formatting changes to aten/src/ATen/native/cpu/group_norm_kernel.cpp (reflow/reindent and minor comment wrapping).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
aten/src/ATen/native/group_norm.cpp Formatting-only adjustments consistent with updated lintrunner coverage.
aten/src/ATen/native/cpu/group_norm_kernel.cpp Formatting-only adjustments consistent with updated lintrunner coverage.
.lintrunner.toml Adds group_norm* globs to CLANGFORMAT/CLANGTIDY include patterns.
Comments suppressed due to low confidence (2)

aten/src/ATen/native/cpu/group_norm_kernel.cpp:448

  • Spelling/grammar: "each HxW plain share" should be "each HxW plane shares".

    //   b. Avoid duplicate calculation of scale/bias, each HxW plain share the
    //   same scale/bias

aten/src/ATen/native/cpu/group_norm_kernel.cpp:1433

  • Spelling/grammar: "larger then" should be "larger than".

  // Generally impl-2 has better performance when HxW is large enough, so that
  // data per thread {NHWC / T} is much larger then temp buffer per thread {2NC}
  constexpr int64_t feature_map_threshold = 2048;

Comment on lines 325 to 327
// Generally impl-2 has better performance when HxW is large enough, so that
// data per thread {NHWC / T} is much larger then temp buffer per thread {2NC}
// data per thread {NHWC / T} is much larger then temp buffer per thread {2NC}
//
Comment on lines 346 to +350
// So it is better to reduce with a vec across all HxW plain,
// and do a horizontal add just once for each {n, g}.
//
auto [mean_val, rstd_val] = ColumnwiseMoments(
X_data + n * HxW * C + g * D,
HxW,
C,
D);
auto [mean_val, rstd_val] =
ColumnwiseMoments(X_data + n * HxW * C + g * D, HxW, C, D);
[ghstack-poisoned]
@benjaminglass1

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 24, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions
github-actions Bot deleted the gh/benjaminglass1/165/head branch August 24, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/docker ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants