Skip to content

Commit 8eb2272

Browse files
authored
Update torch pin to 11-20 (pytorch#16198)
Upgrading the torch pin, that would be useful for pytorch#16004 Also incorporating issues found by @PetarTerziev-UL
1 parent 3553f0a commit 8eb2272

8 files changed

Lines changed: 44 additions & 20 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b31bad1b8f1331bf43d47f46602cf6141db56844
1+
7a064ed3eafa43f17412d434b395240c727b3000

‎.ci/docker/common/install_pytorch.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1212

1313
install_domains() {
1414
echo "Install torchvision and torchaudio"
15-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}"
16-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}"
15+
pip_install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}"
16+
pip_install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}"
1717
}
1818

1919
install_pytorch_and_domains() {

‎.ci/docker/requirements-ci.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mpmath==1.3.0
22
numpy>=2.0.0; python_version >= '3.10'
33
PyYAML==6.0.1
44
ruamel.yaml==0.18.15
5-
sympy==1.12
5+
sympy>=1.13.3
66
timm==0.6.13
77
tomli==2.0.1
88
torchsr==1.0.4

‎examples/models/moshi/mimi/install_requirements.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
set -x
99

1010
sudo apt install ffmpeg -y
11-
pip install torchcodec==0.7.0.dev20251012 --extra-index-url https://download.pytorch.org/whl/nightly/cpu
11+
pip install torchcodec==0.10.0.dev20251211 --extra-index-url https://download.pytorch.org/whl/nightly/cpu
1212
pip install moshi==0.2.11
1313
pip install bitsandbytes soundfile einops
1414
# Run llama2/install requirements for torchao deps

‎runtime/core/portable_type/c10/c10/util/llvmMathExtras.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ constexpr inline bool isShiftedInt(int64_t x) {
370370
template <unsigned N>
371371
constexpr inline std::enable_if_t<(N < 64), bool> isUInt(uint64_t X) {
372372
static_assert(N > 0, "isUInt<0> doesn't make sense");
373-
return X < (UINT64_C(1) << (N));
373+
return X < (UINT64_C(1) << N);
374374
}
375375
template <unsigned N>
376376
constexpr inline std::enable_if_t<N >= 64, bool> isUInt(uint64_t /*X*/) {

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

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#ifndef C10_MACROS_MACROS_H_
22
#define C10_MACROS_MACROS_H_
3+
4+
#ifdef __cplusplus
35
#include <cassert>
6+
#else
7+
#include <assert.h>
8+
#endif
49

510
/* Main entry for torch/headeronly/macros (used to be c10/macros).
611
*
@@ -139,6 +144,8 @@
139144

140145
#define C10_RESTRICT __restrict
141146

147+
#ifdef __cplusplus
148+
142149
// Simply define the namespace, in case a dependent library want to refer to
143150
// the c10 namespace but not any nontrivial files.
144151
namespace c10 {}
@@ -176,6 +183,8 @@ namespace at::xpu {
176183
using namespace c10::xpu;
177184
} // namespace at::xpu
178185

186+
#endif // __cplusplus
187+
179188
// C10_LIKELY/C10_UNLIKELY
180189
//
181190
// These macros provide parentheses, so you can use these macros as:
@@ -236,7 +245,11 @@ using namespace c10::xpu;
236245

237246
#define C10_ERASE C10_ALWAYS_INLINE C10_ATTR_VISIBILITY_HIDDEN
238247

248+
#ifdef __cplusplus
239249
#include <cstdint>
250+
#else
251+
#include <stdint.h>
252+
#endif
240253

241254
#ifdef __HIPCC__
242255
// Unlike CUDA, HIP requires a HIP header to be included for __host__ to work.
@@ -467,7 +480,7 @@ __host__ __device__
467480
// a non-negligible performance impact even if the assert condition is
468481
// never triggered. We choose to use abort() instead which will still
469482
// terminate the application but without a more useful error message.
470-
#if !defined(C10_USE_ROCM_KERNEL_ASSERT) and defined(USE_ROCM)
483+
#if !defined(C10_USE_ROCM_KERNEL_ASSERT) && defined(USE_ROCM)
471484
#define CUDA_KERNEL_ASSERT(cond) \
472485
if C10_UNLIKELY (!(cond)) { \
473486
abort(); \
@@ -517,9 +530,21 @@ __host__ __device__
517530
__assert_fail( \
518531
#cond, __FILE__, static_cast<unsigned int>(__LINE__), __func__); \
519532
}
520-
#endif // C10_USE_ROCM_KERNEL_ASSERT and USE_ROCM
533+
#endif // C10_USE_ROCM_KERNEL_ASSERT && USE_ROCM
521534
#endif // __APPLE__
522535

536+
// Compile-time switch to control how assertions are logged inside CUDA kernels.
537+
// If C10_CUDA_VERBOSE_ASSERT is defined, CUDA_KERNEL_ASSERT_VERBOSE will
538+
// take addition information passed to the macro and forward them to
539+
// CUDA_KERNEL_ASSERT_PRINTF If C10_CUDA_VERBOSE_ASSERT is not defined,
540+
// CUDA_KERNEL_ASSERT_VERBOSE will behave the same as CUDA_KERNEL_ASSERT.
541+
#ifdef C10_ENABLE_VERBOSE_ASSERT
542+
#define CUDA_KERNEL_ASSERT_VERBOSE(cond, ...) \
543+
CUDA_KERNEL_ASSERT_PRINTF(cond, __VA_ARGS__)
544+
#else
545+
#define CUDA_KERNEL_ASSERT_VERBOSE(cond, ...) CUDA_KERNEL_ASSERT(cond)
546+
#endif
547+
523548
#ifdef __APPLE__
524549
#include <TargetConditionals.h>
525550
#endif
@@ -619,10 +644,7 @@ __host__ __device__
619644
// loading custom extensions compiled against different libtorch
620645
// versions where these APIs may have changed.
621646

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
647+
// Helper macros to handle 1-3 hidden namespace levels when not windows
626648
#define _HIDDEN_NS_GET_MACRO(_1, _2, _3, NAME, ...) NAME
627649
#define _HIDDEN_NS_1(n1) namespace n1 __attribute__((visibility("hidden"))) {
628650
#define _HIDDEN_NS_2(n1, n2) \
@@ -632,13 +654,15 @@ __host__ __device__
632654
namespace n1::n2 { \
633655
namespace n3 __attribute__((visibility("hidden"))) {
634656

635-
// Macros to close namespaces when not windows
657+
// Helper macros to close namespaces when not windows
636658
#define _HIDDEN_NS_END_1(n1) }
637659
#define _HIDDEN_NS_END_N(n1, ...) \
638660
} \
639661
}
640662

641-
// Macros to join strs with :: (for win, where symbols are hidden by default)
663+
// Helper macros to join strs with :: (for win, where symbols are hidden by
664+
// default)
665+
#define _EXPAND(...) __VA_ARGS__
642666
#define _JOIN_GET_MACRO(_1, _2, _3, NAME, ...) NAME
643667
#define _JOIN_NS1(a) a
644668
#define _JOIN_NS2(a, b) a::b
@@ -647,8 +671,8 @@ __host__ __device__
647671
#if !defined(HIDDEN_NAMESPACE_BEGIN)
648672
#if defined(__GNUG__) && !defined(_WIN32)
649673
#define HIDDEN_NAMESPACE_BEGIN(...) \
650-
_EXPAND(_HIDDEN_NS_GET_MACRO( \
651-
__VA_ARGS__, _HIDDEN_NS_3, _HIDDEN_NS_2, _HIDDEN_NS_1)(__VA_ARGS__))
674+
_HIDDEN_NS_GET_MACRO( \
675+
__VA_ARGS__, _HIDDEN_NS_3, _HIDDEN_NS_2, _HIDDEN_NS_1)(__VA_ARGS__)
652676
#else
653677
#define HIDDEN_NAMESPACE_BEGIN(...) \
654678
namespace _EXPAND(_JOIN_GET_MACRO( \
@@ -659,9 +683,9 @@ __host__ __device__
659683
#if !defined(HIDDEN_NAMESPACE_END)
660684
#if defined(__GNUG__) && !defined(_WIN32)
661685
#define HIDDEN_NAMESPACE_END(...) \
662-
_EXPAND(_HIDDEN_NS_GET_MACRO( \
686+
_HIDDEN_NS_GET_MACRO( \
663687
__VA_ARGS__, _HIDDEN_NS_END_N, _HIDDEN_NS_END_N, _HIDDEN_NS_END_1)( \
664-
__VA_ARGS__))
688+
__VA_ARGS__)
665689
#else
666690
#define HIDDEN_NAMESPACE_END(...) }
667691
#endif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ template <typename Limit, typename T>
7979
inline constexpr bool greater_than_max(const T& x) {
8080
constexpr bool can_overflow =
8181
std::numeric_limits<T>::digits > std::numeric_limits<Limit>::digits;
82-
return can_overflow && x > (std::numeric_limits<Limit>::max)();
82+
return can_overflow && x > std::numeric_limits<Limit>::max();
8383
}
8484

8585
#ifdef __GNUC__

‎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 = "dev20251025"
2+
NIGHTLY_VERSION = "dev20251120"

0 commit comments

Comments
 (0)