-
Notifications
You must be signed in to change notification settings - Fork 55
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
Move MKL to an extension on 1.9+ #299
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #299 +/- ##
===========================================
- Coverage 73.08% 49.20% -23.89%
===========================================
Files 5 6 +1
Lines 535 500 -35
===========================================
- Hits 391 246 -145
- Misses 144 254 +110 ☔ View full report in Codecov by Sentry. |
Why is this a breaking change? At worst, someone currently using the MKL backend might use the FFTW backend instead, which could change the performance but not the API. |
I can't have a look right now but I have a couple of questions:
|
@stevengj The current logic (which I just copied over) doesn't fallback to the FFTW backend when MKL isn't available and the preference is set to MKL. Since MKL now has to be explicitly loaded to be available, this seemed like a breaking behavior to me. I can also change it to be a minor version bump.
@giordano No, the choice of backend is a user-set preference. (Also, I view packages loading MKL as a form of piracy, at a much lower level than most people think of!)
No, again because it still depends on the user preference. If MKL is loaded but the user preference is (the default) FFTW, then the package extension is also essentially a no-op (see the |
@stevengj Maybe the solution is to unconditionally set things to the FFTW backend in the package and only conditionally update for the |
@stevengj given the amount of Let me know what you think before I start working on a potential overhaul! |
FWIW |
What is the advantage of making this an extension over the current approach? If it's not optional, it doesn't seem like it falls within the spirit of package extensions. Is the main advantage just to save the storage space of downloading |
Storage space, download times (which matters more for CI) and unnecessary compat restrictions. |
But hopefully one doesn't purposefully do something which would just not work. Instead, you can't control at all whether the MKL_jll package just happens to be loaded (and it'd be No-op on platforms where MKL isn't available). To me the latter looks much more troublesome, as it's outside of user's control. |
Also, how do you control what's the FFT backend if loading another package toggle that? This mechanism looks very problematic to me. |
@giordano Again, the user controls which backend to use via their preferences. The extension merely enables an additional backend as an option. If the user has not set that option, then it is not used. On the other hand, if a user wants to use a different backend, I think it's fair that they are required to load that backend, i.e. opt in fully. They still control whether or not to set the MKL preference and whether or not to load MKL. With this PR, they can load MKL without using it as a backend if they just want MKL for BLAS, but they can't use MKL as the backend without loading it. The user is in more control, not less. |
What if the user has set the This doesn't seem very composable. |
That's a very good point for global preferences. For project specific preferences, it seems reasonable for the user to only set MKL as the backend if they load it. But I don't know what to do about the global preference thing and that might be the best argument against this change. |
I've marked this as a breaking change because it requires explicitly loading MKL_jll (or MKL) to enable the support on 1.9+.