After one week of a successful registration of a new version of PeriodicSystems, I am trying to prepare a new version by performing several commits. Running the tests, the following error pops up repeatedly
I would appreciate any hint to identify the cause of these error messages and how to overcome them. What changed in Julia in the last week (perhaps the transition to v1.9.4)?
loading PeriodicSystems causes MKL to completely replace OpenBLAS, and MKL likely doesn’t implement the BLAS functions you’re trying to call. Restoring OpenBLAS fixes the issue for me. You or some of your dependencies is forcing MKL in the entire session.
So, I can not reproduce your results. The tests have been performed under Julia 1.9.3, but I registered a new version of the package last week, using the same version without problems!
I raised an issue to fix this problem, and, apparently, I am not the only one affected by this problem. Since potentially, every Julia user could be affected (in one or another way) by switching at runtime in packages to different linear algebra support, this practice, in my opinion, should be forbidden, because of the possible unpredictable side effects. I already lost three days trying to debug a situation, for which I don’t feel responsible!
You do seem to be the only one effected by this problem. To reiterate @giordano , “Only the subset of people using functions not implemented by MKL.” The only two other things that were brought up were unrelated to your problem:
It seems Distributed is hardcoded to set OpenBLAS num threads to 1, not BLAS num threads. Weird, but okay that should get fixed.
2 people reported that MKL is about 1.5x-2x slower on AMD Epyc (depending on the operation), and like 50 people reported speedups generally in the 2x-100x range (100x being sparse matrices when set to UMFPACK).
If this was the only thing reported in isolated, then it would not be reverted since that would be an absolutely self-serving definition of performance regression. It was by far a massive success in the performance department, though yes there is one specific case we know of now where MKL is slower. That said, what I didn’t want is the breaking behavior, and indeed since there is breaking behavior we will have to pull back on this.
I will try to fix the MKL related problems in my packages. I detected at least two pairs of LAPACK functions, dlanv2/slanv2 and dladiv/sladiv for which there are (apparently) no MKL interfaces which meet the OpenBLAS interfaces. Fortunately, I have pure Julia based implementations allowing arbitrary precision computations, so I will replace with calls to these functions.
I appreciate very much your desire to have top performance for all software pieces. If this can be done in an encapsulated way (as you propose for UMFPACK) this is a very good goal. However, by enforcing with a single call using MKL that a complex package as PeriodicSystems, with plenty of dependencies, executes using MKL, is in my opinion a delicate issue and a big responsibility, without the possibility to guarantee that the exhibited behaviour of all functions will remain the same.
In theory changing BLAS changes no behavior, just performance. In practice I think we learned it’s not there yet, but I hope this is a forcing function towards breaking away from OpenBLAS