Skip to content

Commit 3405317

Browse files
authored
Bump torch pin (#15614)
Bump torch pin
1 parent 692825d commit 3405317

File tree

10 files changed

+75
-15
lines changed

10 files changed

+75
-15
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
556fc09a9f67f24ca5591ec049c5d0c347c5f62a
1+
b31bad1b8f1331bf43d47f46602cf6141db56844

install_requirements.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ def install_optional_example_requirements(use_pytorch_nightly):
130130
if use_pytorch_nightly
131131
else "torchvision"
132132
),
133-
f"torchaudio==2.8.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torchaudio",
133+
(
134+
f"torchaudio==2.10.0.{NIGHTLY_VERSION}"
135+
if use_pytorch_nightly
136+
else "torchaudio"
137+
),
134138
]
135139
# Then install domain libraries
136140
subprocess.run(

runtime/core/portable_type/c10/torch/headeronly/macros/Macros.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,4 +611,60 @@ __host__ __device__
611611
#define C10_RETURN_MOVE_IF_OLD_COMPILER 0
612612
#endif
613613

614+
// The HIDDEN_NAMESPACE_BEGIN and HIDDEN_NAMESPACE_END below
615+
// are needed for maintaining robustness in our header APIs in
616+
// torch/headeronly and torch/csrc/stable under the namespaces
617+
// torch::headeronly and torch::stable respectively. We enforce
618+
// hidden visibility for these APIs because we want to enable
619+
// loading custom extensions compiled against different libtorch
620+
// versions where these APIs may have changed.
621+
622+
// Helper macros for nested namespace expansion
623+
#define _EXPAND(...) __VA_ARGS__
624+
625+
// Macros to handle 1-3 hidden namespace levels when not windows
626+
#define _HIDDEN_NS_GET_MACRO(_1, _2, _3, NAME, ...) NAME
627+
#define _HIDDEN_NS_1(n1) namespace n1 __attribute__((visibility("hidden"))) {
628+
#define _HIDDEN_NS_2(n1, n2) \
629+
namespace n1 { \
630+
namespace n2 __attribute__((visibility("hidden"))) {
631+
#define _HIDDEN_NS_3(n1, n2, n3) \
632+
namespace n1::n2 { \
633+
namespace n3 __attribute__((visibility("hidden"))) {
634+
635+
// Macros to close namespaces when not windows
636+
#define _HIDDEN_NS_END_1(n1) }
637+
#define _HIDDEN_NS_END_N(n1, ...) \
638+
} \
639+
}
640+
641+
// Macros to join strs with :: (for win, where symbols are hidden by default)
642+
#define _JOIN_GET_MACRO(_1, _2, _3, NAME, ...) NAME
643+
#define _JOIN_NS1(a) a
644+
#define _JOIN_NS2(a, b) a::b
645+
#define _JOIN_NS3(a, b, c) a::b::c
646+
647+
#if !defined(HIDDEN_NAMESPACE_BEGIN)
648+
#if defined(__GNUG__) && !defined(_WIN32)
649+
#define HIDDEN_NAMESPACE_BEGIN(...) \
650+
_EXPAND(_HIDDEN_NS_GET_MACRO( \
651+
__VA_ARGS__, _HIDDEN_NS_3, _HIDDEN_NS_2, _HIDDEN_NS_1)(__VA_ARGS__))
652+
#else
653+
#define HIDDEN_NAMESPACE_BEGIN(...) \
654+
namespace _EXPAND(_JOIN_GET_MACRO( \
655+
__VA_ARGS__, _JOIN_NS3, _JOIN_NS2, _JOIN_NS1)(__VA_ARGS__)) {
656+
#endif
657+
#endif
658+
659+
#if !defined(HIDDEN_NAMESPACE_END)
660+
#if defined(__GNUG__) && !defined(_WIN32)
661+
#define HIDDEN_NAMESPACE_END(...) \
662+
_EXPAND(_HIDDEN_NS_GET_MACRO( \
663+
__VA_ARGS__, _HIDDEN_NS_END_N, _HIDDEN_NS_END_N, _HIDDEN_NS_END_1)( \
664+
__VA_ARGS__))
665+
#else
666+
#define HIDDEN_NAMESPACE_END(...) }
667+
#endif
668+
#endif
669+
614670
#endif // C10_MACROS_MACROS_H_

runtime/core/portable_type/c10/torch/headeronly/util/BFloat16.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ inline C10_HOST_DEVICE bool operator<(BFloat16& lhs, BFloat16& rhs) {
395395
C10_CLANG_DIAGNOSTIC_POP()
396396
} // namespace c10
397397

398-
namespace torch::headeronly {
398+
HIDDEN_NAMESPACE_BEGIN(torch, headeronly)
399399

400400
namespace detail {
401401
using c10::detail::bits_from_f32;
@@ -415,7 +415,7 @@ using c10::operator/=;
415415
using c10::operator<;
416416
using c10::operator>;
417417
using c10::operator<<;
418-
} // namespace torch::headeronly
418+
HIDDEN_NAMESPACE_END(torch, headeronly)
419419

420420
namespace std {
421421

runtime/core/portable_type/c10/torch/headeronly/util/Half.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ C10_CLANG_DIAGNOSTIC_POP()
698698

699699
} // namespace c10
700700

701-
namespace torch::headeronly {
701+
HIDDEN_NAMESPACE_BEGIN(torch, headeronly)
702702

703703
using c10::Half;
704704
using c10::operator+;
@@ -724,7 +724,7 @@ using c10::detail::fp16_ieee_to_fp32_bits;
724724
using c10::detail::fp16_ieee_to_fp32_value;
725725
} // namespace detail
726726

727-
} // namespace torch::headeronly
727+
HIDDEN_NAMESPACE_END(torch, headeronly)
728728

729729
namespace std {
730730

runtime/core/portable_type/c10/torch/headeronly/util/TypeSafeSignMath.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ inline constexpr bool less_than_lowest(const T& x) {
139139

140140
C10_CLANG_DIAGNOSTIC_POP()
141141

142-
namespace torch::headeronly {
142+
HIDDEN_NAMESPACE_BEGIN(torch, headeronly)
143143
using c10::greater_than_max;
144144
using c10::is_negative;
145145
using c10::less_than_lowest;
146146
using c10::signs_differ;
147147
using c10::signum;
148-
} // namespace torch::headeronly
148+
HIDDEN_NAMESPACE_END(torch, headeronly)

runtime/core/portable_type/c10/torch/headeronly/util/bit_cast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#endif // __has_include(<bit>) && (__cplusplus >= 202002L ||
1414
// (defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L))
1515

16-
namespace torch::headeronly {
16+
HIDDEN_NAMESPACE_BEGIN(torch, headeronly)
1717

1818
#if C10_HAVE_STD_BIT_CAST
1919
using std::bit_cast;
@@ -43,7 +43,7 @@ bit_cast(const From& src) noexcept {
4343
#endif // C10_HAVE_STD_BIT_CAST
4444
#undef C10_HAVE_STD_BIT_CAST
4545

46-
} // namespace torch::headeronly
46+
HIDDEN_NAMESPACE_END(torch, headeronly)
4747

4848
namespace c10 {
4949
using torch::headeronly::bit_cast;

runtime/core/portable_type/c10/torch/headeronly/util/complex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ struct alignas(4) complex<Half> {
590590

591591
} // namespace c10
592592

593-
namespace torch::headeronly {
593+
HIDDEN_NAMESPACE_BEGIN(torch, headeronly)
594594
using c10::complex;
595595
using c10::operator+;
596596
using c10::operator-;
@@ -611,6 +611,6 @@ using c10::complex_literals::operator""_if;
611611
using c10::complex_literals::operator""_id;
612612
} // namespace complex_literals
613613

614-
} // namespace torch::headeronly
614+
HIDDEN_NAMESPACE_END(torch, headeronly)
615615

616616
C10_CLANG_DIAGNOSTIC_POP()

runtime/core/portable_type/c10/torch/headeronly/util/floating_point_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <torch/headeronly/util/bit_cast.h>
55
#include <cstdint>
66

7-
namespace torch::headeronly::detail {
7+
HIDDEN_NAMESPACE_BEGIN(torch, headeronly, detail)
88

99
C10_HOST_DEVICE inline float fp32_from_bits(uint32_t w) {
1010
#if defined(__OPENCL_VERSION__)
@@ -30,7 +30,7 @@ C10_HOST_DEVICE inline uint32_t fp32_to_bits(float f) {
3030
#endif
3131
}
3232

33-
} // namespace torch::headeronly::detail
33+
HIDDEN_NAMESPACE_END(torch, headeronly, detail)
3434

3535
namespace c10::detail {
3636
using torch::headeronly::detail::fp32_from_bits;

torch_pin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
TORCH_VERSION = "2.10.0"
2-
NIGHTLY_VERSION = "dev20251017"
2+
NIGHTLY_VERSION = "dev20251025"

0 commit comments

Comments
 (0)