From 2a48727bc605a8814aceb0d35caa6171c5ac8530 Mon Sep 17 00:00:00 2001 From: pytorchbot Date: Mon, 19 Oct 2026 09:14:15 +0000 Subject: [PATCH] Bump PyTorch and TorchAO pins for dev20261018 --- .ci/docker/ci_commit_pins/pytorch.txt | 2 +- .../c10/torch/headeronly/macros/Macros.h | 114 +++++++++--------- torch_pin.py | 2 +- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.ci/docker/ci_commit_pins/pytorch.txt b/.ci/docker/ci_commit_pins/pytorch.txt index 257c075fe46..ec22200c7b1 100644 --- a/.ci/docker/ci_commit_pins/pytorch.txt +++ b/.ci/docker/ci_commit_pins/pytorch.txt @@ -1 +1 @@ -e91899ca45f99811049ac7d539820f92a9acddde +b7fb781ec19c6908e73becce6d3a902b5a2c9bef diff --git a/runtime/core/portable_type/c10/torch/headeronly/macros/Macros.h b/runtime/core/portable_type/c10/torch/headeronly/macros/Macros.h index 718bd355b12..ac0e6a3c4f9 100644 --- a/runtime/core/portable_type/c10/torch/headeronly/macros/Macros.h +++ b/runtime/core/portable_type/c10/torch/headeronly/macros/Macros.h @@ -421,6 +421,61 @@ static inline int C10_WARP_SIZE_INTERNAL() { #define __func__ __FUNCTION__ #endif +// The HIDDEN_NAMESPACE_BEGIN and HIDDEN_NAMESPACE_END below +// are needed for maintaining robustness in our header APIs in +// torch/headeronly and torch/csrc/stable under the namespaces +// torch::headeronly and torch::stable respectively. We enforce +// hidden visibility for these APIs because we want to enable +// loading custom extensions compiled against different libtorch +// versions where these APIs may have changed. + +// Helper macros to handle 1-3 hidden namespace levels when not windows +#define _HIDDEN_NS_GET_MACRO(_1, _2, _3, NAME, ...) NAME +#define _HIDDEN_NS_1(n1) namespace n1 __attribute__((visibility("hidden"))) { +#define _HIDDEN_NS_2(n1, n2) \ + namespace n1 { \ + namespace n2 __attribute__((visibility("hidden"))) { +#define _HIDDEN_NS_3(n1, n2, n3) \ + namespace n1::n2 { \ + namespace n3 __attribute__((visibility("hidden"))) { + +// Helper macros to close namespaces when not windows +#define _HIDDEN_NS_END_1(n1) } +#define _HIDDEN_NS_END_N(n1, ...) \ + } \ + } + +// Helper macros to join strs with :: (for win, where symbols are hidden by +// default) +#define _EXPAND(...) __VA_ARGS__ +#define _JOIN_GET_MACRO(_1, _2, _3, NAME, ...) NAME +#define _JOIN_NS1(a) a +#define _JOIN_NS2(a, b) a::b +#define _JOIN_NS3(a, b, c) a::b::c + +#if !defined(HIDDEN_NAMESPACE_BEGIN) +#if defined(__GNUG__) && !defined(_WIN32) +#define HIDDEN_NAMESPACE_BEGIN(...) \ + _HIDDEN_NS_GET_MACRO( \ + __VA_ARGS__, _HIDDEN_NS_3, _HIDDEN_NS_2, _HIDDEN_NS_1)(__VA_ARGS__) +#else +#define HIDDEN_NAMESPACE_BEGIN(...) \ + namespace _EXPAND(_JOIN_GET_MACRO( \ + __VA_ARGS__, _JOIN_NS3, _JOIN_NS2, _JOIN_NS1)(__VA_ARGS__)) { +#endif +#endif + +#if !defined(HIDDEN_NAMESPACE_END) +#if defined(__GNUG__) && !defined(_WIN32) +#define HIDDEN_NAMESPACE_END(...) \ + _HIDDEN_NS_GET_MACRO( \ + __VA_ARGS__, _HIDDEN_NS_END_N, _HIDDEN_NS_END_N, _HIDDEN_NS_END_1)( \ + __VA_ARGS__) +#else +#define HIDDEN_NAMESPACE_END(...) } +#endif +#endif + // CUDA_KERNEL_ASSERT checks the assertion // even when NDEBUG is defined. This is useful for important assertions in CUDA // code that would otherwise be suppressed when building Release. @@ -556,7 +611,7 @@ __host__ __device__ } #else #if defined(USE_ROCM) && defined(__HIP_DEVICE_COMPILE__) -namespace torch::headeronly::detail { +HIDDEN_NAMESPACE_BEGIN(torch, headeronly, detail) // Compile-time string fragment for CUDA_KERNEL_ASSERT message pieces. template struct RoCmAssertLit { @@ -616,7 +671,7 @@ rocm_assert_one_shot(const char (&msg)[N], unsigned length) { __ockl_fprintf_append_string_n(d, msg, length, 1); __builtin_trap(); } -} // namespace torch::headeronly::detail +HIDDEN_NAMESPACE_END(torch, headeronly, detail) #define ROCM_ASSERT_LIT(s) ::torch::headeronly::detail::RoCmAssertLit(s) @@ -772,59 +827,4 @@ rocm_assert_one_shot(const char (&msg)[N], unsigned length) { #define C10_RETURN_MOVE_IF_OLD_COMPILER 0 #endif -// The HIDDEN_NAMESPACE_BEGIN and HIDDEN_NAMESPACE_END below -// are needed for maintaining robustness in our header APIs in -// torch/headeronly and torch/csrc/stable under the namespaces -// torch::headeronly and torch::stable respectively. We enforce -// hidden visibility for these APIs because we want to enable -// loading custom extensions compiled against different libtorch -// versions where these APIs may have changed. - -// Helper macros to handle 1-3 hidden namespace levels when not windows -#define _HIDDEN_NS_GET_MACRO(_1, _2, _3, NAME, ...) NAME -#define _HIDDEN_NS_1(n1) namespace n1 __attribute__((visibility("hidden"))) { -#define _HIDDEN_NS_2(n1, n2) \ - namespace n1 { \ - namespace n2 __attribute__((visibility("hidden"))) { -#define _HIDDEN_NS_3(n1, n2, n3) \ - namespace n1::n2 { \ - namespace n3 __attribute__((visibility("hidden"))) { - -// Helper macros to close namespaces when not windows -#define _HIDDEN_NS_END_1(n1) } -#define _HIDDEN_NS_END_N(n1, ...) \ - } \ - } - -// Helper macros to join strs with :: (for win, where symbols are hidden by -// default) -#define _EXPAND(...) __VA_ARGS__ -#define _JOIN_GET_MACRO(_1, _2, _3, NAME, ...) NAME -#define _JOIN_NS1(a) a -#define _JOIN_NS2(a, b) a::b -#define _JOIN_NS3(a, b, c) a::b::c - -#if !defined(HIDDEN_NAMESPACE_BEGIN) -#if defined(__GNUG__) && !defined(_WIN32) -#define HIDDEN_NAMESPACE_BEGIN(...) \ - _HIDDEN_NS_GET_MACRO( \ - __VA_ARGS__, _HIDDEN_NS_3, _HIDDEN_NS_2, _HIDDEN_NS_1)(__VA_ARGS__) -#else -#define HIDDEN_NAMESPACE_BEGIN(...) \ - namespace _EXPAND(_JOIN_GET_MACRO( \ - __VA_ARGS__, _JOIN_NS3, _JOIN_NS2, _JOIN_NS1)(__VA_ARGS__)) { -#endif -#endif - -#if !defined(HIDDEN_NAMESPACE_END) -#if defined(__GNUG__) && !defined(_WIN32) -#define HIDDEN_NAMESPACE_END(...) \ - _HIDDEN_NS_GET_MACRO( \ - __VA_ARGS__, _HIDDEN_NS_END_N, _HIDDEN_NS_END_N, _HIDDEN_NS_END_1)( \ - __VA_ARGS__) -#else -#define HIDDEN_NAMESPACE_END(...) } -#endif -#endif - #endif // C10_MACROS_MACROS_H_ diff --git a/torch_pin.py b/torch_pin.py index 5737d105625..187d1c0047a 100644 --- a/torch_pin.py +++ b/torch_pin.py @@ -1,2 +1,2 @@ TORCH_VERSION = "2.14.0" -NIGHTLY_VERSION = "dev20261004" +NIGHTLY_VERSION = "dev20261018"