Skip to content

Commit 7e860cc

Browse files
Gasoonjiafacebook-github-bot
authored andcommitted
bunp up pytorch nightly version (#12407)
Summary: Pull Request resolved: #12407 as title Reviewed By: shoumikhin Differential Revision: D78181215
1 parent b0fd9da commit 7e860cc

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7cda4017ddda554752e89069ae205be5e8388f59
1+
87b2ac5d1992c9b4f4167517251b99b513c328a8

install_requirements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def python_is_compatible():
7171
#
7272
# NOTE: If you're changing, make the corresponding change in .ci/docker/ci_commit_pins/pytorch.txt
7373
# by picking the hash from the same date in https://hud.pytorch.org/hud/pytorch/pytorch/nightly/
74-
NIGHTLY_VERSION = "dev20250706"
74+
NIGHTLY_VERSION = "dev20250711"
7575

7676

7777
def install_requirements(use_pytorch_nightly):

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// 1 bit for the sign, 8 bits for the exponent and 7 bits for the mantissa.
55

66
#include <c10/macros/Macros.h>
7+
#include <c10/util/bit_cast.h>
78
#include <cmath>
89
#include <cstdint>
910
#include <cstring>
@@ -67,13 +68,7 @@ inline C10_HOST_DEVICE uint16_t round_to_nearest_even(float src) {
6768
#endif
6869
return UINT16_C(0x7FC0);
6970
} else {
70-
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
71-
union {
72-
uint32_t U32; // NOLINT(facebook-hte-BadMemberName)
73-
float F32; // NOLINT(facebook-hte-BadMemberName)
74-
};
75-
76-
F32 = src;
71+
const uint32_t U32 = c10::bit_cast<uint32_t>(src);
7772
uint32_t rounding_bias = ((U32 >> 16) & 1) + UINT32_C(0x7FFF);
7873
return static_cast<uint16_t>((U32 + rounding_bias) >> 16);
7974
}
@@ -111,9 +106,7 @@ struct alignas(2) BFloat16 {
111106
#endif
112107
};
113108

114-
C10_API inline std::ostream& operator<<(
115-
std::ostream& out,
116-
const BFloat16& value) {
109+
inline std::ostream& operator<<(std::ostream& out, const BFloat16& value) {
117110
out << (float)value;
118111
return out;
119112
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ struct alignas(2) Half {
414414
#endif
415415
};
416416

417-
C10_API inline std::ostream& operator<<(std::ostream& out, const Half& value) {
417+
inline std::ostream& operator<<(std::ostream& out, const Half& value) {
418418
out << (float)value;
419419
return out;
420420
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <cstring>
44
#include <type_traits>
55

6+
#include <c10/macros/Macros.h>
7+
68
#if __has_include(<bit>) && (defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L)
79
#include <bit>
810
#define C10_HAVE_STD_BIT_CAST 1
@@ -23,7 +25,7 @@ using std::bit_cast;
2325
// See https://en.cppreference.com/w/cpp/numeric/bit_cast for more
2426
// information as well as the source of our implementations.
2527
template <class To, class From>
26-
std::enable_if_t<
28+
C10_HOST_DEVICE std::enable_if_t<
2729
sizeof(To) == sizeof(From) && std::is_trivially_copyable_v<From> &&
2830
std::is_trivially_copyable_v<To>,
2931
To>

0 commit comments

Comments
 (0)