# Hack: AMD Ryzen/TR/Epyc + Intel Math Kernel Library (MKL)

**URL:** <https://discourse.julialang.org/t/hack-amd-ryzen-tr-epyc-intel-math-kernel-library-mkl/31226>\
**Category:** Performance\
**Created:** [November 18, 2019, 2:50pm UTC](https://discourse.julialang.org/t/hack-amd-ryzen-tr-epyc-intel-math-kernel-library-mkl/31226 "2019-11-18T14:50:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [November 18, 2019, 2:50pm UTC](https://discourse.julialang.org/t/hack-amd-ryzen-tr-epyc-intel-math-kernel-library-mkl/31226/1 "2019-11-18T14:50:37Z")

</div>

Interesting performance hack for Ryzen/TR CPU + MKL → _“up to 250% performance gains”_  
(based on reddit post )

in theory it should work with **Julia+MKL** ;

Anybody can test / validate ?

* * *

_“The method provided here does enforce AVX2 support by the MKL, independent of the vendor string result.”_

Linux :

- `export MKL_DEBUG_CPU_TYPE=5`

Windows:

```julia
@echo off
set MKL_DEBUG_CPU_TYPE=5
call "%MKLROOT%\bin\mklvars.bat" MKL_DEBUG_CPU_TYPE=5
julia 

```

see the details:  
[https://www.reddit.com/r/matlab/comments/dxn38s/howto\_force\_matlab\_to\_use\_a\_fast\_codepath\_on\_amd/](https://www.reddit.com/r/matlab/comments/dxn38s/howto_force_matlab_to_use_a_fast_codepath_on_amd/)
