Anyone have any thoughts on this? Recent exchanges with others running Intel cpus suggest there is a large performance difference between systems under certain circumstances.
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
What, if anything, can be done to optimize performance for modern AMD CPU's?
96 views (last 30 days)
Show older comments
Wick
on 20 Apr 2018
I have a AMD Threadripper CPU. I've seen suggestions that AMD-based computers will benefit from changing the math library from Intel's MKL to the AMD Core Math Library (ACML) along with recommendations to change the BLAS.SPEC file. Any threads relating to this seem quite old and it appears that AMD might have changed the name of its math library.
Is it still possible to optimize the math library for AMD's CPUs? If so, what do I need to do?
Thanks!
27 Comments
MikeCC
on 4 Oct 2018
Just wondering if you have any updates? My new 2950x threadripper build is way below expectation...I'm talking about 50% more in terms of running time comparing with the i7 6700HQ laptop pc I got.
Wick
on 4 Oct 2018
Unfortunately, I've found nothing that helps.
Hopefully Mathworks recognizes the improvements AMD has made to their processors and their disruption in the small workstation market and releases a tool to switch math libraries. But as of yet, I haven't heard anything.
Philip Borghesani
on 4 Oct 2018
I suggest that people who care about this put in an enhancement request with support. This is your typical chicken and egg or squeaky wheel issue. Until there are (large? noisy? pre-sales?) customers who want this, and we know about it, improvement will be a low priority.
For many customers with typical smaller problems less fast cores with MATLAB will beat more slower cores, this does still favor Intel.
Wick
on 24 May 2019
@Philip Borghesani, I'm checking in on this thread after a while. AMD's hardware seems to be selling well. PErhaps now is the time to revisit this. How exactly does one submit an enhancement request? The link I found was a blog post from 2008 that doesn't match today's website.
Star Strider
on 24 May 2019
Edited: Walter Roberson
on 24 May 2019
Submit an enhancement request by using the Contact Us link (the telephone handset icon) in the upper right corner of this page.
I’m definitely hoping for this, since my primary MATLAB machine has a Ryzen 7 1800X.
Wick
on 24 May 2019
I submitted this as a request and got the response "As of right now, AMD's support page does not appear to have a link to download the AMD Math Library for users on Windows machines.
I will make sure to convey your suggestion to the development team and they may consider it for a future release of MATLAB."
So it appears not much will happen. I'll see if I can't consince someone at AMD to reach out to Mathworks to make this happen. The Zen family seems like it was made for MATLAB.
Star Strider
on 24 May 2019
Never say ‘never’!
I’m ‘following’ this post, so I’m eager to see any developments.
Ned Flanders
on 6 Jun 2019
Edited: Ned Flanders
on 6 Jun 2019
The problem does not arise from the AMD CPU but from the Intel MKL library which uses a 'discriminating CPU dispatcher' which does not only discriminate CPUs by their SIMD extensions (e.g. AVX2) but also (and that sucks) by their vendor string. Every CPU that does not report back 'Genuine Intel' will make the dispatcher to use the slowest option excluding for example the use of AVX2 although the CPU supports it.
Thats Intels scummy way to boost their CPU sales.
The only option you have is to use other math libraries than the MKL.
AMD offerst the LibM which includes 128bit and 256bit vector extensions and has recently been updated to version 3.3.0
IMHO Matlab developers should spend some efforts on this given that we are all (well paying) customers and not only people with an Intel CPU.
Wick
on 6 Jun 2019
Edited: Wick
on 6 Jun 2019
@Sven, that matches my understanding of the issue as well. However, incorporating those libraries requires Mathworks' involvement and isn't just something an end-user can change, right? I can't imagine that Mathworks is interested in leaving performance on the table if it's just a matter of including an alternate math library during compile time. On C code my AMD cpu is about 80% the performance of my Intel CPU on a per-thread basis. On MATLAB it's closer to 50%. Jumping from 50 to 80 would be a 60% performance gain across the board for all AMD users essentially for free. I'm quite surprised the support rep. that answered my ticket was so uninterested. I'll send that link back to them. Edit: it appears the math libraries linked are only for *nix operating systems. Not sure why they'd ignore Windows.
Ned Flanders
on 6 Jun 2019
Edited: Ned Flanders
on 6 Jun 2019
Maybe you want to address this on a more public social media channel like Twitter and ad some hashtags for visability. This is a widespread problem. Many of us use AMD Ryzen now as they are fantastic of most usecases.
In this case, to my understanding, it would be relatively simple to implement and at least offer an alternative Math Lib like OpenBLAS that includes the libM in Matlab.
Look at Octave... you can choose the Lib when installing it. So why would Matlab not be able to do the same in the interest of their paying customers.
It really should happen!
I am not sure whether it is possible to tweak Matlab to use other libs. I will look into this when I have some more time.
I also dont quite understand how your thread can have 59 views and only 3 vote ups. This should be in everys matlab users unterest to be able to freely chose your hardware.
Wick
on 6 Jun 2019
Edited: Wick
on 6 Jun 2019
I would be very interested if some Linux users out there could tell us if it's as simple as choosing the AMD libraries. The comment I got from Mathworks was that there aren't any Windows libraries there for download. If it's as simple as swapping BLAS libraries in *nix then perhaps the issue is we need to push AMD to build Windows libraries. Edit: And the post is more than a year old. So it's seen 60+ views in the last 30 days but more than that in total I'm sure.
Ned Flanders
on 15 Nov 2019
@Wick
In case you are still reading this. I came across this:
I have recently seen some people recommending using MKL on AMD, with the MKL_DEBUG_CPU_TYPE environment variable set to 5, as in:
export MKL_DEBUG_CPU_TYPE=5
This overrides the CPU dispatching in MKL, and forces the AVX2 codepath (the one MKL naturally uses on Intel parts without AVX512), otherwise MKL chooses an unoptimized SSE path with abysmal performance. But with the AVX2 path, MKL performs very well on Zen2, usually even outperforming BLIS and OpenBLAS!
Not sure whether this is possible in Matlab, but if so, you should definately try.
Star Strider
on 15 Nov 2019
@Ned Flanders — Please enlarge on this, ideally with relevant links that explain this in more detail. (I am not as knowledgable on this as others may be, and need to be brought up to speed.)
Ned Flanders
on 15 Nov 2019
Edited: Ned Flanders
on 15 Nov 2019
I wish I could elaborate on this, but I don't know much about these things either.
Just Google export MKL_DEBUG_CPU_TYPE=5
As many people seem to be using AMD Epyc now, this came up and seems to solve the problem with the MKL on AMD CPUs. What I can't tell is whether this is something you can do or whether this is something Mathworks could patch into Matlab. In anycase... it works. CPU Performance on AMD CPUs is restored that way.
See for example: https://www.phoronix.com/forums/forum/hardware/processors-memory/1126558-amd-epyc-7302-7402-7502-7742-linux-performance-benchmarks?p=1126644#post1126644
Or:
"Note that by default, PyTorch uses the Intel MKL, that gimps AMD processors. In order to prevent that, execute those lines before starting the benchmark:"
"export MKL_DEBUG_CPU_TYPE=5"
To my understanding (which is limited) one could include this in the startup script in Matlab itself, but someone will have to explain the details to us.
Wick
on 15 Nov 2019
That's a comment for a Python environment. That is, I believe, a change to the compiler used to execute the Python. Unfortunately, Matlab is already compiled. Also, that was a thread about Linux performance. The Mathworks person with whom I communicated pointed out there are optimized libraries available from AMD for the Zen and later architecture for *nix-based systems, but not for Windows. So unless AMD steps up and provides Windows-optimized math routines, I don't think Mathworks is going to include proper fat binaries.
Ned Flanders
on 15 Nov 2019
Edited: Ned Flanders
on 15 Nov 2019
I opened up a reddit thread on this. There are some suggestions.
Maybe you could try:
And no, I believe its only how the mkl is run not compiled. If you run it in this debug mode, it is forced to use AVX2
Here is how to set environment variables for the mkl in windows:
https://software.intel.com/en-us/mkl-windows-developer-guide-setting-environment-variables
We'll get this fixed gentlemen!
Wick
on 17 Nov 2019
Ned - you da man!
Post your solution as an answer and I'll accept it. Put the text from the batch file in your answer so people can roll their own (nobody likes to run random batch files). Also, you might want to take the spaces out of your script name. After I changed it, MATLAB was happier. Nice test script btw.
A couple notes on running this. The shell that executed matlab after the 'call' function remains using the debug cpu. So if you run it once from the batch file it's gone (since the command window disappears). However, if you run the batch file from a prompt, any future executions of Matlab will use the debug cpu. But matlab executed any other way will not. That made side-by-side testing easier.
Any documentation on the various debug cpu extension options? The new TR's have some AVX commands (not the full 512) so it would be nice if there were a debug cpu that supported those.
Thanks again!!!!
Ned Flanders
on 17 Nov 2019
Told you! Never give up! hehe
Thanks for the feedback, I reworked the post on reddit accordingly. No download needed anymore. Ideally, if you're happy, use system variables to make the fix permanent. --> see reddit.
So how much do you gain on the TR?
Unfortunately this Debug Mode is undocumented by Intel (for very good reasons i guess... these gangsters)
Wick
on 17 Nov 2019
My gains on TR were very much inline with yours percentage-wise. However, an FFT-heavy code didn't see any speed up. I suspect that one was bound by memory access. However, the matrix multiplication speedup is worth the hack alone! I'm hoping to upgrade to a new TR this season. The memory access should be superior.
Put up an answer so I can accept it. This is worth immortalizing!
Ned Flanders
on 10 Dec 2019
Edited: Ned Flanders
on 10 Dec 2019
@wick
Could you test on your TR whether disabled SMT is faster? Matlab starts one thread per Core (not available thread) on Intel and AMD CPUs and my quick test suggests that SMT off is somewhat faster. (another 5-10%)
Wick
on 12 Dec 2019
I've tested SMT off in TR before. It's generally a bit faster that way. However, for my code at least, I'm still faster to run two instances of MATLAB and load up all cores. It's certainly not double, but it's something like 1.5X depending on the amount of memory access.
Ned Flanders
on 29 Mar 2020
@wick
Apparently 2020a includes the Workaround but setting the workaround does not work on all systems reliably yet. Can you confirm it works on your build? You possibly need to remove the sys variable before you upgrade to 2020a.
Ned
Wick
on 6 Sep 2020
@Ned Flanders; I haven't kept my subscription up so I haven't updated for a while. Sorry.
Accepted Answer
Ned Flanders
on 18 Nov 2019
Edited: Ned Flanders
on 2 Dec 2019
You should read it if you want to understand the background.
EDIT: Before you start I have a short request for you that you could help me with and serve your own interest. Matlab will not implement this. If you think that Matlab should offer a permanent solution that serves all users independent of whether they use Intel or AMD CPUs, please make a feature request at Matlab to implement a nummeric library (e.g. OpenBLAS) that does not discriminate against non Intel CPUs. Mathworks will not make this change without people advocating for it. Thanks!
tl;dr
Solution 1 (Windows): Create a .bat file using e.g. "Notepad" with the following lines to start Matlab in AVX2 Mode.
@echo off
set MKL_DEBUG_CPU_TYPE=5
matlab.exe
Save as .txt and rename to .bat. If you double-click that file, Matlab will start the MKL in AVX2 Mode. If you start it the normal way, it will remain as always.
You can also download the .bat file from my highdrive if you trust me (which typically you should not as I am a random guy from the internet). If you delete the startup batch file provided in the download or the one you created yourself, its gone and your computer will be as it has been before.
Solution 2 (Windows): If you are happy with the results (which you surely will be :-)), you should make the setting permanent by entering MKL_DEBUG_CPU_TYPE=5 into the System Environment Variables. This has several advantages, one of them being that it applies to all instances of Matlab and not just the one opened using the .bat file.
Doing this will make the change permanent and available to ALL Programs using the MKL on your system until you delete the entry again.
LINUX: (Thanks to foreignrobot)
Simply type in a terminal:
export MKL_DEBUG_CPU_TYPE=5
and then run matlab from the same terminal.
For benchmarking, you can use this script:
To make it permanent in Linux edit your shell's configuration scripts (~/.bashrc for bash, ~/.zshrc for zsh etc) adding the line export MKL_DEBUG_CPU_TYPE=5. That'll apply in any newly opened shell and to apply it in an already open one simply do . ~/.bashrc or whatever your config script name is. (Thanks to lowpolybutt)
P.S.: In case you are on an older AMD FX CPU, you could test whether MKL_DEBUG_CPU_TYPE=4 works for you. This should enable AVX, but I haven't tested this.
15 Comments
Wick
on 18 Nov 2019
I doubt this is the oldest accepted answer on here, but it's got to be in the highest possible percentile. I see no problem cutting/pasting the text from your reddit post here so it's a self-contained answer. The batch file was a very good intermediate step for back-to-back testing. May as well leave that in there (or just as a series of DOS commands, doesn't have to be a batch file).
Ned Flanders
on 18 Nov 2019
Edited: Ned Flanders
on 4 Dec 2019
Agreed, I copied the entire solution part.
Quite a remarkable story your thread here developed into!
Take good care everyone!
Ned
Ken M.
on 19 Nov 2019
Clear prove/sign to Mathwork that they have to do something about it unless they want to go through life known as being in intels pocket against AMD.
Wick
on 20 Nov 2019
FYI, neural network training appears to speed up by 50% on my 1st-gen TR.
I have submitted a follow-up to my original support enhancement request related to this topic. There's zero chance Mathworks is going to enable an undocumented debug option for Intel's MKL library. However, it appears the OpenBLAS library performs well for things like R and Julia. I've submitted a request that Mathworks include a simple option to switch math libraries. I would request that everyone following this thread submit a similar enhancement request and try to drum up support in other forums as well. Mathworks will not make this chance without people advocating for it.
Ned Flanders
on 20 Nov 2019
Edited: Ned Flanders
on 4 Dec 2019
I did that of course too. Everybody really should!
I also think they should and will have to implement OpenBLAS. I had a chance to have a short look at how the upcoming Threadripper 3k performs in several Benchmarks. Given the fact that Intel is basically losing competitiveness entirely, they will not be able to ignore giving support for the by far fastest CPUs available on the market.
My feeling is, that they haven't really been aware of the reason why AMD CPUs were underwhelming in Matlab. They recommend in system requirements that you should have an Intel or AMD CPU with AVX2 support. Yet, AVX2 has never been used on AMD CPUs because of the discriminating dispatcher in the MKL.
Given the attention this has drawn, they might get into action but as you say, please folks, submit a request in your very own interest.
I also added this to the post on Reddit.
Your 50% speedup.... is indeed quite impressive!
Pat Quillen
on 3 Dec 2019
At MathWorks, we are continuing to investigate this to determine if we can qualify a change to the full production release of MATLAB. Note that in the meantime we are unable to confirm that using these environment variables will work correctly throughout our products, so use at your own risk.
In addition to the approach suggested above, it is possible to substitute a different BLAS implementation for the BLAS qualified by MathWorks for use in MATLAB. This can be done by specifying the full path to the .so/.dll containing your BLAS implementation in an environment variable called BLAS_VERSION. This comes with the same caveats that MathWorks has not qualified our products against alternate BLAS implementations, so as above, we can't confirm that using your own BLAS, such as OpenBLAS, will work correctly throughout our products.
Pat Quillen
on 3 Dec 2019
Note that I also posted the same as above as a comment in the reddit post.
Wick
on 3 Dec 2019
@PatQuillen, thanks for your comment. As this thread is a year and a half old and this is a new solution, it's pretty apparent that the ability to switch BLAS libraries is not well known to the MATLAB community.
So what you're saying is that MATLAB checks for a variable BLAS_VERSION and will use it rather than the built-in MKL if it exists? And I set the variable the same way @NedFlanders describes how one sets the variables for Linux or Windows?
Will MATLAB fall back to MKL if a call is not supported by the replacement library or will it crash? That's the nice bit about the hack above. We know the MKL library supports everything because you've built MATLAB to use it.
I've seen suggestions that flame/BLIS is faster even than MKL on Intel's own hardware and faster than OpenBLAS everywhere. Perhaps some folks that know what they're doing can try that out and provide some pointers.
Pat Quillen
on 3 Dec 2019
@Wick, yes, this is not well-known. It is not documented, and we usually only tell folks about it when they call into customer support.
To help clarify, what I'm saying is that upon load of the BLAS, MATLAB checks for the existence of BLAS_VERSION and loads whatever library is pointed to by that variable in lieu of the default specified by MATLAB. MATLAB looks for symbols corresponding to those in the BLAS standard: netlib.org/blas and uses them as the BLAS. If you have a complete BLAS from your vendor, or if you've compiled one, you should have no problem.
MATLAB will not fall back to MKL if the function is not supported by the implementation. Instead, you might get a crash or an error. On the other hand, you can layer by specifying a whole bunch of library implementations in your BLAS_VERSION.
You can use the environment variable BLAS_VERBOSITY to see what MATLAB is trying to do. Set that to 1 to get a little info, set it to 2 to get a lot.
And yes, set environment variables as described above for either Windows or Linux.
Pat Quillen
on 3 Dec 2019
I should add that you need to execute something in MATLAB that will cause the BLAS to be loaded, like norm.
Wick
on 4 Dec 2019
@PatQuillen, thanks I figured that out. The BLAS_VERBOSITY is handy (no spaces allowed in the DOS command I learned). Is there a way to for the BLAS library to reload or do I have to restart MATLAB each time? If you want to stack paths, use a semicolon to separate them (again, in Windows).
I found out how to download a DLL for BLIS but it errors out immediately on "caxpy" (which is pretty basic). So I'm working on it. OpenBlas is next.
Pat Quillen
on 4 Dec 2019
@Wick, you have to restart MATLAB every time. There's (currently) no way to force unloading the BLAS.
Valid separators between libraries on the list are space, semicolon, or comma---that's platform independent.
Wick
on 4 Dec 2019
@PatQuillen thanks. That would explain why BLAS_VERSION cannot be set to something within the "Program Files" directory - the default location for MKL. It's breaking the parse at the space in the folder name. I had to copy the mkl.dll to another folder to try setting it as the fall-over library.
Yair Altman
on 17 Dec 2019
@Wick - try setting the Program Files path within quotation marks, as in "C:\Program Files\bla\bla\blas.dll";"C:\Program Files\bla2\bla2\blast.dll"
Aldo Corbellini
on 4 Apr 2020
@Wick - Where did you find BLIS and/or OpenBLAS .dll for win64? I would like to test these libraries on my new AMD TR. All I was able to find are some build recipes to Linux GCC compilers!
[Hi, Yair!]
More Answers (3)
Heiko Weichelt
on 15 Mar 2022
After intense collaboration between MathWorks and AMD, as of MATLAB R2022a, MATLAB ships a custom-built version of AOCL 3.1 that can be activated as described here:
Notice that AOCL versions from other sources might not be configured / built correctly and may cause MATLAB to error, crash, or return incorrect results.
2 Comments
Wick
on 4 Dec 2019
Edited: Wick
on 4 Dec 2019
The Accepted Answer by @NedFlanders is the best solution so far. Use that one.
But in the comments of that answer, MathWorks staff member @PatQuillen shared some useful undocumented environment variables that allow anyone to hook into any external BLAS library. This has the potential to be very useful for getting other BLAS packages such as OpenBLAS or BLIS working within MATLAB. Those comments are already buried in that thread so I'm pulling them out as a stand-alone solution. I'll repeat the warning from those comments: "This comes with the same caveats that MathWorks has not qualified our products against alternate BLAS implementations, so as above, we can't confirm that using your own BLAS, such as OpenBLAS, will work correctly throughout our products."
We're going to be setting environment variables for the host operating system. This can be done in a temporary or permanent way outside of MATLAB for both Linux and Windows as can be seen in @NedFlander's reddit thread. However, I'm only going to use the setenv command to set these for only one instance of MATLAB.
MATLAB loads the BLAS library the first time it tries to execute a computation so you can make changes before that point. Once the BLAS library is loaded, there's no way to unload it. You'll have to restart.
The environment variable BLAS_VERBOSITY will set MATLAB to detail information to the Command Window about the loading process. A value of 1 is minimal information, 2 is more.
setenv('BLAS_VERBOSITY','1')
The environment variable BLAS_VERSION, if defined, will direct MATLAB to load the BLAS library from the specified file(s) rather than use its built-in default. The files should be the .so/.dll for the BLAS implementation you plan to use that follows the symbols defined by https://netlib.org/blas/.
setenv('BLAS_VERSION','c:\temp\mkl.dll')
Would load a copy of the MKL library copied into c:\temp. You can use a semicolon, comma, or space to join multiple file locations into a single definition of BLAS_VERSION. So if you're writing your own BLAS that doesn't support all the possible methods you could roll over to MKL as a failsafe, e.g.
3 Comments
Rasoul Nikbakht
on 14 Oct 2020
Could you please elaborate on this comment?
I have an AMD CPU, Ryzen 2970wx, and It seems they have a very efficient implementation of the BLAS library, which they call it BLIS. I would like to change the Matlab default BLAS library (intel) to the AMD one. Currently, even with applying the trick export MKL_DEBUG_CPU_TYPE=5 Matlab on AMD CPU (using Ubuntu 18) is not as fast as it supposed to be.
I think any other library rather than Intel MKL should work fine for AMD CPUS.
Bernhard Wistawel
on 1 Feb 2021
Hi! Where can I find the instructions for MatLab on Linux (using RHEL)?
Bernhard Wistawel
on 24 Feb 2021
Will 2021a correct this behaviour? Or let us choose the BLAS distribution?
Ken M.
on 9 Nov 2019
You are saying don't use windows for matlab.
Since that is the easy way around, people stop complaining about it after the switch.
Many programs just work faster with linux so if speed is important then linux is an obvious choice also for matlab.
9 Comments
Bruno Luong
on 9 Nov 2019
"Many programs just work faster with linux"
Any evident to back up this claim?
I did a benchmark might be 10 year back and they are comparable.
If you run BENCH on R2019B you'll see the fastest benchmark make by TMW is Windows 7 followed by Linux, though it is not the same HW.
Ken M.
on 9 Nov 2019
Edited: Ken M.
on 9 Nov 2019
Some compare test from Hardware Unboxed
If you don't mind the change, I wouldn't stay with windows. Overal I think it is a win for everyone. Maybe the main reason is that linux can handle more cores easier.
I also use an astronomy program pixinsight and it also works much faster on linux than windows.
Wick
on 10 Nov 2019
Changing to Linux is not necessarily a possibility in the work flows for many people. Since Windows users on desktops vastly outnumber Linux users, it would be nice if Mathworks could compile with good options for Ryzen/Threadripper/Epyc users.
However, if someone does have the ability to run both operating systems back-to-back, I'd be more than happy to see a comparison of the two addressing per-thread performance.
Mark Smith
on 5 Jan 2020
Many thanks to Ned Flanders and others that have commented here. I have had some correspondence with Mathworks and indicated to them that Matlab should have optimized binaries for AMD cpus. As a lark, I decided to use the bench command in Win 10 and Kubuntu in various configurations to demonstrate the efficacy of having optimized binaries for AMD cpus. I primarily use Win 10 and am a Linux novice. I was able to get Kubuntu 19.10 installed on a separate drive and ran a few bench commands. I have 5 screen shots showing how use of the environmental variable changes performance in both Win 10 and Kubuntu which I was prevented from uploading. I also downloaded the AMD AOCL precompiled Ubuntu binaries and AMD Math Library (LibM) Ubuntu binary and used those with the bench command.
My machine for these tests is a Threadripper 2950x running on Asrock X399 Pro Gaming motherboard with Gigabyte 1080 Ti. For all these tests, the bios was set to defaults with Precision Boost Overdrive not active (3.5 Ghz base clock). I normally run Win 10 with the 2950x at 4.4 Ghz with powerful custom cooling. All tests were run with 64 GB ram.
The simple summary is that Win 10 is not suited for Matlab with a score of ~55 on the bar chart (below the Surface Pro 3). This is improved to ~75 using the Win 10 environmental variable MKL_DEBUG_CPU_TYPE=5. If I perform bench overclocked to 4.4 Ghz with 32 GB ram, the score goes to ~85. Not much jump for possibly running this fine chip at too high a clock.
For Kubuntu with bios default settings, no overclocking and no setting of MKL_DEBUG_CPU_TYPE=5 prior to starting Matlab results in a score of ~65. Adding export MKL_DEBUG_CPU_TYPE=5 prior to starting Matlab results in a score of ~95, thats right ~95. Adding export commands to link the AMD Ubuntu binaries along with MKL_DEBUG_CPU_TYPE=5 results in a score of ~98. With these changes it is the second ranked machine below entry for Win 7 running on Xeon E5-1650 v3 at 3.5 Ghz.
My takeaway is that if Mathworks major market is tied to Win 10, better math binaries are needed. The simple setting of an environmental variable is not sufficient in Win 10. The great benefit obtained in Linux by just setting the environment variable needs to be explained. I would be interested in knowing what is different between Linux and Win 10 that allows the MKL_DEBUG_CPU_TYPE=5 environmental variable to have such a much better effect in Linux. At this point I infer that Microsoft is also in bed with Intel in hampering AMD performance or just ignorant of the effects of its software on math libraries.
I like Matlab, it is powerful and a major tool in the industry. It needs to be better optimized for different cpu configurations.
Tyler Moskov
on 23 Apr 2020
Could you go into more detail on adding export commands to link the AMD Ubuntu binaries or post a link on how to?
Thank you
Ken M.
on 24 Apr 2020
@Tyler as of 2020a the MKL_DEBUG_CPU_TYPE=5 workaround should not longer be needed for AMD CPU's
Tyler Moskov
on 24 Apr 2020
That's what I've heard, but I still have 2019b and want to see if there are any added benified of using AMD's AOCL.
Yavor Dobrev
on 26 Mar 2021
Can you please provide details on how you link the AMD Ubuntu binaries (AOCL). I have tried:
export BLAS_VERSION=/home/dobrev/amd/aocl/3.0-6/lib/libblis.so
However, when use bench I get:
cpu_id: x86 Family 143 Model 96 Stepping 1, AuthenticAMD
BLAS: trying environment...
BLAS: loading /home/dobrev/amd/aocl/3.0-6/lib/libblis.so
BLAS: loaded /home/dobrev/amd/aocl/3.0-6/lib/libblis.so@0x7fcbf7ab2220
BLAS: /home/dobrev/amd/aocl/3.0-6/lib/libblis.so is not a compatibility layer.
I also tried using openBLAS with the same result.
Heiko Weichelt
on 15 Mar 2022
As of MATLAB R2022a, MATLAB ships a version of AOCL 3.1 that AMD custom-build for MATLAB. It can be activated as described here:
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)