Repository navigation
[lint] Add group_norm* to CLANGTIDY and CLANGFORMAT - #190794
benjaminglass1 wants to merge 3 commits into
Conversation
🔗 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 FailuresAs of commit 9883c9b with merge base 526b9ce ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
slayton58
left a comment
There was a problem hiding this comment.
The amount of changes looks scary here, but given it's all formatting changes, it looks good.
|
@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 |
Skylion007
left a comment
There was a problem hiding this comment.
This is mostly a formatting change right?
There was a problem hiding this comment.
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.tomlinclude patterns to coveraten/src/ATen/native/**/group_norm*(format) and relevantgroup_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;
| // 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} | ||
| // |
| // 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); |
|
@pytorchbot merge |
Merge startedYour 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 |
Pull Request resolved: pytorch#190794 Approved by: https://github.com/slayton58, https://github.com/Skylion007 ghstack dependencies: pytorch#186414, pytorch#190246
Pull Request resolved: pytorch#190794 Approved by: https://github.com/slayton58, https://github.com/Skylion007 ghstack dependencies: pytorch#186414, pytorch#190246
Pull Request resolved: pytorch#190794 Approved by: https://github.com/slayton58, https://github.com/Skylion007 ghstack dependencies: pytorch#186414, pytorch#190246
Stack from ghstack (oldest at bottom):
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @aditew01