Repository navigation
Conversation
The LTS IGC (2.11) miscompiles kernels that update a 2- or 4-byte
aggregate such as `ComplexF16` or `Complex{Int8}` in a loop, which Julia
1.13 no longer scalarizes: all but the first work-item of each group get
wrong results. LdStCombine packs the fields of such values into one
32-bit lane, and copies between those packed values were emitted as if
they weren't packed. IGC 2.26 fixed it (intel/intel-graphics-compiler@15614f2),
so the rolling stack is unaffected.
With `ONEAPI_LTS` set, turn the pass off unless the user has already set
`IGC_EnableLdStCombine`. The setting is also passed in every module's
build flags, because NEO's on-disk compiler cache keys on those but not
on the environment, and would keep serving kernels miscompiled before
the workaround applied.
Fixes #757.
Member
Author
|
@michel2323 FYI, the IGC fix is intel/intel-graphics-compiler@15614f2 ("Fix layout struct copy"), first in IGC 2.26.0; the 2.11 LTS branch doesn't have it as of v2.11.54. If you have a channel to Intel for the Aurora LTS stack, that's the commit to ask them to backport, after which this workaround can go. |
Contributor
|
Documentation preview: https://juliagpu.github.io/oneAPI.jl/previews/PR790/ |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the LTS stack (IGC 2.11.43), kernels that update a 2- or 4-byte aggregate (
ComplexF16,Complex{Int8},Complex{Int16}, ...) in a loop return wrong values for every work-item except the first of each group. It shows up on Julia 1.13, which leaves the accumulator unscalarized, and it is what keepstest:lts:1.13red.The bug is in IGC's LdStCombine pass. It packs the fields of such values into one 32-bit lane, and copies between packed values were emitted as if they weren't packed. That produces the self-move noted in #757. intel/intel-graphics-compiler@15614f2 fixed it, first released in IGC 2.26.0, so the rolling stack (IGC 2.41 through
NEO_jll) is unaffected.With
ONEAPI_LTSset, oneAPI.jl now setsIGC_EnableLdStCombine=0when it initializes, unless the variable is already set. The same setting goes into every module's build flags as-igc_opts. NEO's on-disk compiler cache keys on build flags but not on the environment, so without the flag it kept serving kernels that were miscompiled before the workaround applied. The workaround is documented with the other LTS workarounds indocs/src/lts.md.Tested on an Arc A770 with older JLL stacks swapped in (NEO 25.31 + IGC 2.16, NEO 25.44 + IGC 2.22) on Julia 1.13:
executiontest fail with the pass enabled and pass withONEAPI_LTS=1.gpuarrays/sparse: 4 failures before the fix, 0 after.sum(dims)kernels I timed.execution,level-zeroandgpuarrays/sparsepass with and withoutONEAPI_LTS.This was not run on Aurora itself; the ALCF pipeline will show the LTS result.
Fixes #757.