Commit 16d66aa
committed
ggml-cuda: fix ROCm multi-GPU illegal memory access in recurrent state restore
Cherry-pick of ggml-org#21170.
Remove early-return optimization in ggml_cuda_set_device() that caused
hipErrorIllegalAddress on ROCm multi-GPU setups when hipGetDevice()
returns an unexpected value on threads with uninitialized device context.
Also add missing ggml_cuda_set_device() in ggml_backend_cuda_set_tensor_async()
for consistency with all other cudaMemcpyAsync call sites.
Fixes GPU memory access fault during KV cache checkpoint restore on
multi-turn agentic workflows with multi-GPU row split.1 parent 991c220 commit 16d66aa
1 file changed
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
| 103 | + | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 105 | | |
113 | 106 | | |
114 | 107 | | |
| |||
3022 | 3015 | | |
3023 | 3016 | | |
3024 | 3017 | | |
| 3018 | + | |
3025 | 3019 | | |
3026 | 3020 | | |
3027 | 3021 | | |
| |||
0 commit comments