• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

MATLAB MKL Codepath Tweak Boosts AMD Ryzen MKL Performance Significantly

Joined
Aug 22, 2014
Messages
39 (0.01/day)
System Name Bird's Monolith
Processor Intel i7-4770k 4.6 GHz (liquid metal)
Motherboard Asrock Z87 Extreme3
Cooling Noctua NH-D14, Noctua 140mm Case Fans
Memory 16 GB G-Skill Trident-X DDR3 2400 CAS 9
Video Card(s) EVGA 1080ti SC2 Hybrid
Storage 2 TB Mushkin Triactor 3D (RAID 0)
Display(s) Dell S2716DG / Samsung Q80R QLED TV
Case Fractal Design Define R4
Audio Device(s) Audio Engine D1 DAC, A5+ Speakers, SteelSeries Arctis 7
Power Supply Seasonic Platinum 660 W
Mouse SteelSeries Rival
Keyboard SteelSeries Apex
Software Windows 10 Pro x64
As a regular user of MATLAB, I have to say this really falls on Mathworks from my perspective. MATLAB runs on the Java virtual machine so that it can be hardware agnostic and high level. As a company, you want MATLAB to perform its best on any hardware, so whether that's using a proprietary library or a free one, they should strive to optimize for many architectures. Intel is totally in the right to have MKL fallback to SSE if a compatible processor is not detected, it's their library for their processors. However, shame on MathWorks for not investigating the implications for AMD chipsets when utilizing this design choice.

To be fair, Intel has been dominating the processor market for nearly over a decade, so for the clients where performance really matters they were probably running Intel already. But as the tables are turning there is more scrutiny on their design choices (and much deserved).
 
Joined
Feb 18, 2005
Messages
5,239 (0.75/day)
Location
Ikenai borderline!
System Name Firelance.
Processor Threadripper 3960X
Motherboard ROG Strix TRX40-E Gaming
Cooling IceGem 360 + 6x Arctic Cooling P12
Memory 8x 16GB Patriot Viper DDR4-3200 CL16
Video Card(s) MSI GeForce RTX 4060 Ti Ventus 2X OC
Storage 2TB WD SN850X (boot), 4TB Crucial P3 (data)
Display(s) 3x AOC Q32E2N (32" 2560x1440 75Hz)
Case Enthoo Pro II Server Edition (Closed Panel) + 6 fans
Power Supply Fractal Design Ion+ 2 Platinum 760W
Mouse Logitech G602
Keyboard Logitech G613
Software Windows 10 Professional x64
As a regular user of MATLAB, I have to say this really falls on Mathworks from my perspective. MATLAB runs on the Java virtual machine so that it can be hardware agnostic and high level. As a company, you want MATLAB to perform its best on any hardware, so whether that's using a proprietary library or a free one, they should strive to optimize for many architectures. Intel is totally in the right to have MKL fallback to SSE if a compatible processor is not detected, it's their library for their processors. However, shame on MathWorks for not investigating the implications for AMD chipsets when utilizing this design choice.

To be fair, Intel has been dominating the processor market for nearly over a decade, so for the clients where performance really matters they were probably running Intel already. But as the tables are turning there is more scrutiny on their design choices (and much deserved).

MathWorks doesn't really have any incentive to do anything because they have a captive market. For all we know they've signed an agreement with Intel to use MKL.
 
Joined
Jan 8, 2017
Messages
8,863 (3.36/day)
System Name Good enough
Processor AMD Ryzen R9 7900 - Alphacool Eisblock XPX Aurora Edge
Motherboard ASRock B650 Pro RS
Cooling 2x 360mm NexXxoS ST30 X-Flow, 1x 360mm NexXxoS ST30, 1x 240mm NexXxoS ST30
Memory 32GB - FURY Beast RGB 5600 Mhz
Video Card(s) Sapphire RX 7900 XT - Alphacool Eisblock Aurora
Storage 1x Kingston KC3000 1TB 1x Kingston A2000 1TB, 1x Samsung 850 EVO 250GB , 1x Samsung 860 EVO 500GB
Display(s) LG UltraGear 32GN650-B + 4K Samsung TV
Case Phanteks NV7
Power Supply GPS-750C
Intel is totally in the right to have MKL fallback to SSE if a compatible processor is not detected

I have trouble understanding how this works.

Why doesn't Intel make it so that it will always fail to compile or run when anything other than their ID is found if they are indeed not obligated to support anything other than their own CPUs ? Why the arbitrary fallback to SSE ?

It's obvious to anyone that these were conscious choices meant to disadvantage other vendors. It's one thing to make your software compatible just with your hardware and a totally different mater when your software discriminates other vendors without disclosing this to end users.

MathWorks for not investigating the implications for AMD chipsets when utilizing this design choice.

I know Intel and what sort of deals they make to partners all to well, I am convinced they knew exactly how their compiler and libraries work.
 
Last edited:
Joined
Aug 22, 2014
Messages
39 (0.01/day)
System Name Bird's Monolith
Processor Intel i7-4770k 4.6 GHz (liquid metal)
Motherboard Asrock Z87 Extreme3
Cooling Noctua NH-D14, Noctua 140mm Case Fans
Memory 16 GB G-Skill Trident-X DDR3 2400 CAS 9
Video Card(s) EVGA 1080ti SC2 Hybrid
Storage 2 TB Mushkin Triactor 3D (RAID 0)
Display(s) Dell S2716DG / Samsung Q80R QLED TV
Case Fractal Design Define R4
Audio Device(s) Audio Engine D1 DAC, A5+ Speakers, SteelSeries Arctis 7
Power Supply Seasonic Platinum 660 W
Mouse SteelSeries Rival
Keyboard SteelSeries Apex
Software Windows 10 Pro x64
I have trouble understanding how this works.

Why doesn't Intel make it so that it will always fail to compile when anything other than their ID is found if they are indeed not obligated to support anything other than their own CPUs ? Why the arbitrary fallback to SSE ?

It's obvious to anyone that these were conscious choices meant to disadvantage other vendors. It's one thing to make your software compatible just with your hardware and a totally different mater when your software discriminates other vendors without disclosing this to end users.

I agree with you there. It's not necessarily an intelligent or accommodating decision, but simply one they had the right to make.

This all reminds me a lot of what Nvidia does with some of their tech, they're totally in the right to lock out certain tech or features. They do it all the time to either hinder performance on non-Nvidia GPUs or to force the customer to be locked into their ecosystem. I have no problem if a game developer chooses to use Nvidia tech to get things running the best they can be on Nvidia GPUs, it bothers me when they simply neglect alternative code paths for other GPUs.

In this context, I won't comment on whether this design choice was a conscious decision by both MathWorks and Intel to put certain users at a disadvantage, there is simply no way of knowing. I'm just glad that the media is putting light to this issue so that those of us that do pay a lot for a license can make a stink about it. A lot of researchers are excited about what Zen 2 brings to the table and Mathworks is going to want a piece of that.
 
Joined
May 31, 2016
Messages
4,323 (1.51/day)
Location
Currently Norway
System Name Bro2
Processor Ryzen 5800X
Motherboard Gigabyte X570 Aorus Elite
Cooling Corsair h115i pro rgb
Memory 16GB G.Skill Flare X 3200 CL14 @3800Mhz CL16
Video Card(s) Powercolor 6900 XT Red Devil 1.1v@2400Mhz
Storage M.2 Samsung 970 Evo Plus 500MB/ Samsung 860 Evo 1TB
Display(s) LG 27UD69 UHD / LG 27GN950
Case Fractal Design G
Audio Device(s) Realtec 5.1
Power Supply Seasonic 750W GOLD
Mouse Logitech G402
Keyboard Logitech slim
Software Windows 10 64 bit
They didn't spend money in the first place, but they are going to do it now just to keep them from optimizing for AMD. Until someone publicly shows the problem, like in this case.
They didn't? Why would you say that? they were working on the "different path for other processors than Intel" and that requires programming and what comes after resources to do so. So why you say they did not spend money on that? Maybe they will have to spend more which in my eyes is not surprising :)
 
Joined
Sep 26, 2018
Messages
47 (0.02/day)
If Intel wants to provide free software to Intel chip users as a bonus, and AMD chip users have problems using that software, that, in itself wouldn't be unfair competition by Intel. The problem, of course, is that MKL is being used in third-party applications that people buy without expecting them to be tied to "Genuine Intel" processors.

AMD, being a smaller company, doesn't spend as much on software to accompany its products as other companies. Thus, Nvidia gives away a free professional-quality compiler for Windows to make effective use of its graphics cards; AMD's offering in this area is a modified version of an open-source compiler, and it only runs and produces code for Linux.

I think that while hacks, and legal remedies, are a short-term option, AMD will have to look into putting some effort into the software side of things to avoid constantly getting blindsided this way.
 
Joined
Jun 28, 2016
Messages
3,595 (1.27/day)
Anticompetitive in terms of it deliberately generating worse code for non-Intel processors for no good reason.
I believe the reason was: no one uses AMD CPUs anyway - why bother?

And as I mentioned multiple times: this was MathWorks decision. If someone find this unfair, he should criticize/contact that company - not Intel.
Obviously, AMD should have done it. They don't, because that's how they're doing business. They make hardware and don't care about anything else - eventually blaming the World that it doesn't change everything possible to support them.

Intel and Nvidia (and every serious hardware maker) provide support / consulting service as well.
which can only mean it's intended to disadvantage non-Intel CPUs, and that is the very definition of anticompetitive behaviour.
But Intel never said MKL should work on AMD CPUs. I've already linked to the site. Supported CPUs: Intel's. End of story.
There's absolutely no reason why they would have to optimize MKL for other hardware.
Given the above, and the fact that MKL is essentially the only library available that does what it does, it could likely be argued that Intel's behaviour here violates antitrust laws.
What??? It's just an Intel-optimized replacement for open source libraries.
Show me one example of what you suggested. Of course other than stuff Intel-specific (like MKL-DNN).

Moreover, AMD makes a very similar product: AOCL (AMD Optimizing CPU Libraries)
(it used to be called ACML: "AMD Core Math Library")

The problem, of course, is that MKL is being used in third-party applications that people buy without expecting them to be tied to "Genuine Intel" processors.
Correct. So AMD should go to MathWorks and say: "hey, your software doesn't utilize our hardware very well - but we'll help you with the coding".
And it seems they haven't.

In fact Intel, Nvidia and any normal company does something like this already before launch of new products.
AMD famously didn't even give mobo makers full chipset specification before Zen launch. It's how they like doing their business. It's their choice.
AMD, being a smaller company, doesn't spend as much on software to accompany its products as other companies.
So they can raise prices and have more cash to spend on software (and documentation, and pre-launch tests, and website).
They don't, consciously. They want to be a cheap alternative. That's it.
AMD is certainly large enough to provide proper support. Many much smaller companies do.

Some milk catrons come with a comfortable opener or a screw cap, while others force you to cut a hole with scissors, but cost $0.1 less. It's a business strategy.
Thus, Nvidia gives away a free professional-quality compiler for Windows to make effective use of its graphics cards; AMD's offering in this area is a modified version of an open-source compiler, and it only runs and produces code for Linux.
Bad argument. You could have kept defending the Intel-AMD differences (which are enormous). :p

Nvidia employs just 30% more people than AMD (13k vs 10k) and is less than twice as big on revenue ($11.7B vs $6.5B in 2018).
But Nvidia is basically a gold standard when it comes to libraries, software and support.
 
Last edited:
Joined
Oct 26, 2019
Messages
115 (0.07/day)
We all know Intel's way of doing business
no need for you to justify their wrongful actions
 
Joined
Jul 16, 2014
Messages
8,115 (2.29/day)
Location
SE Michigan
System Name Dumbass
Processor AMD Ryzen 7800X3D
Motherboard ASUS TUF gaming B650
Cooling Artic Liquid Freezer 2 - 420mm
Memory G.Skill Sniper 32gb DDR5 6000
Video Card(s) GreenTeam 4070 ti super 16gb
Storage Samsung EVO 500gb & 1Tb, 2tb HDD, 500gb WD Black
Display(s) 1x Nixeus NX_EDG27, 2x Dell S2440L (16:9)
Case Phanteks Enthoo Primo w/8 140mm SP Fans
Audio Device(s) onboard (realtek?) - SPKRS:Logitech Z623 200w 2.1
Power Supply Corsair HX1000i
Mouse Steeseries Esports Wireless
Keyboard Corsair K100
Software windows 10 H
Benchmark Scores https://i.imgur.com/aoz3vWY.jpg?2
not sure if this was posted but here this explains how Intel can get away with this compiler cheat. Notice how its a jpeg and not plain text ( it is rumored to prevent it from being websearched).



Apparantly the FTC is involved here too.

[for my reference]
 
Joined
Jun 28, 2016
Messages
3,595 (1.27/day)
not sure if this was posted but here this explains how Intel can get away with this compiler cheat. Notice how its a jpeg and not plain text ( it is rumored to prevent it from being websearched).
This is a standard and well-known note that Intel published few years ago.
On this particular site they provide a formatted graphics (in multiple languages) to be used by developers in presentations, on websites etc.

You can easily find the exact same notice in Intel's documentation (www, pdfs) - as text, obviously.
As for "being websearched": I wonder if anyone spreading this conspiracy rumor actually tried:
https://www.google.com/search?&q="compilers+may+or+may+not+optimize+to+the+same+degree"

Some results from the query above:
https://software.intel.com/sites/pr...ssue11/7080_2_IN_ParallelMag_Issue11_CBWR.PDF
https://software.intel.com/en-us/onemkl-linux-developer-guide-notices-and-disclaimers
https://software.intel.com/en-us/system-studio/features/build
https://software.intel.com/en-us/parallel-studio-xe/features/analyze
 
Last edited:
Joined
Aug 20, 2007
Messages
20,714 (3.41/day)
System Name Pioneer
Processor Ryzen R9 7950X
Motherboard GIGABYTE Aorus Elite X670 AX
Cooling Noctua NH-D15 + A whole lotta Sunon and Corsair Maglev blower fans...
Memory 64GB (4x 16GB) G.Skill Flare X5 @ DDR5-6000 CL30
Video Card(s) XFX RX 7900 XTX Speedster Merc 310
Storage 2x Crucial P5 Plus 2TB PCIe 4.0 NVMe SSDs
Display(s) 55" LG 55" B9 OLED 4K Display
Case Thermaltake Core X31
Audio Device(s) TOSLINK->Schiit Modi MB->Asgard 2 DAC Amp->AKG Pro K712 Headphones or HDMI->B9 OLED
Power Supply FSP Hydro Ti Pro 850W
Mouse Logitech G305 Lightspeed Wireless
Keyboard WASD Code v3 with Cherry Green keyswitches
Software Windows 11 Enterprise (legit), Gentoo Linux x64
Of course we could argue if this is OK or not. Intel can't guarantee that AMD CPUs support AVX2 or not. What if they suddenly stopped? Would we them blame Intel for making a library that crashes on competition's CPUs?
But let's not do that.

You could check the cpu supported feature flags at runtime, like a normal program...

Still, I somehow got matlab mixed up with the Intel Compiler Suite. My apologies for blaming the wrong party in this instance.
 
Joined
Jun 28, 2016
Messages
3,595 (1.27/day)
You could check the cpu supported feature flags at runtime, like a normal program...
Sure, but why would they?

It strikes me that people who criticize Intel for this may think that the CPU is their product, while the surrounding software is just an addition. A bonus for the community.
That is grossly incorrect.
It's not a fun side project. They've written optimized libraries that are faster than popular open-source variants (even without AVX-512). They've spent money doing it.
Intel MKL is a product as well. They don't make you pay for it, but it's there to make the paid hardware more attractive.
Why would they give it to AMD?

And moving to the inevitable car analogy: should we also expect Mercedes to provide their multimedia system installers compatible with other brands? So that you could run a feature-rich, polished multimedia software on a Dacia Sandero?

Seriously, Intel could have just limited MKL to their CPUs - just like Nvidia did with CUDA.
That would be totally fine and wouldn't provoke the shitstorm on gaming forums that we have today.
 
Joined
Jul 16, 2014
Messages
8,115 (2.29/day)
Location
SE Michigan
System Name Dumbass
Processor AMD Ryzen 7800X3D
Motherboard ASUS TUF gaming B650
Cooling Artic Liquid Freezer 2 - 420mm
Memory G.Skill Sniper 32gb DDR5 6000
Video Card(s) GreenTeam 4070 ti super 16gb
Storage Samsung EVO 500gb & 1Tb, 2tb HDD, 500gb WD Black
Display(s) 1x Nixeus NX_EDG27, 2x Dell S2440L (16:9)
Case Phanteks Enthoo Primo w/8 140mm SP Fans
Audio Device(s) onboard (realtek?) - SPKRS:Logitech Z623 200w 2.1
Power Supply Corsair HX1000i
Mouse Steeseries Esports Wireless
Keyboard Corsair K100
Software windows 10 H
Benchmark Scores https://i.imgur.com/aoz3vWY.jpg?2
Sure, but why would they?

It strikes me that people who criticize Intel for this may think that the CPU is their product, while the surrounding software is just an addition. A bonus for the community.
That is grossly incorrect.
It's not a fun side project. They've written optimized libraries that are faster than popular open-source variants (even without AVX-512). They've spent money doing it.
Intel MKL is a product as well. They don't make you pay for it, but it's there to make the paid hardware more attractive.
Why would they give it to AMD?

And moving to the inevitable car analogy: should we also expect Mercedes to provide their multimedia system installers compatible with other brands? So that you could run a feature-rich, polished multimedia software on a Dacia Sandero?

Seriously, Intel could have just limited MKL to their CPUs - just like Nvidia did with CUDA.
That would be totally fine and wouldn't provoke the shitstorm on gaming forums that we have today.
when the FTC criticizes this and you defend INTEL....just makes my day. :respect: :banghead:
EDIT: mix up there.
 
Last edited:
Joined
Jun 28, 2016
Messages
3,595 (1.27/day)
when the FCC criticizes this and you defend INTEL....just makes my day. :respect: :banghead:
Have you actually read the FTC article from your earlier post? Do you understand it?
And do you understand the idea of a calendar?

This FTC case is from 2009-2010.
The notice (which you've linked as well) is from 2011 and it's a response to that FTC ruling.

In short:
Intel's software is not offering full support of competing hardware products (which is shocking - I know!), but this wasn't "written on the box".
So now it is.

Seriously, no one expects you to be a C++ programmer or Intel compiler/MKL expert. But you should understand your mistake by now, so stop writing these pointless posts.
And, please, stop tagging me in other threads with that "Intel expert" irony. Get a life.
 
Joined
Jul 16, 2014
Messages
8,115 (2.29/day)
Location
SE Michigan
System Name Dumbass
Processor AMD Ryzen 7800X3D
Motherboard ASUS TUF gaming B650
Cooling Artic Liquid Freezer 2 - 420mm
Memory G.Skill Sniper 32gb DDR5 6000
Video Card(s) GreenTeam 4070 ti super 16gb
Storage Samsung EVO 500gb & 1Tb, 2tb HDD, 500gb WD Black
Display(s) 1x Nixeus NX_EDG27, 2x Dell S2440L (16:9)
Case Phanteks Enthoo Primo w/8 140mm SP Fans
Audio Device(s) onboard (realtek?) - SPKRS:Logitech Z623 200w 2.1
Power Supply Corsair HX1000i
Mouse Steeseries Esports Wireless
Keyboard Corsair K100
Software windows 10 H
Benchmark Scores https://i.imgur.com/aoz3vWY.jpg?2
Intel's software is not offering full support of competing hardware products (which is shocking - I know!)
I'm confident that to say that not everyone expected them too, but thats not really the point now is it? it strikes me to call anyone a fanboi since fanboi's cherry pick things to "Discuss" and argue, but the fact that Intel carried on despite the ruling working thru loopholes. its a shady practice in this day and age, its not misunderstood and its not unexpected either. The scandal here, like any other tech, is in getting called out on it. :cool:

The only thing pointless here is arguing with me, I'm no expert in anything, but thats the problem with a jack of all trades. :respect:
 
Last edited:

Ned Flanders

New Member
Joined
Dec 4, 2019
Messages
3 (0.00/day)
@notb

I understand your frustration. The MKL is an Intel marketing instrument and it is their choice to allow customers to enable or disabled it's functionality to non Intel CPUs. They decided to exclude AMD based systems from using an efficient codepath. Not my style but fair enough.

However, what should not happen is that Intel creates this lib and advertises it to (and I am quoting from the frontpage of Intel's official MKL developers guide) "also perform well on non-Intel processors" while they implement a performance kill switch to prohibit exactly that.

whatever.png


That's just bizarre!

Mathworks did well implementing this lib. Of course it should be implemented in any comparable software because it is arguably the best numeric lib out there. However, where Mathworks failed is to not implement an alternative like BLIS or OpenBLAS and, at the same time state in the system requirements that an "Intel or AMD CPU with AVX2 support is recommended". AVX2 on AMD was never used because of the discriminative nature of the MKL anyway, yet this sentence in the Intel dev guide is there to provoke exactly that. Fool devs to use it without implementing alternatives.
 
Last edited:
Joined
Jun 28, 2016
Messages
3,595 (1.27/day)
I understand your frustration.
Frustration?

Also, I'm flattered that someone felt the need to create an account just to share his feedback about my post.
And if you're a regular here, but felt to ashamed to write this under your normal nick - that still counts as an extra labour. So thanks!
However, what should not happen is that Intel creates this lib and advertises it to (and I am quoting from the frontpage of Intel's official MKL developers guide) "also perform well on non-Intel processors" while they implement a performance kill switch to prohibit exactly that.
Funny you've posted a screenshot of small part of the text, but not the link. And you say I'm frustrated.


I'm not going to discuss the semantics of "performs well". Maybe you're right. They could have rephrased it.
The "optimization notice" we're discussing here is included on that website. And it's not like it's thousand lines long, so you'll never get there.

And BTW: as text again! @DeathtoGnomes

Mathworks did well implementing this lib. Of course it should be implemented in any comparable software because it is arguably the best numeric lib out there. However, where Mathworks failed is to not implement an alternative like BLIS or OpenBLAS and, at the same time state in the system requirements that an "Intel or AMD CPU with AVX2 support is recommended". AVX2 on AMD was never used because of the discriminative nature of the MKL anyway, yet this sentence in the Intel dev guide is there to provoke exactly that. Fool devs to use it without implementing alternatives.
I've said multiple times that - if anyone - Mathworks is the company that should be discussed here. I'm not sure if "blamed" is a good word as well. They've optimized the software for architecture their clients use. Most of current Matlab code was written in a period AMD had no presence in business/engineering computers.
AMD is getting popular now - I'm sure Mathworks will adjust to provide efficient software to those customers (because why lose them to competitors?).
But people here used this as an occasion to attack Intel, so I reacted. Yes, I know Matlab. Yes, I use MKL. So this was something I could share with people who may not be into this kind of topics.

PC forums used to be about sharing knowledge, while attacking companies and mocking fellow members always had a lower priority (but existed, it's the Internet after all).
I don't understand what happened to TPU.
Sure, this was always a very specific place (very focused on gaming and on desktops, not interested in engineering or pro use, very anti Apple - compared to other tech forums).
But recently it's all about attacking Intel, with some of the staff taking part or at least turning a blind eye. And the dodgy software keys issue on top...
I'm not sure this strategy will work in long term, but owners are entitled to do whatever they want with their site (just like Intel and Mathworks do with their software).
 

Ned Flanders

New Member
Joined
Dec 4, 2019
Messages
3 (0.00/day)
I'm flattered that someone felt the need to create an account just to share his feedback about my post.
And if you're a regular here, but felt to ashamed to write this under your normal nick - that still counts as an extra labour. So thanks!

You are most welcome! I created several accounts in the last weeks to participate in this discussion. I don't think its particularly shameful what I posted here. I did not expect my post to go far out of the matlab community but I have to say I am actually quite happy, that the many reports in most tech mags raised a great level of awareness to the problem. And awareness is the first step to avoidance. So that must be a good thing.

I'm not going to discuss the semantics of "performs well". Maybe you're right. They could have rephrased it.

We can discuss the meanings of "good performance" if you wish. However, I think its clear that this is very misleading and clearly should not be stated there. Instead they should replace it with "MKL does NOT perform well on non-Intel processors" But I feel you agree with that.

And I agree with you regarding Mathworks, it's their turn to implement MKL alternatives now, as already stated. I am quite sure that Intel will not remove their vendor string kill switch.
 
Last edited:
Top