MATLAB MKL Codepath Tweak izboljšuje zmogljivost AMD Ryzen MKL



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.

Poteg, ki naj bi ga ročno uporabili uporabniki AMD Ryzen, prisili MKL v uporabo AVX2 ne glede na rezultat poizvedbe prodajalca CPU. Poteg je tako preprost kot močan. Preprosta 4-vrstna paketna datoteka Windows z nizom argumentov zažene MKL v načinu AVX2. Preoblikovanje lahko naredite tudi 'trajno', tako da ustvarite spremenljivko sistemskega okolja. Spremenljivka okolja bo veljala za vse primere MATLAB in ne le za tiste, ki jih sproži batch datoteka. Nedflanders1976 je objavil tudi referenčni scenarij, ki poudarja vpliv AVX2 na delovanje, vendar lahko uporabite svoje skripte in objavite rezultate.
Source: Nedflanders1976 (Reddit)