Repository navigation
Commit af6454e
Bump the PyTorch pin to 2.14 (pytorch#22501)
## Summary
PyTorch 2.14.0 is released, so move the pin from 2.13 to it. The tree is
mid-cycle at 1.5.0 and the pin normally follows the current stable
release.
The pin itself is a few version strings plus a re-sync of the vendored
c10 headers, which CI requires to match PyTorch's tree byte for byte.
Everything else here is a change 2.14 forces, each as its own commit.
## What 2.14 forces
**C++20 where ATen headers are compiled.** `intrusive_ptr.h` uses
`operator<=>` and `TensorBase.h` uses `requires`, neither guarded, so a
target that includes ATen cannot parse at C++17. This follows the
pattern already in the tree: six CMake targets set `CXX_STANDARD 20` for
exactly this reason. Added the Vulkan op tests to that list, and taught
the Buck wrapper to make the same per-target distinction. Non-ATen
targets, including everything the bare-metal presets build, still
compile at C++17.
**Two new AOTI entry points.** 2.14's generated wrapper calls
`aoti_torch_is_defined` and `aoti_torch_empty_strided_pinned`, neither
of which existed here. The first answers whether a tensor holds storage.
The second allocates ordinary host memory, because there is no pinned
allocator in this runtime and pinning only lets a copy to the device
overlap other work. It refuses a device other than CPU, as PyTorch's own
does.
**Derived shim spellings.** Some custom operators now reach the
fallback-kernel check under the name Inductor derives rather than the
name they are registered under. Both spellings are accepted for the
Metal ops and the CUDA int4 pack matmul.
**Build and CI repairs.** `setup.py bdist_wheel` is gone, so the macOS
source build uses the standard frontend. 2.14 is published for ROCm 7.2,
not 7.1. PyTorch now compiles at C++20, which makes CMake scan for
modules with scanners the images do not have. And a pip `cmake` in the
build environment made the image build silently produce a wheel with no
BLAS, so the image's own cmake is used and the result is now asserted
rather than assumed.
Two of these were already broken before this branch: the unpinned
`katex` install, and the `cmake` interaction.
## Behaviour changes
The re-sync is not cosmetic. `overflows()` answers differently for float
to integer casts, in both directions. Filling an int8 tensor with 127.5
was refused and now gives 127. A value at 2^63 cast to int64 was
accepted and wrapped, and is now refused.
The portable kernels reach this through `check_overflow_cast`, so
`full`, `full_like`, `fill`, `scalar_tensor`, `hardtanh`, `leaky_relu`,
`scatter` and `constant_pad_nd` inherit it. The header is a faithful
copy of upstream, so this is not ours to undo, but it should be visible
rather than buried in a header diff. Neither direction had a test; both
do now.
Two smaller ones come with it. Building a delegate sorts its
placeholders, and lifted tensor
constants were sorted as if they were user inputs, which left a constant
after one and made
any later constant insert impossible. They now sort with the parameters
and buffers.
And dropout was missing from the list of operators that take their
input's observer. It is an
identity once a model is not training, which is how a quantized model is
deployed, so measuring
it separately gave the operator after it a different scale. XNNPACK then
refused a reshape whose
two sides disagreed. Both spellings are listed, as several other
operators already are.
## Test plan
Each commit carries its own. Covering the whole change:
`compare_dirs.sh`, the header check CI runs, passes against a real
`release/2.14` checkout and fails without the re-sync. All eight
vendored headers are byte-identical to upstream; the one build-file edit
follows a file upstream moved.
The behaviour change was measured by compiling `overflows()` from both
branches, not read off the diff. Both new cases fail on the old header,
so neither is vacuous.
The regenerated import library was checked member by member: 45
advertised names against 42 before, none lost, and its archive metadata
is zeroed so the file is reproducible.
Not covered locally: the image build, the CUDA, ROCm, Qualcomm and Metal
jobs, the export suites, the Buck build, and anything needing Windows.
CI has all of it.
## Known outstanding
Three things this change does not repair. None of them is new here, and
each needs its own
change rather than being folded into a version bump.
No job links the checked-in Windows link stub with the Microsoft linker.
The cross build uses
a GNU linker, the same family that produced the archive, so it cannot
answer whether the
Microsoft one accepts it. That needs a Windows lowering job, which does
not exist yet. There
is now a note beside the file describing how it is produced.
The two Cortex-M model tests expect three quantize pairs where they used
to expect one. Two of
those three are round trips: the value is converted back to float and
immediately converted
again at the same scale, measured as 0.004997437 and 0.0000032501507 on
both sides. So a pass
that used to absorb them no longer matches. The pad operator those pairs
sit around is created
by this backend's own passes, after the shared pass that folds such
pairs has already run, so
absorbing them means changing the order or extending a pass another
backend shares. Correct
output, more work than needed.
Asking for pinned host memory gives ordinary host memory. There is no
pinned allocator in this
runtime, and adding one needs a matching release path, so the entry
point allocates ordinary
memory and says so. A caller that wants a copy to the device to overlap
other work will not get
the overlap.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils
@Sebastian-Larsson @robell @rascani
---------
Co-authored-by: PyTorch Bot <pytorchbot@users.noreply.github.com>1 parent 5410b1a commit af6454e
43 files changed
Lines changed: 439 additions & 182 deletions
File tree
- .ci
- docker
- ci_commit_pins
- common
- scripts
- wheel
- .github/workflows
- backends
- aoti
- apple/metal
- arm/test/misc
- cortex_m/test
- misc
- models
- cuda
- runtime
- shims
- tests
- nxp/tests/ir/converter/node_converter
- vulkan/test/op_tests
- xnnpack/quantizer
- exir
- kernels/test
- runtime/core/portable_type/c10
- c10
- util
- torch/headeronly
- macros
- util
- shim_et/xplat/executorch/build
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
93 | | - | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 130 | | |
135 | 131 | | |
136 | 132 | | |
137 | 133 | | |
138 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
139 | 146 | | |
140 | | - | |
141 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| |||
178 | 191 | | |
179 | 192 | | |
180 | 193 | | |
181 | | - | |
| 194 | + | |
182 | 195 | | |
183 | 196 | | |
184 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
994 | | - | |
| 994 | + | |
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
162 | 167 | | |
163 | 168 | | |
164 | 169 | | |
| |||
0 commit comments