Commit 34711c8
committed
arena: support inner result permutation for ToT x scalar Scale contraction
A mixed inner-Scale product (Tensor<ArenaTensor> ToT x plain Tensor ->
ToT) under an outer Contraction with a non-identity inner *result*
permutation crashed in ArenaTensor::axpy_to(other, factor, perm), which
rejects in-place permutation of view cells.
The Scale path pushed the inner perm onto the per-cell op (via the
fallback axpy_to(..., perm)) and dropped it from total_perm, while
make_contraction_arena_plan bailed on any non-identity inner perm --
leaving the view result cell both unshaped and asked to permute itself.
Mirror the inner-Contraction view handling instead: for view (arena)
result cells, carry the full perm in total_perm so op_'s post-processing
permute applies the inner result perm as a slab-level rewrite, and pass
an identity inner perm to make_contraction_arena_plan so it builds the
plan (pre-shaping result cells unpermuted) and selects the perm-free
fused scale op. Owning inner cells keep applying the inner perm in the
per-cell scale op (outer-only total_perm), unchanged.1 parent 6330596 commit 34711c8
1 file changed
Lines changed: 31 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
310 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
311 | 320 | | |
312 | 321 | | |
313 | 322 | | |
| |||
341 | 350 | | |
342 | 351 | | |
343 | 352 | | |
344 | | - | |
345 | | - | |
346 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
347 | 365 | | |
348 | 366 | | |
349 | 367 | | |
| |||
949 | 967 | | |
950 | 968 | | |
951 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
952 | 976 | | |
953 | 977 | | |
954 | 978 | | |
955 | | - | |
| 979 | + | |
956 | 980 | | |
957 | 981 | | |
958 | 982 | | |
| |||
0 commit comments