Commit 3229d8f
Fix LTS-stack silent corruption in reductions and workgroup barriers
Two distinct correctness bugs surfaced as intermittent KernelAbstractions
example failures (naive_transpose, histogram) on the Aurora LTS NEO/IGC stack:
- mapreducedim! over a strided/transposed input (e.g. `a == transpose(b)`,
`sum(transpose(x))`, `isequal`, `ishermitian`) hit the LTS IGC miscompile of
non-coalesced global loads, silently corrupting the result. Detect
non-contiguous inputs and materialize them to a dense array before reducing,
so every global read is coalesced. (src/mapreduce.jl)
- KA `@synchronize` lowered to `barrier(0)`, emitting OpControlBarrier with
SequentiallyConsistent but WITHOUT the WorkgroupMemory storage-class bit,
which orders no memory per the SPIR-V spec. On the LTS stack shared-local
writes were not made visible across the barrier, dropping updates (the
histogram example's local-atomic accumulation lost counts). Fence local+global
memory in `__synchronize`, and local memory in the mapreduce reduce_group SLM
tree. (src/oneAPIKernels.jl, src/mapreduce.jl)
Validated on the LTS stack: kernelabstractions 2218 pass / 0 fail; gpuarrays
reductions+statistics 2962/2962; histogram 0 failures over 1100 iters; strided
==/sum/isequal/ishermitian correct.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d78ef78 commit 3229d8f
2 files changed
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
133 | 138 | | |
134 | 139 | | |
135 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
136 | 154 | | |
137 | 155 | | |
138 | 156 | | |
139 | 157 | | |
140 | 158 | | |
141 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
142 | 167 | | |
143 | 168 | | |
144 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| |||
0 commit comments