【问题标题】:Why does DL4j 1.0.0-Beta6 not use MKL any more?为什么 DL4j 1.0.0-Beta6 不再使用 MKL?
【发布时间】:2020-01-23 01:28:15
【问题描述】:

对我来说,DL4j 1.0.0-Beta6 不再使用英特尔 MKL:

WARN 28823 --- [:54:17 UTC 2020] org.nd4j.linalg.factory.Nd4jBackend      : Skipped [JCublasBackend] backend (unavailable): java.lang.UnsatisfiedLinkError: /home/app/.javacpp/cache/cuda-10.0-7.4-1.5-linux-x86_64.jar/org/bytedeco/cuda/linux-x86_64/libjnicudart.so: libcuda.so.1: cannot open shared object file: No such file or directory
INFO 28823 --- [:54:17 UTC 2020] org.nd4j.linalg.factory.Nd4jBackend      : Loaded [CpuBackend] backend
INFO 28823 --- [:54:17 UTC 2020] org.nd4j.nativeblas.NativeOpsHolder      : Number of threads used for linear algebra: 1
WARN 28823 --- [:54:17 UTC 2020] o.n.l.cpu.nativecpu.CpuNDArrayFactory    : *********************************** CPU Feature Check Warning ***********************************
WARN 28823 --- [:54:17 UTC 2020] o.n.l.cpu.nativecpu.CpuNDArrayFactory    : Warning: Initializing ND4J with Generic x86 binary on a CPU with AVX/AVX2 support
WARN 28823 --- [:54:17 UTC 2020] o.n.l.cpu.nativecpu.CpuNDArrayFactory    : Using ND4J with AVX/AVX2 will improve performance. See deeplearning4j.org/cpu for more details
WARN 28823 --- [:54:17 UTC 2020] o.n.l.cpu.nativecpu.CpuNDArrayFactory    : Or set environment variable ND4J_IGNORE_AVX=true to suppress this warning
WARN 28823 --- [:54:17 UTC 2020] o.n.l.cpu.nativecpu.CpuNDArrayFactory    : *************************************************************************************************
INFO 28823 --- [:54:17 UTC 2020] org.nd4j.nativeblas.Nd4jBlas             : Number of threads used for OpenMP BLAS: 1
INFO 28823 --- [:54:17 UTC 2020] o.n.l.a.o.e.DefaultOpExecutioner         : Backend used: [CPU]; OS: [Linux]
INFO 28823 --- [:54:17 UTC 2020] o.n.l.a.o.e.DefaultOpExecutioner         : Cores: [2]; Memory: [0.4GB];
INFO 28823 --- [:54:17 UTC 2020] o.n.l.a.o.e.DefaultOpExecutioner         : Blas vendor: [OPENBLAS]

我尝试添加常规 nd4j-native 和 nd4j-native:avx 分类器的各种组合。我可以在我的 mvn-dependency-tree 中看到 mkl 和 mkl-dnn,但在启动时它总是报告正在使用 Openblas。

为什么 Beta6 不再使用 MKL?

【问题讨论】:

  • 默认情况下不使用它,因为它很大,但在大多数情况下不再提供可衡量的性能改进,但仍然可以使用它。确保设置了此处描述的系统属性:github.com/bytedeco/javacpp-presets/tree/master/…
  • 感谢@SamuelAudet,有很多有用的信息。

标签: deeplearning4j dl4j


【解决方案1】:

仍然如此。只需确保您使用的是 avx2 或 avx512 二进制文件(具体取决于您的实际 CPU)

附言对于实际层,比如conv2d,会使用MKL-DNN,内部会使用高性能的MKL gemm。

【讨论】:

  • 我删除了我之前的评论,我说 MKL 需要 AVX2。没有 AVX2 也能正常工作。我一定是搞错了。
猜你喜欢
  • 1970-01-01
  • 2017-08-25
  • 1970-01-01
  • 2019-04-02
  • 2015-12-18
  • 1970-01-01
  • 1970-01-01
  • 2019-05-27
  • 1970-01-01
相关资源
最近更新 更多