matlab mkl codepath tweak øger amd ryzen mkl ydeevne markant

MATLAB MKL Codepath Tweak øger AMD Ryzen MKL-ydeevne markant

MATLAB is a popular math computing environment in use by engineering firms, universities, and other research institutes. Some of its operations can be made to leverage Intel MKL (Math Kernel Library), which is poorly optimized for, and notoriously slow on AMD Ryzen processors. Reddit user Nedflanders1976 devised a way to restore anywhere between 20 to 300 percent performance on Ryzen and Ryzen Threadripper processors, by forcing MATLAB to use advanced instruction-sets such as AVX2. By default, MKL queries your processor's vendor ID string, and if it sees anything other than 'GenuineIntel…, ' it falls back to SSE, posing a significant performance disadvantage to 'AuthenticAMD' Ryzen processors that have a full IA SSE4, AVX, and AVX2 implementation.

Tweak, der skal bruges manuelt af AMD Ryzen-brugere, tvinger MKL til at bruge AVX2 uanset CPU-forhandler-ID-forespørgselsresultatet. Tweak er så enkel som den er kraftfuld. En simpel 4-linjes Windows batch-fil med et sæt argumenter starter MKL i AVX2-tilstand. Du kan også gøre finjusteringen 'permanent' ved at oprette en systemmiljøvariabel. Miljøvariablen gælder for alle forekomster af MATLAB og ikke kun dem, der er givet af batchfilen. Nedflanders1976 sendte også et benchmark-script, der fremhæver ydelseseffekten af ​​AVX2, men du kan bruge dine egne scripts og sende resultater.
Source: Nedflanders1976 (Reddit)