Commit 29282fa
authored
CopyFromBuffer Device2Device BufferInstance transfer workaround (#2277)
### Ticket
Revealed by #2258.
### Problem description
After #1657, output BufferInstances no longer have a host runtime
tensor. If we try to do a (PJRT) device to device transfer (even though
that is not really meaningful in the current way we model
MeshDevice/PJRT Device Instance), the copyToBuffer path assumes an
existing host runtime tensor on the source buffer instance.
### What's changed
In copyToBuffer, if a device runtime tensor exists on the copy source
buffer instance, transfer it to host as the source of truth.
### Checklist
- [x] New/Existing tests provide coverage for changes1 parent ab2d8a8 commit 29282fa
File tree
4 files changed
+96
-9
lines changed- pjrt_implementation
- inc/api
- src/api
- tests/jax/multi_chip/n300/graphs/tensor_parallel
4 files changed
+96
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
262 | 292 | | |
263 | 293 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 294 | + | |
267 | 295 | | |
268 | 296 | | |
269 | 297 | | |
| |||
347 | 375 | | |
348 | 376 | | |
349 | 377 | | |
350 | | - | |
| 378 | + | |
| 379 | + | |
351 | 380 | | |
352 | 381 | | |
353 | 382 | | |
| |||
368 | 397 | | |
369 | 398 | | |
370 | 399 | | |
371 | | - | |
| 400 | + | |
372 | 401 | | |
373 | | - | |
| 402 | + | |
374 | 403 | | |
375 | 404 | | |
376 | 405 | | |
| |||
411 | 440 | | |
412 | 441 | | |
413 | 442 | | |
414 | | - | |
| 443 | + | |
415 | 444 | | |
416 | 445 | | |
417 | 446 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
0 commit comments