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

Method Definition Possible Issue JACC v0.1.0 #149

Closed
alexishuante opened this issue Nov 14, 2024 · 2 comments
Closed

Method Definition Possible Issue JACC v0.1.0 #149

alexishuante opened this issue Nov 14, 2024 · 2 comments

Comments

@alexishuante
Copy link

Hello, I received this warning on precompilation when using JACC v0.1.0:
┌ JACC → JACCONEAPI
│ WARNING: Method definition parallel_for(oneAPI.oneAPIKernels.oneAPIBackend, Tuple{I, I}, F, Any...) where {I<:Integer, F<:Function} in module JACCONEAPI at /home/xa2/.julia/packages/JACC/zbR1L/ext/JACCONEAPI/JACCONEAPI.jl:28 overwritten at /home/xa2/.julia/packages/JACC/zbR1L/ext/JACCONEAPI/JACCONEAPI.jl:41.
│ ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.

It seems it is pointing to these specific lines of code in JACC.jl/ext/JACCONEAPI/JACCONEAPI.jl:
function JACC.parallel_for(
::oneAPIBackend, (M, N)::Tuple{I, I}, f::F, x...) where {
I <: Integer, F <: Function}
maxPossibleItems = 16
Mitems = min(M, maxPossibleItems)
Nitems = min(N, maxPossibleItems)
Mgroups = ceil(Int, M / Mitems)
Ngroups = ceil(Int, N / Nitems)
oneAPI.@sync @oneapi items=(Mitems, Nitems) groups=(Mgroups, Ngroups) _parallel_for_oneapi_MN(
(M, N),
f, x...)
end

function JACC.parallel_for(
::oneAPIBackend, (L, M, N)::Tuple{I, I}, f::F, x...) where {
I <: Integer, F <: Function}
maxPossibleItems = 16
Litems = min(M, maxPossibleItems)
Mitems = min(M, maxPossibleItems)
Nitems = 1
Lgroups = ceil(Int, L / Litems)
Mgroups = ceil(Int, M / Mitems)
Ngroups = ceil(Int, N / Nitems)
oneAPI.@sync @oneapi items=(Litems, Mitems, Nitems) groups=(
Lgroups, Mgroups, Ngroups) _parallel_for_oneapi_LMN((L, M, N),
f, x...)
end

The warning was gone once I changed (L, M, N)::Tuple{I, I} to (L, M, N)::Tuple{I, I, I} for the 3D parallel_for. I looked at ext/JACCAMDGPU.jl and ext/JACCCUDA.jl and it seems they have set as (L, M, N)::Tuple{I, I, I} for the 3D parallel_for. Not sure if this is the intended way to do it.

@PhilipFackler
Copy link
Collaborator

@alexishuante, our oneapi backend has been neglected to say the least. Today I submitted a PR that gets our tests working with oneapi. In the process, I believe I ran into this same error and fixed it. If you don't mind, could you try out the version in the PR #151 and let me know if this is resolved? Thank you.

@alexishuante
Copy link
Author

Yes, I can confirm the issue has been resolved, thank you.

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

No branches or pull requests

2 participants