Skip to content

sycl: Use oneMath on non-WIN32 #13503

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

Closed
wants to merge 2 commits into from
Closed

Conversation

jounjj
Copy link

@jounjj jounjj commented May 13, 2025

The MKL static linking issue (this one uxlfoundation/oneMath#654) is only a problem to WIN32. I would also assume that it is fine to use the oneMath package on WIN32 if it is found.

@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels May 13, 2025
Copy link
Collaborator

@Rbiessy Rbiessy left a comment

Choose a reason for hiding this comment

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

Note that with the PR #12972 we should be able to use oneDNN and avoid using oneMKL/oneMath altogether. I don't think we'll remove the oneMKL/oneMath dependency as part of that PR but could be something we do soon if all goes well. Would that also work for you? I think that would be a preferable solution.

Comment on lines +107 to +108
find_package(oneMath)
if (WIN32 AND NOT oneMath_FOUND AND GGML_SYCL_TARGET STREQUAL "INTEL")
Copy link
Collaborator

Choose a reason for hiding this comment

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

The intention of the original PR #12192 was to use find_package if oneMath is installed and FetchContent otherwise. With these changes oneMath with Intel devices is only going to be used if users install oneMath (and on Linux).
You should be able to allow using FetchContent with:

Suggested change
find_package(oneMath)
if (WIN32 AND NOT oneMath_FOUND AND GGML_SYCL_TARGET STREQUAL "INTEL")
if (WIN32 AND GGML_SYCL_TARGET STREQUAL "INTEL")

if (GGML_SYCL_TARGET STREQUAL "INTEL")
# Intel devices use Intel oneMKL directly instead of oneMath to avoid the limitation of linking Intel oneMKL statically
find_package(oneMath)
if (WIN32 AND NOT oneMath_FOUND AND GGML_SYCL_TARGET STREQUAL "INTEL")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will fallback to using the runtime dispatcher for Intel devices which can affect performance. You can see how the compile time dispatcher used to be enabled in 995aea3#diff-123d14cf628b04694c9022d4210d80c14a29409095635150b944f8dfd1c70b37L120.

@jounjj
Copy link
Author

jounjj commented May 13, 2025

Yes, sorry I didn't notice that pr. That would feel like a good solution to me as well. I'll close this then.

@jounjj jounjj closed this May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants