8000 [BE] Use `C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED` by malfet · Pull Request #148354 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[BE] Use C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED #148354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

malfet
Copy link
Contributor
@malfet malfet commented Mar 3, 2025

Stack from ghstack (oldest at bottom):

Instead of #pragma GCC diagnostic ignored "-Wignored-qualifiers"
Also limit the scope to just Vectorized::map that has to be declared that way due to sleef function signature definitions that return const __m256 for AVX2 methods

Also delete #pragma GCC diagnostic pop from vec256_half and vec256_bfloat16 as it results in an unbalanced pop warning, for push that is defined in vec256_16bit_float, which will be included only once

In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec.h:7:
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256.h:15:
/Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256_half.h:232:27: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
  232 | #pragma GCC diagnostic pop
      |                           ^
1 warning generated.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10

[ghstack-poisoned]
@pytorch-bot pytorch-bot bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Mar 3, 2025
Copy link
pytorch-bot bot commented Mar 3, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit b103835 with merge base aade4fb (image):
💚 Looks good so far! There are no failures yet. 💚

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

malfet added a commit that referenced this pull request Mar 3, 2025
Instead of `#pragma GCC diagnostic ignored "-Wignored-qualifiers"`
Also limit the scope to just `Vectorized::map` that has to be declared that way due to sleef function signature definitions that return `const __m256` for AVX2 methods

Also delete `#pragma GCC diagnostic pop` from vec256_half and vec256_bfloat16 as it results in an unbalanced pop warning, for push that is defined in vec256_16bit_float, which will be included only once
```
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec.h:7:
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256.h:15:
/Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256_half.h:232:27: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
  232 | #pragma GCC diagnostic pop
      |                           ^
1 warning generated.

```

ghstack-source-id: 8495465
Pull Request resolved: #148354
@malfet malfet added release notes: build release notes category topic: bug fixes topic category topic: build labels Mar 3, 2025
Copy link
Contributor
@ZainRizvi ZainRizvi left a comment

Choose a reason for hiding this comment

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

As someone unfamiliar with these defines, what makes C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED better than #pragma GCC diagnostic ignored "-Wignored-qualifiers"?

@malfet
Copy link
Contributor Author
malfet commented Mar 3, 2025

As someone unfamiliar with these defines, what makes C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED better than #pragma GCC diagnostic ignored "-Wignored-qualifiers"?

C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED is more compiler agnostic and suppresses the same warning on both GCC and CLANG if such warning is defined for the platform, while #pragma GCC diagnostic ignored only works on for GCC

@malfet
Copy link
Contributor Author
malfet commented Mar 3, 2025

@pytorchbot merge -f "Claude believes this PR is good"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

pytorchmergebot pushed a commit that referenced this pull request Mar 3, 2025
Yet another regression caused by #146596 that breaks builds if PyTorch is compiled for Android or using NVIDIA GraceHopper systems

Not sure why author was trying to change the conditon to begin with

Pull Request resolved: #148362
Approved by: https://github.com/izaitsevfb
ghstack dependencies: #148354
majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Mar 4, 2025
Instead of `#pragma GCC diagnostic ignored "-Wignored-qualifiers"`
Also limit the scope to just `Vectorized::map` that has to be declared that way due to sleef function signature definitions that return `const __m256` for AVX2 methods

Also delete `#pragma GCC diagnostic pop` from vec256_half and vec256_bfloat16 as it results in an unbalanced pop warning, for push that is defined in vec256_16bit_float, which will be included only once
```
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec.h:7:
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256.h:15:
/Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256_half.h:232:27: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
  232 | #pragma GCC diagnostic pop
      |                           ^
1 warning generated.

```

Pull Request resolved: pytorch#148354
Approved by: https://github.com/izaitsevfb
majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Mar 4, 2025
…48362)

Yet another regression caused by pytorch#146596 that breaks builds if PyTorch is compiled for Android or using NVIDIA GraceHopper systems

Not sure why author was trying to change the conditon to begin with

Pull Request resolved: pytorch#148362
Approved by: https://github.com/izaitsevfb
ghstack dependencies: pytorch#148354
pytorchmergebot pushed a commit to min-jean-cho/pytorch that referenced this pull request Mar 5, 2025
Instead of `#pragma GCC diagnostic ignored "-Wignored-qualifiers"`
Also limit the scope to just `Vectorized::map` that has to be declared that way due to sleef function signature definitions that return `const __m256` for AVX2 methods

Also delete `#pragma GCC diagnostic pop` from vec256_half and vec256_bfloat16 as it results in an unbalanced pop warning, for push that is defined in vec256_16bit_float, which will be included only once
```
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec.h:7:
In file included from /Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256.h:15:
/Users/malfet/git/pytorch/pytorch/aten/src/ATen/cpu/vec/vec256/vec256_half.h:232:27: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
  232 | #pragma GCC diagnostic pop
      |                           ^
1 warning generated.

```

Pull Request resolved: pytorch#148354
Approved by: https://github.com/izaitsevfb
pytorchmergebot pushed a commit to min-jean-cho/pytorch that referenced this pull request Mar 5, 2025
…48362)

Yet another regression caused by pytorch#146596 that breaks builds if PyTorch is compiled for Android or using NVIDIA GraceHopper systems

Not sure why author was trying to change the conditon to begin with

Pull Request resolved: pytorch#148362
Approved by: https://github.com/izaitsevfb
ghstack dependencies: pytorch#148354
@github-actions github-actions bot deleted the gh/malfet/208/head branch April 4, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged module: cpu CPU specific problem (e.g., perf, algorithm) release notes: build release notes category topic: bug fixes topic category topic: build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0