-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Use std::bit_cast as c10::bit_cast if available #141035
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
Conversation
Make what we're doing as obvious as possible to the compiler. Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/141035
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 7f3d535 with merge base 33191bb ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D66108811 |
Make what we're doing as obvious as possible to the compiler. Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/) [ghstack-poisoned]
Pull Request resolved: #141035 Make what we're doing as obvious as possible to the compiler. ghstack-source-id: 254339612 @exported-using-ghexport Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/)
| #include <bit> | ||
| #define C10_HAVE_STD_BIT_CAST 1 | ||
| #else | ||
| #define C10_HAVE_STD_BIT_CAST 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar logic to the prev PR. Does this macro serve any useful purpose. Main difference is whether bit_cast is constexpr I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking, it would be good to move those C10_HAVE_... macros to say c10/macros/Macros.h or define new Compiler.h there
As defining those in various headers can lead to a potential duplication and than divergence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to avoid duplicating the condition in this file.
defining those in various headers
what other header would reasonably define or consume this? this is the bit_cast header.
I can update the diff to undefine its temporary macro
Make what we're doing as obvious as possible to the compiler. Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/) [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D66108811 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D66108811 |
Make what we're doing as obvious as possible to the compiler. Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/) [ghstack-poisoned]
Pull Request resolved: #141035 Make what we're doing as obvious as possible to the compiler. ghstack-source-id: 254364210 @exported-using-ghexport Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/)
|
This pull request was exported from Phabricator. Differential Revision: D66108811 |
|
@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 |
- Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed
|
Getting build errors, does this need |
- Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed
|
(Seems the #include is already there, but something is failing here...) |
|
|
||
| #include <cstring> | ||
| #include <type_traits> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs #include <version> before testing __cpp_lib_xxx.
(though I think this is unlikely the root cause of my build failures...)
- Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed - Deprecate support for CUDA 12.1 and add support for 12.6, per changes in pytorch/pytorch#138899
- Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed - Deprecate support for CUDA 12.1 and add initial support for 12.6, per changes in pytorch/pytorch#138899
- Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed - Deprecate support for CUDA 12.1 and add initial support for 12.6, per changes in pytorch/pytorch#138899
- Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed - Deprecate support for CUDA 12.1 and add initial support for 12.6, per changes in pytorch/pytorch#138899
Summary: X-link: facebookresearch/FBGEMM#486 - Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed - Deprecate support for CUDA 12.1 and add support for 12.6, per changes in pytorch/pytorch#138899 Pull Request resolved: #3398 Reviewed By: sryap Differential Revision: D66277492 Pulled By: q10 fbshipit-source-id: 24817efb5c07c1985ab3beeb1610879edbd81acc
Make what we're doing as obvious as possible to the compiler. Differential Revision: [D66108811](https://our.internmc.facebook.com/intern/diff/D66108811/) Pull Request resolved: pytorch#141035 Approved by: https://github.com/Skylion007, https://github.com/ezyang, https://github.com/malfet ghstack dependencies: pytorch#140564, pytorch#140565, pytorch#140566, pytorch#140567, pytorch#140720, pytorch#140994
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: TorchRec CI currently is failing with issues on incompatible GLIBCXX version. The cause is that FBGEMM now requires g++ 11.1+ for building binaries that reference GLIBCXX_3.4.29 (as of pytorch/pytorch#141035) As recommended in https://github.com/pytorch/FBGEMM/blob/main/.github/scripts/utils_build.bash and pytorch/FBGEMM#3423, install GCC using conda to control glibcxx version being used. Differential Revision: D67607624
Summary: Pull Request resolved: facebookresearch/FBGEMM#486 - Upgrade gcc version to support newer libstdc++, which is required now that pytorch/pytorch#141035 has landed - Deprecate support for CUDA 12.1 and add support for 12.6, per changes in pytorch/pytorch#138899 X-link: pytorch#3398 Reviewed By: sryap Differential Revision: D66277492 Pulled By: q10 fbshipit-source-id: 24817efb5c07c1985ab3beeb1610879edbd81acc
Stack from ghstack (oldest at bottom):
Make what we're doing as obvious as possible to the compiler.
Differential Revision: D66108811