10 ms·
Intel's “cripple AMD” function (2019)
- Jonnax 6y agoIs there major software that uses I tell compiler?
- Lammy 6y agoUnsure, but I think that's the implication of this bit in the OP: "The same effect was documented with some of the most popular mathematical software packages, including Mathematica, Mathcad, and Matlab."
- satya71 6y agoI think you meant Intel Compiler? Yes. Intel Compiler consistently produces the highest performing binaries on Intel processors, often by a big margin. Intel MKL used to be the highest performing math library, and may still be so. As a result, most performance critical software, such as scientific applications, are compiled using ICC.
- shmerl 6y agoSo what are they compiled with for non Intel processors?
- petschge 6y agoThe HPC codes I worked on we would compile with gcc, clang, icc and whatever vendor compiler was installed (Cray, PGI, something even worse). Then we'd benchmark the resulting binaries and make a recommendation based on speed. (Assuming the compiled binaries gave the correct results, which would sometimes fail and trigger further debugging to find out if we had undefined behaviors (or implementation defined) or had managed to find a compiler bug. For codes that are memory-bandwidth dominated the results are pretty much a toss-up. For compute bound codes intel would often win. You can do the same when your machine has non-intel CPUs that are supported by a lot of compilers. If you are on power9 or arm the compiler list gets shorter. And a lot of supercomputers start to contain accelerators (often, but not always Nvidia GPUs) in which case there is often only one supported compiler and you have to rewrite code until that compiler is happy and produces fast code.
- jedbrown 6y agoThis is an overstatement. ICC consistently compiles the slowest and produces the largest binaries. It also defaults to something close to -ffast-math, which may or may not be appropriate. If your app benefits from aggressive inlining and vectorization at the expense of potentially huge increases in code size, ICC is likely to do well for you. However, I've seen lots of cases where well-vectorized code is faster with GCC or Clang, including some very important cases using Intel intrinsics. (Several such cases reported to/acknowledged by Intel; some have been fixed over the years, but these observations are not uncommon.) BLIS is used by AMD and is a good open alternative to MKL (for BLAS) across many platforms. https://github.com/flame/blis/blob/master/docs/Performance.md#epyc-results https://github.com/flame/blis/blob/master/docs/Performance.m...
- outworlder 6y agoI have been hearing about the superiority of Intel's compiler for a couple of decades now. Back when GCC was a tiny baby compared to what it is now, and when Clang/LLVM didn't even exist. I wonder if this Intel compiler 'superiority' is still the case today, or if this is just a meme at this point.
- jarvist 6y agoFor matrix manipulation based Fortran scientific codes, ifort/MKL can give +30% compared to gfortran. It's difficult to disentangle where the speedup comes from, but certainly as jedbrown aludes to, the Intel compilers seem to make a better go of poorly optimised / badly written code. For C based software, its a much closer run thing, and often sticking with GCC avoids weird segfaults when mixing Intel and GCC-compiled Linux libraries.
- kzrdude 6y agoCan you explain "BLIS is used by AMD"? In what way do they use it?
- jedbrown 6y agoIt's their official BLAS [1] since 2015 when they moved away from their proprietary ACML implementation [2]. [1]https://developer.amd.com/amd-aocl/blas-library/ https://developer.amd.com/amd-aocl/blas-library/ [2] https://developer.amd.com/open-source-strikes-again-accelerated-math-libraries-at-amd/ https://developer.amd.com/open-source-strikes-again-accelera...
- nzmlPA 6y agoThe fact that MKL is the highest performing library has nothing to do with the quality of icc's output. It is a myth that icc produces faster binaries that may have been true 25 years ago.
- Kednicma 6y agoIt's a depressingly common choice for educational installations. Folks are trained to use ICC instead of GCC and then they keep using ICC when they leave school.
- jarvist 6y agoMost high performance software on super computers uses the Intel C and Fortran compilers, and much engineering and scientific software on workstations uses the Intel Maths Kernel Library (MKL) for high performance linear algebra. Now that AMD EPYC processors are powering a lot of next generation super-computer clusters, we're going to have to figure out some workarounds!
- ip26 6y agoI think this: https://developer.amd.com/amd-aocl/amd-math-library-libm/ https://developer.amd.com/amd-aocl/amd-math-library-libm/ is supposed to be the alternative to MKL for those applications.
- jarvist 6y agoThank you! I wasn't aware of this. But this is only a replacement for libm (i.e. basic trig, exp function), not the matrix-orientated BLAS, LAPACK and SCALAPACK routines that scientific codes spend >90% of their time.
- ip26 6y agoI'm not personally familiar with those, but seems like BLAS, SCALAPACK, & others are also available: https://developer.amd.com/amd-aocl/ https://developer.amd.com/amd-aocl/
- dr_zoidberg 6y agoNo need to develop and alternative when you can trick MKL into not crippling AMD: https://www.pugetsystems.com/labs/hpc/How-To-Use-MKL-with-AMD-Ryzen-and-Threadripper-CPU-s-Effectively-for-Python-Numpy-And-Other-Applications-1637/ https://www.pugetsystems.com/labs/hpc/How-To-Use-MKL-with-AM... Edit: the link I posted follows Agner's advice from the bottom of OPs link. However I think the extra information that it adds is that Zen2 Threadrippers outpaced then-current Intel's top contender. Once Zen3 and Intel's 11th Gen become available, repeating this benchmarks would be very valuable.
- freedomben 6y ago
- the_svd_doctor 6y agoA lot of scientific/HPC code running on supercomputers is compiled with icc.
- hosteur 6y agoWow. How is this not a lawsuit happening already?
- ballenf 6y agoToward the end of the article, the several lawsuits and FTC actions are discussed. The end result of them is a disclaimer on the Intel compiler that it's not optimized for non-Intel processors and that Intel can't artificially hurt AMD performance (but it apparently has no obligation to support unique AMD optimizations either).
- wtallis 6y ago> (but it apparently has no obligation to support unique AMD optimizations either) It's a bit worse than that. Intel has no obligation to support optimizations that aren't unique to AMD; they're allowed to disable SIMD extensions that AMD processors declare support for, while at the same time using all of those SIMD extensions on Intel CPUs. They just have to include the disclaimer that their compiler and libraries may be doing this.
- colejohnson66 6y agoWhy is it just the compiler maker’s job to report it may (read: will) underperform on AMD and not also the program developer too? If I paid for software that performed worse on AMD because it deliberately hobbled itself (and was not informed), I’d want a refund. It’s straight up anti-competitive, but consumers aren’t smart enough to understand that it’s a problem; A consumer just sees biased benchmarks that show Intel outperforming AMD, and then choose Intel.
- josefx 6y ago> that Intel can't artificially hurt AMD performance (but it apparently has no obligation to support unique AMD optimizations either). As far as I understand it quite the opposite, it explicitly mentions that it may not apply "optimizations that are not unique to Intel" to other processors. It wont select the optimal code path unless the CPU vendor ID is set to GenuineIntel and fall back to the worst path your compile settings include.
- smartmic 6y agoRelated: https://news.ycombinator.com/item?id=21732902 https://news.ycombinator.com/item?id=21732902
- segfaultbuserr 6y ago> Never rely on benchmark tests unless the benchmarking code is known to be open source and compiled without using any Intel tools. A serious question - how many common benchmark packages are compiled by ICC or uses Intel MKL? I hope the number is limited, otherwise all the benchmarks published by mainstream PC reviewers are potentially biased. If there's a serious ICC-in-benchmark problem, then only Phoronix's Linux benchmarks are trustworthy - the majority of benchmarks on Phoronix uses free and open source compilers and testsuits, with known versions, build parameters and optimization levels. Thanks Michael Larabel for his service for the community.
- wtallis 6y agoThis concern really only applies to synthetic benchmarks (stuff like SPEC CPU). If you're testing a commercially available application or game as delivered to consumers, this issue does not invalidate the benchmark, it just makes the software vendor a bit of an Intel stooge.
- sudosysgen 6y agoWell, it depends. If you are a big enough outlet or a hyperscaler, you should care about raw-performance because if a sufficient amount of people make the same choice as you, the software vendor will adapt and you will end up with the competitive advantage.
- tagrun 6y agoOf course it doesn't matter for home consumers because real target audience for MKL isn't desktop user applications or games. Try using VASP or COMSOL or Mathematica on an AMD CPU. Both MKL and CUDA are major "issues" in HPC that limit decisions in purchasing clusters.
- gnufx 6y agoI don't know about VASP because it's proprietary, but I have compared other DFT code on 64-core Bulldozer with 12-core Sandybridge nodes. I don't remember the numbers, but the high core count was rather effective in reducing the communication costs with all free software. https://www.archer2.ac.uk/ https://www.archer2.ac.uk/ will run a lot of that sort of thing. I think at least cp2k and CASTEP are included in the benchmarks, but they're listed somewhere.
- gnopgnip 6y agoEven if the compilers are biased, isn't it reflective of what users would experience because most software is made with biased compilers?
- throwaway5792 6y agoNot really. No one outside of specialized applications like HPC will use Intel's compiler for their software. The general public seeing SPEC benchmark figures between gcc AMD and icc Intel may be surprised when they that Intel CPU doesn't perform as well as expected vs AMD when running generic code.
- FartyMcFarter 6y ago5-10 years ago the Intel C compiler produced significantly faster code than gcc (and clang was even worse back then), so there was a bigger reason to use it back then.
- mey 6y agoI'd be curious to know what compiler Unity and Unreal Engine are using.
- Alupis 6y agoI've never used Unity, but Unreal Engine is heavily tied into the Visual Studio (proper, not Code) workflow, including the Microsoft C++ Compiler toolchain and all 30GB+ of it's friends. I'd suspect the same from Unity.
- FartyMcFarter 6y agoBoth engines support platforms where Visual Studio is not available, right?
- deleted 6y ago[deleted]
- ncmncm 6y agoMoney quote: "... on an AMD computer then you may set the environment variable MKL_DEBUG_CPU_TYPE=5." When run on an AMD, any program built with Intel's compiler should have the environment variable set. I don't think there is any downside to leaving it on all the time, unless you are measuring how badly Intel has tried to cripple your AMD performance.
- clankyclanker 6y agoHow on is the end user supposed to know to do that, know when to do that, or know what to do when the next update to Intel’s compiler that puts cpu-type-5 on the pessimal code path? Is there something I can add to my bashrc to handle that?
- necovek 6y agoIf the environment variable still works, it could be set by a distribution (esp scientific ones) or in your .bashrc: eg. `export VAR=5`. If that fails, as OP implies, you can still override the function by creating a tiny library with it always returning true. On GNU/Linux systems, you do that using LD_PRELOAD. Perhaps someone's already done that so you just need to download, compile and set it. Sorry for the lack of specifics, but I do not deal with these libraries, yet I was still hoping to point you in the right direction.
- roseway4 6y agoNot any program built using ICC, rather, any program using Intel’s MKL, a set of basic linear algebra libraries (BLAS). This is typically limited to scientific computing applications and libraries.
- sudosysgen 6y agoA lot of software depends on a BLAS as a dependency somewhere.
- simtel20 6y ago
- coronadisaster 6y agoAll companies are evil if you let them...
- phendrenad2 6y agoBusiness is war, they say.
- rbecker 6y agoExcept when discussing free trade.
- physicsguy 6y agoI work on CFD software. We're well aware of this in my work, but the reality is that all our big corporate clients use Intel hardware. We already tell people to set those environment variables in our documentation. > Avoid the Intel compiler. There are other compilers with similar or better performance. This is not really true IMO, but even as an aside, the Intel compiler has the enormous advantage of being available cross platform. So we can use it on Linux and Windows, and provides MPI cross platform. We upgrade fairly regularly and that provides us with less work. My own tests found that PGI compiler performance was worse than Intel for C++, and that now appears to have been discontinued on Windows anyway with NVidia's new HPC compiler suite replacing it. GNU can run everywhere, but performance is around 2.5x worse on Linux for our application use case because it doesn't perform many of the optimisations that Intel does. We use MSVC on Windows just because everyone can have a license, and performance is much worse. The other thing is that MKL is pretty stable and gets updated. If I use an open source BLAS/LAPACK implementation - sure, it works, and it may even give better performance! But it's not guaranteed to get updates beyond a couple of years, and plenty of implementations are also only partial. We pay Intel a lot of money for the lack of hassle, basically.
- jstanley 6y ago> the Intel compiler has the enormous advantage of being available cross platform How does this advantage not apply to gcc? Isn't gcc the most cross-platform compiler ever?
- gpapilion 6y agoI think it’s a matter of features and performance. The poster says he can use gcc but the performance is 2.5x slower.
- Hello71 6y agothat's an incredible margin, and sounds suspiciously like they didn't enable optimizations on gcc, or set icc to optimize for a specific processor and gcc to generic, or something like that.
- gnufx 6y agoThe mythology surrounding the Intel tools and libraries really ought to die. It's bizarre seeing people deciding they must use MKL rather than the linear algebra libraries on which AMD has been working hard to optimize for their hardware (and possibly other hardware incidentally). Similarly for compiler code generation. Free BLASs are pretty much on a par with MKL, at least for large dimension level 3 in BLIS's case, even on Haswell. For small matrices MKL only became fast after libxsmm showed the way. (I don't know about libxsmm on current AMD hardware, but it's free software you can work on if necessary, like AMD have done with BLIS.) OpenBLAS and BLIS are infinitely better performing than MKL in general because they can run on all CPU architectures (and BLIS's plain C gets about 75% of the hand-written DGEMM kernel's performance). The differences between the implementations are comparable with the noise in typical HPC jobs, even if performance was entirely dominated by, say, DGEMM (and getting close to peak floating point intensity is atypical). On the other hand, you can see a factor of several difference in MPI performance in some cases.