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

MKL: Level-1 (scal) primitive support #1

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

kballeda
Copy link

This PR consists of Level-1 (scal) primitive support for oneJulia

Copy link
Owner

@pengtu pengtu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a 'testf' function defined in test/setup.jl, which uses the TestSuite.compare function in
https://github.com/JuliaGPU/GPUArrays.jl/blob/master/test/testsuite.jl#L38. It copies the input data to CPU and GPU arrays and compare the results. Please modify the test using the 'testf' function for more concise code.

@kballeda
Copy link
Author

kballeda commented Nov 1, 2022

There is a 'testf' function defined in test/setup.jl, which uses the TestSuite.compare function in https://github.com/JuliaGPU/GPUArrays.jl/blob/master/test/testsuite.jl#L38. It copies the input data to CPU and GPU arrays and compare the results. Please modify the test using the 'testf' function for more concise code.

Thanks for your inputs. I have implemented rmul! and testf based tests they fail for one case commonly.
If I check the oneMKL.scal primitive for CPU/GPU tests are passing. I have added the changes please take look when you get a chance.

Copy link
Owner

@pengtu pengtu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review my comments. Thanks!

lib/mkl/wrappers.jl Outdated Show resolved Hide resolved
@@ -49,6 +49,13 @@ function gemm_dispatch!(C::oneStridedVecOrMat, A, B, alpha::Number=true, beta::N
end
end

LinearAlgebra.rmul!(x::oneStridedVecOrMat{<:onemklFloat}, k::Number) =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if these two rules will properly dispatch the combination of alpha types of ComplexF32, ComplexF64, F32 and F64 to the ComplexF32 and Complex64 scal functions.

Please write specific tests for all the combinations to make sure they are dispatched properly.

If not, we will want to use AMDGPU.jl's type based dispatching rules at
https://github.com/JuliaGPU/AMDGPU.jl/blob/master/src/blas/wrappers.jl#L85, and

https://github.com/JuliaGPU/AMDGPU.jl/blob/master/src/blas/wrappers.jl#L106

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, Thanks

test/onemkl.jl Outdated Show resolved Hide resolved
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