Repository navigation
Commit 0f52d1e
committed
fix(iluvatar): leave out= entry points alone; scope the copy tests
Review follow-ups from flagos-ai#644.
`sum_dim_out` (and every other `*_out` binding) is no longer rewired by the
alias sweep. An `out=` entry point is not the same function as the one it is
named after: flag_gems' `sum_dim_out` passes the caller's `keepdim` through and
reads the result dtype off the input, which is how `torch.sum(bool_input,
dim=1, out=int64_out)` lands in an int64 buffer. The wrapper forces
`keepdim=False` and returns a fresh tensor, so wrapping that binding would
leave the caller's buffer untouched and change the dtype it derived. Those
calls keep the workaround's documented scope -- unmasked, and therefore still
wrong on this backend -- rather than acquiring a second, silent change. Two
tests pin it: a build that aliases `sum_dim_out` to `sum_dim` must still leave
the `_out` name alone, and the bool-input `out=` dtype rule must survive the
patch.
The new unit file is now a manifest step of its own, so it runs on every
platform with torch. It is not in the platform-agnostic job, which installs no
torch by design -- there it would be collected and skipped, which is not
evidence. It is not in `unit_tests_per_file` either: widening that group to
Iluvatar still surfaces five unrelated failures in the rest of tests/unit
(test_profiler_privateuse1 crashes, the ascend/gcu qwenimage rope files fail,
and the flagcicd report/coverage files fail), which belongs to the PR that
triages them. The file resolves `torch_fl` through the installed wheel first,
like tests/integration/ops/conftest.py, so it runs in a wheel-only workspace
and in a source checkout alike.
The two Iluvatar-lane failures in tests/integration/ops/test_dtype_cast_copy.py
were the test's premise, not a regression:
* `test_cuda_abi_cast_does_not_route_through_host` reads csrc/aten/copy_ops.cc,
which a wheel-only workspace does not have. It now skips there with that
reason instead of raising FileNotFoundError.
* `test_bf16_fp32_cast_is_transfer_free` asserts a runtime property that only
holds where an on-device cast exists. copy_ops.cc's same-device flagos->flagos
branch reaches a native cast on the CUDA-ABI platforms and a vendor cast on
Ascend/GCU/Kunlunxin/MUSA, but Iluvatar is in the "Fallback: CPU round-trip
when no on-device cast is available" set, so the transfer count there is the
design. It is skipped for the four builds with no `DtypeCast`
(bpu, iluvatar, mps, tsingmicro) and stays a real check everywhere else.
Verified on iluvatar-109 (BI-V150, torch_fl 2.10.0+corex4.5.0):
tests/unit/test_iluvatar_masked_reductions.py 19 passed, from a source
checkout and from a wheel-only directory; test_dtype_cast_copy.py 14 passed /
2 skipped in the checkout and 10 passed / 6 skipped with no csrc present;
end-to-end unchanged -- vision tower 3/3 bit-identical, 12 samples 12/12 same
side with max|d| = 7.54e-3 and no NaN, bit-identical to the earlier run.
Refs flagos-ai#6171 parent 4410c01 commit 0f52d1e
4 files changed
Lines changed: 168 additions & 12 deletions
File tree
- .github
- tests
- integration/ops
- unit
- torch_fl/compile
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
684 | 702 | | |
685 | 703 | | |
686 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
55 | 79 | | |
56 | 80 | | |
57 | 81 | | |
| |||
179 | 203 | | |
180 | 204 | | |
181 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
182 | 214 | | |
183 | 215 | | |
184 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
42 | 63 | | |
43 | 64 | | |
44 | 65 | | |
45 | 66 | | |
46 | | - | |
| 67 | + | |
47 | 68 | | |
48 | 69 | | |
49 | 70 | | |
| |||
162 | 183 | | |
163 | 184 | | |
164 | 185 | | |
165 | | - | |
166 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
167 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
168 | 263 | | |
169 | 264 | | |
170 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
186 | 197 | | |
187 | | - | |
| 198 | + | |
188 | 199 | | |
189 | 200 | | |
190 | 201 | | |
| |||
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
197 | | - | |
| 208 | + | |
198 | 209 | | |
199 | 210 | | |
200 | 211 | | |
| |||
0 commit comments