Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UnsafeAtomics 0.3 #709

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Use UnsafeAtomics 0.3 #709

wants to merge 2 commits into from

Conversation

vchuravy
Copy link
Member

No description provided.

@vchuravy
Copy link
Member Author

] add Atomix#vc/unsafe_atomics UnsafeAtomics#master KernelAbstractions#vc/unsafe_atomics

@pxl-th
Copy link
Member

pxl-th commented Dec 10, 2024

Simple @atomic x[1] += 1f0, fails with error below.
Previously we'd dispatch from atomic_pointermodify to llvm_atomic_op, but now we do atomic_pointerreplace which triggers this error.

pxlth@Tower:~/.julia/dev/AMDGPU$ jl t.jl 
Precompiling AMDGPU...
  1 dependency successfully precompiled in 9 seconds. 124 already precompiled.
ERROR: LoadError: InvalidIRError: compiling MethodInstance for ker!(::AMDGPU.Device.ROCDeviceVector{Float32, 1}) resulted in invalid LLVM IR
Reason: unsupported call to an unknown function (call to ijl_get_nth_field_checked)
Stacktrace:
 [1] indexed_iterate
   @ ./namedtuple.jl:172
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_tuple)
Stacktrace:
 [1] indexed_iterate
   @ ./namedtuple.jl:172
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to ijl_get_nth_field_checked)
Stacktrace:
 [1] atomic_pointermodify
   @ ~/.julia/packages/UnsafeAtomics/y7d6Q/ext/UnsafeAtomicsLLVM/atomics.jl:276
 [2] modify!
   @ ~/.julia/packages/UnsafeAtomics/y7d6Q/ext/UnsafeAtomicsLLVM/internal.jl:23
 [3] modify!
   @ ~/.julia/packages/UnsafeAtomics/y7d6Q/src/core.jl:11
 [4] modify!
   @ ~/.julia/packages/Atomix/2spi2/src/core.jl:33
 [5] ker!
   @ ~/.julia/dev/AMDGPU/t.jl:5
Reason: unsupported dynamic function invocation (call to atomic_pointerreplace)
Stacktrace:
 [1] atomic_pointermodify
   @ ~/.julia/packages/UnsafeAtomics/y7d6Q/ext/UnsafeAtomicsLLVM/atomics.jl:276
 [2] modify!
   @ ~/.julia/packages/UnsafeAtomics/y7d6Q/ext/UnsafeAtomicsLLVM/internal.jl:23
 [3] modify!
   @ ~/.julia/packages/UnsafeAtomics/y7d6Q/src/core.jl:11
 [4] modify!
   @ ~/.julia/packages/Atomix/2spi2/src/core.jl:33
 [5] ker!
   @ ~/.julia/dev/AMDGPU/t.jl:5

@vchuravy
Copy link
Member Author

I guess I shouldn't have removed that code xD

Can you open a PR that re-adds it and adds a test?

@pxl-th
Copy link
Member

pxl-th commented Dec 11, 2024

Yeah, will do in a bit

@vchuravy
Copy link
Member Author

Thanks Anton!

@vchuravy
Copy link
Member Author

Can you run the tests again? I am travelling right now without access to GPUs :)

@pxl-th
Copy link
Member

pxl-th commented Dec 12, 2024

Yeah, they all pass now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants