Commit c6f012c
authored
prevent AOTI library collisions between delegates (pytorch#21287)
Summary:
The CUDA backend writes each compiled AOTInductor library to a temporary
file,
named from its content key plus the process id, before loading it. Two
identical
CUDA partitions can share the same content key, so both delegates
computed the
same path; loading the second library overwrote the first while it was
still in
use, and symbol lookup could then crash.
Append a per-process atomic counter to the temporary file name so every
delegate
in a process gets a distinct path. The file is still removed when the
delegate is
destroyed, as before; only the name changes.
Differential Revision: D1133224591 parent fbd14e6 commit c6f012c
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
334 | 340 | | |
335 | | - | |
336 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
337 | 345 | | |
338 | 346 | | |
339 | 347 | | |
| |||
0 commit comments