Commit 565f16f
committed
arena ToT: support einsum's replicate_array path on >1 rank
einsum's special-Hadamard branch replicates the small operand via
replicate_array -> make_replicated -> replicate_tensor. Two gaps broke
this for an arena tensor-of-tensors on a multi-rank run:
- Replicator's ctor called pmap()->local_size() purely as a reserve()
hint, which asserts on a pmap that does not precompute local size
(e.g. HashPmap). Skip the hint when known_local_size() is false.
- replicate_tensor std::copy'd the 8-byte ArenaTensor view cells, so the
replicated tile aliased the source tile's arena slab and dangled once
the (temporary, post-make_replicated) source array was destroyed.
Build the replicated tile as a fresh slab-backed tile and deep-copy
each replicated inner cell's element data.1 parent 1415b12 commit 565f16f
2 files changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
244 | 272 | | |
245 | 273 | | |
246 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| |||
0 commit comments