Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Building with MKL fails on OSX #9828

Closed
sbodenstein opened this issue Feb 19, 2018 · 12 comments
Closed

Building with MKL fails on OSX #9828

sbodenstein opened this issue Feb 19, 2018 · 12 comments

Comments

@sbodenstein
Copy link
Contributor

Description

When building MXNet on OSX with the flag USE_MKLDNN=1 in the config.m file, I get a build failure.

Environment info (Required)

----------System Info----------
Platform     : Darwin-16.7.0-x86_64-i386-64bit
system       : Darwin
node         : sebastianbmaclap.local
release      : 16.7.0
version      : Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
----------Hardware Info----------
machine      : x86_64
processor    : i386
b'machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT RDTSCP TSCI'
b'machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 HLE AVX2 BMI2 INVPCID RTM FPU_CSDS'
b'machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C'
b'machdep.cpu.brand_string: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz'

Build info (Required if built from source)

clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

MXNet commit hash: f33591f37da73965e50446704d6b1a73331df2c0

Error Message:

In file included from src/operator/nn/mkldnn/mkldnn_pooling.cc:28:
In file included from /Users/sebastianb/Software/incubator-mxnet/src/operator/nn/mkldnn/./mkldnn_pooling-inl.h:30:
/Users/sebastianb/Software/incubator-mxnet/3rdparty/mkldnn//install/include/mkldnn.hpp:159:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
      std::__1::allocator<char> >'
    std::string message;
                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from src/operator/nn/mkldnn/mkldnn_pooling.cc:28:
In file included from /Users/sebastianb/Software/incubator-mxnet/src/operator/nn/mkldnn/./mkldnn_pooling-inl.h:30:
/Users/sebastianb/Software/incubator-mxnet/3rdparty/mkldnn//install/include/mkldnn.hpp:169:48: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
      std::__1::allocator<char> >'
    error(mkldnn_status_t astatus, std::string amessage,
@marcoabreu
Copy link
Contributor

@zheng-da

@pengzhao-intel
Copy link
Contributor

pengzhao-intel commented Feb 20, 2018

@TaoLv @ashokei, please take look this compatibility issue.

@marcoabreu I see there is NO OSX build and test in Jenkin.
It will be risk w/o building and testing.
Is it possible to set up an OSX environment for CI process?

@marcoabreu
Copy link
Contributor

marcoabreu commented Feb 20, 2018 via email

@marcoabreu
Copy link
Contributor

I just spoke to @KellenSunderland and he pointed out that our Clang-Job in CI should have caught this error. Problem there being that we have been using OpenBLAS https://github.com/apache/incubator-mxnet/blob/master/Jenkinsfile#L235 instead of MKLDNN. We could create another job that uses MKLDNN instead.

A OSX environment for CI would only be necessary if we would like to do runtime tests or run on Apple BLAS. Experience has shown that most Mac failures are caught by using Clang as compiler, thus reducing the urgency for actual Mac tests.

@Cosmo
Copy link

Cosmo commented Feb 20, 2018

@marcoabreu
Not sure, if I follow, but if it's the case, that you need a macOS + NVIDIA GPU, then you have one of those options to get the desired configuration:

  • A Mac with Thunderbolt 3 (MacBook Pro, iMac, iMac Pro) + eGPU (with NVIDIA GPU)
  • A Mac with Thunderbolt 2 (Mac mini, Mac Pro, MacBook Air) + eGPU (with NVIDIA GPU)
  • PC (Hackintosh) with NVIDIA GPU
  • Or of course, as you mentioned, an old Mac Pro (the cheese grater model, prior the trash can)

@marcoabreu
Copy link
Contributor

marcoabreu commented Feb 20, 2018 via email

@Cosmo
Copy link

Cosmo commented Feb 20, 2018

I would, if it worked together with Turi Create (https://github.com/apple/turicreate) :)

It would make so much sense, since you get perfect usable ML-Core files for Xcode with Turi Create - on the same machine with the same OS. Well, at least in theory.

For now, I have to boot to Ubuntu, create my model, save it somewhere, boot macOS, test in Xcode, boot Ubuntu to make some changes, save ... and boot macOS, ...

And Apple announced support for eGPUs with High Sierra at WWDC last year.
https://9to5mac.com/2018/01/25/egpu-macos-beta-10-13-4-video/

Please let me know, if I can help / test out something.

@pengzhao-intel
Copy link
Contributor

pengzhao-intel commented Feb 22, 2018

@marcoabreu regarding MKL-DNN, it's nice to create a new Clang-Job with MKL blas.

@pengzhao-intel
Copy link
Contributor

pengzhao-intel commented Feb 27, 2018

Update: This bug is fixed in MKL-DNN and the patch will be ready in the official branch soon.
@xinyu-intel

@xinyu-intel
Copy link
Contributor

@sbodenstein You can manually update mkldnn submodule to the newest one and then build again.

@TaoLv
Copy link
Member

TaoLv commented Feb 28, 2018

@sbodenstein Please update your mkldnn to the latest version to see if the compilation issue is addressed. If so, we will submit a seperated PR to update mkldnn version in mxnet. Thanks.

@pengzhao-intel
Copy link
Contributor

@marcoabreu could you help close this issue? The fix has been merged and Clang-MKLDNN tests are enabled.

@szha szha closed this as completed Mar 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants