Skip to content

Promote -Wglobal-constructors to an error (#6333) - #6333

Open
q10 wants to merge 13 commits into
pytorch:mainfrom
q10:export-D120862981
Open

q10 wants to merge 13 commits into
pytorch:mainfrom
q10:export-D120862981

Conversation

@q10

@q10 q10 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for -Wglobal-constructors. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Reviewed By: r-barnes

Differential Revision: D120862981

@meta-codesync

meta-codesync Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D120862981.

q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
@meta-codesync meta-codesync Bot changed the title Promote -Wglobal-constructors to an error Promote -Wglobal-constructors to an error (#6333) Sep 21, 2026
@q10
q10 force-pushed the export-D120862981 branch from 35b058c to 1491019 Compare September 21, 2026 02:05
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:
Pull Request resolved: pytorch#6333

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
@q10
q10 force-pushed the export-D120862981 branch from 1491019 to 41c1f5f Compare September 21, 2026 02:09
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 21, 2026
Summary:
Pull Request resolved: pytorch#6333

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
@q10
q10 force-pushed the export-D120862981 branch from 41c1f5f to 12bd723 Compare September 21, 2026 07:49
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 22, 2026
Summary:
Pull Request resolved: pytorch#6333

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 22, 2026
Summary:
Pull Request resolved: pytorch#6333

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
@q10
q10 force-pushed the export-D120862981 branch from 12bd723 to ac9bd74 Compare September 22, 2026 20:27
q10 added 10 commits September 22, 2026 13:56
Summary:
Mark contract-required parameters unused in TBE vector and stochastic-rounding helpers.

The affected overloads are unsupported-operation stubs or CUDA/ROCm-specific helpers whose uniform signatures intentionally retain parameters that some configurations do not read. Use unnamed parameters (`/* param */`) where values are never read, and retain `[[maybe_unused]]` for the shuffle mask that is used by CUDA but not ROCm. Make unsupported `Vec4AccT` assertions carry an actionable message without changing supported behavior.

Differential Revision: D121257626
Summary:
Mark parameters unused where TBE portability helpers consume them only on selected GPU platforms or architectures.

The affected embedding, ROCm split-embedding, and warp primitive helpers keep uniform interfaces across CUDA and ROCm. Use unnamed parameters (`/* param */`) for unsupported stubs and values never read, and retain `[[maybe_unused]]` for arguments used only by a platform- or architecture-specific branch.

Differential Revision: D121257627
Summary:
Mark contract-required parameters unused in generated TBE update helpers, cache insertion, and input transposition.

The generated rowwise-Adagrad table-update helper receives optimizer placement and offset arrays through the uniform `split_ref_kernel_args` contract but consumes separately derived scalar values. Silence those helper-local diagnostics in the owning template, while retaining the arrays for the outer GPU kernel that genuinely reads them. Also annotate configuration-specific cache and transpose parameters.

Differential Revision: D121257628
Summary:
Mark contract-required parameters unused in GenAI attention and KV-cache implementations.

The affected parameters belong to architecture-gated attention kernels, Meta implementations, and an intentionally unimplemented paged-cache kernel. Preserve their public and kernel signatures while making the configuration-specific unusedness explicit.

Differential Revision: D121257629
Summary:
Mark contract-required parameters unused across GenAI quantization backends and CK extensions.

The affected Meta functions, version-gated CUDA fallbacks, HIP kernels, and CK wrappers retain stable public signatures across implementations. Add `[[maybe_unused]]` where a particular backend or toolchain configuration intentionally does not consume an argument.

Differential Revision: D121257631
Summary:
Mark API-compatibility parameters unused in GenAI communication and MoE operators.

CAR retains `world_size` and `comm_idx` across backend-compatible entry points even where the current implementation does not consume them. The index-shuffling Meta implementation similarly preserves optional runtime arguments while deriving only output shapes.

Differential Revision: D121257633
Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/3205

Pull Request resolved: pytorch#6339

Remove the mirrored OSS `-Wno-error=unused-parameter` escapes after the configuration-specific source cleanup in prerequisite diffs D121257626, D121257627, D121257628, D121257629, D121257631, and D121257633.

This final diff changes only the two `CppLibrary.cmake` copies, making unused parameters fatal across CXX, nvcc host, and hipcc while keeping the enforcement change independently reviewable.

Differential Revision: D120859871
Summary:
Pull Request resolved: pytorch#6338

Rename three constructor parameters that shadow their destination members: the convolution `transposed` flag and the embedding-statistics batch and bag sizes. This removes the complete `-Wshadow` output observed in the local OSS CPU build without changing initialized values or public argument ordering.

Differential Revision: D120862976
Summary:
Pull Request resolved: pytorch#6337

Remove the CMake, Buck, and Apple-specific shadow-warning demotions from both FBGEMM mirrors. The preceding constructor cleanup eliminates the measured OSS shadow diagnostics, so all supported build paths now enforce `-Wshadow` instead of merely reporting or suppressing it.

Differential Revision: D120862977
Summary:
Pull Request resolved: pytorch#6336

Remove the OSS CMake demotion for `-Wzero-as-null-pointer-constant`. Third-party headers are now treated as system includes, and the full OSS CPU library builds cleanly with the warning fatal, matching internal enforcement.

Differential Revision: D120862978
q10 added 2 commits September 22, 2026 13:58
Summary:
Pull Request resolved: pytorch#6335

Remove the OSS CMake demotion for `-Wattributes`. Full GCC and Clang CPU library builds complete cleanly with the warning fatal.

Differential Revision: D120862979
Summary:
Pull Request resolved: pytorch#6334

Make `-Wunused-but-set-parameter` and `-Wunused-but-set-variable` fatal in the OSS GCC and Clang warning profiles, including the mirrored xplat Buck defaults. Both compiler builds are clean, so the version-gated suppression bucket is no longer needed.

Differential Revision: D120862980
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 22, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Reviewed By: r-barnes

Differential Revision: D120862981
@q10
q10 force-pushed the export-D120862981 branch from ac9bd74 to 2e37630 Compare September 22, 2026 21:02
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 22, 2026
Summary:

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Reviewed By: r-barnes

Differential Revision: D120862981
q10 added a commit to q10/FBGEMM that referenced this pull request Sep 22, 2026
Summary:
Pull Request resolved: pytorch#6333

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Differential Revision: D120862981
Summary:
Pull Request resolved: pytorch#6333

Remove the OSS Clang/HIP and xplat Apple demotions for `-Wglobal-constructors`. The complete OSS Clang CPU library and the internal fbcode FBGEMM package build cleanly with the warning fatal.

Reviewed By: r-barnes

Differential Revision: D120862981
@q10
q10 force-pushed the export-D120862981 branch from 2e37630 to d99e00a Compare September 22, 2026 21:05

This branch has not been deployed

No deployments
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.

1 participant