Commit d08b600
committed
Fix GPU handle pool singleton aliasing with tag-based template separation
Problem:
- BLAS and SOLVER handle pools were sharing the same static singleton instance
- C++ template instantiation created only one pool when HandleType/StreamType were identical
- This caused resource contamination between hipBLAS and hipSOLVER operations
- Led to potential memory corruption and unexpected GPU library behavior
Solution:
- Added Tag template parameter to HandlePool class with default DefaultTag
- Introduced BlasTag and SolverTag for unique pool instantiations
- Updated all handle pool typedefs to use three-argument template
- Each tag type now gets its own static singleton pool instance1 parent 3d6b521 commit d08b600
File tree
5 files changed
+29
-18
lines changed- jaxlib/gpu
5 files changed
+29
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| |||
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
69 | | - | |
70 | | - | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | | - | |
| 84 | + | |
74 | 85 | | |
75 | 86 | | |
76 | 87 | | |
| |||
80 | 91 | | |
81 | 92 | | |
82 | 93 | | |
83 | | - | |
| 94 | + | |
84 | 95 | | |
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
105 | 116 | | |
106 | 117 | | |
107 | 118 | | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments