Use std::bit_cast as c10::bit_cast if available#141035
Use std::bit_cast as c10::bit_cast if available#141035swolchok wants to merge 4 commits intogh/swolchok/701/basefrom
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.
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.
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.
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 |
|
Getting build errors, does this need |
|
(Seems the #include is already there, but something is failing here...) |
| @@ -3,8 +3,19 @@ | |||
| #include <cstring> | |||
| #include <type_traits> | |||
|
|
|||
There was a problem hiding this comment.
This needs #include <version> before testing __cpp_lib_xxx.
(though I think this is unlikely the root cause of my build failures...)
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
Stack from ghstack (oldest at bottom):
Make what we're doing as obvious as possible to the compiler.
Differential Revision: D66108811