Skip to content

adding the functions used to build MlNetMklDeps for 0.0.0.6 #1182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/building/MlNetMklDeps/MlNetMklDeps.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
Copy link
Member

@eerhardt eerhardt Oct 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be a good idea to put a README in this directory as well? The README could have the instructions for how to build the package. Then it would all be out in the open, and we wouldn't have to go looking for the instructions. #Resolved

<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
<metadata>
<id>MlNetMklDeps</id>
<version>0.0.0.6</version>
<title>This NuGet package provides Intel(R) MKL dependencies for ML.NET</title>
<authors>Intel Corporation</authors>
<owners>Microsoft</owners>
<projectUrl>https://dot.net/ml</projectUrl>
<licenseUrl>https://software.intel.com/en-us/license/intel-simplified-software-license</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>
Intel(R) MKL Dependencies for Microsoft ML.NET.
</description>
<copyright>Copyright (c) 2018 Intel Corporation.</copyright>
<tags>ML.Net Mkl Deps</tags>
</metadata>
</package>
37 changes: 37 additions & 0 deletions docs/building/MlNetMklDeps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#Instructions to build a custom DLL from Intel's MKL SDK
ML.NET MKL implementation uses Intel MKL Custom DLL builder to produce a single DLL which contains all of the MKL functions used by it.
To update the DLL, follow the steps below:

Windows (32 and 64 bit):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't call this windows specific if you remove last point from the list.
Just install and start elevated command line is a good prerequisites rather than windows specific thing.

- Ensure you have Intel's MKL SDK installed, you can find it here: https://software.intel.com/en-us/mkl.
- Open an admin command prompt and run the following commands, CAREFULLY INSPECTING THE COMMAND OUTPUT FOR ERRORS.
- TLCROOT should be the root of your TLC_Resources folder.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is TLC?


##Windows
1. Modify user_example_list file in directory to contain all required functions, that are present in the [mlnetmkl.list](mlnetmkl.list) file
2. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
3. nmake libia32 name=MklImports (add threading=sequential if you are building without openmp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MklImports [](start = 22, length = 10)

Should be Microsoft.ML.MklImports

4. copy /Y Microsoft.ML.MklImports.* to the folder that will host the x86 binaries.
5. del Microsoft.ML.MklImports.*
6. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
7. nmake intel64 name=MklImports (add threading=sequential if you are building without openmp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be Microsoft.ML.MklImports

8. copy /Y Microsoft.ML.MklImports.* to the folder that will host the x64 binaries.

##Linux
1. untar the linux sdk (tar -zxvf name_of_downloaded_file)
2. Run installation script and follow the instuctions in the dialog screens that are presented ./install.sh
3. Go to /opt/mkl/tools/builder.
4. Modify makefile add -Wl,-rpath,'$$ORIGIN' \ -Wl,-z,origin \ after -Wl,--end-group \
5. Modify user_example_list file in directory to contain all the required functions, that are present in the [mlnetmkl.list](mlnetmkl.list) file
6. Run make intel64 name=libMklImports (add threading=sequential if you are building without openmp)
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it weird what we have x86 version for windows only :) #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is actually weird that we have instructions for x86 :)

Thanks for taking a look @Ivanidzo4ka. I'll address those on the next PR that adds details about 0.0.0.7


In reply to: 223563064 [](ancestors = 223563064)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7. Copy libMklImports.so the folder containing the Linux binaries.

##OSX
1. extract and install the dmg (double-click and drag it in the Applications folder)
2. Go to /opt/mkl/tools/builder.
3. Modify user_example_list file in directory to contain all the required functions, that are present in the [mlnetmkl.list](mlnetmkl.list) file
4. Run make intel64 name=libMklImports (add threading=sequential if you are building without openmp)
5. Copy libMklImports.dylib from the builder directory to the folder containign the OSX binaries.
6. Fix the id and the rpath running the following commands:
sudo install_name_tool -id "@loader_path/libMklImports.dylib" libMklImports.dylib
sudo install_name_tool -id "@rpath/libMklImports.dylib" libMklImports.dylib
83 changes: 83 additions & 0 deletions docs/building/MlNetMklDeps/mlnetmkl.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
; MKL custom dll built for ML.NET
; Note that function names are case-sensitive, for example, you must specify LAPACKE_sgesvd rather than lapacke_sgesvd.

;---- CBLAS ----
cblas_sdot
cblas_sdoti

cblas_sasum
cblas_snrm2
cblas_scopy
cblas_isamin
cblas_isamax

cblas_ssymv
cblas_saxpy
cblas_saxpyi
cblas_daxpy
cblas_sscal
cblas_dscal

cblas_sger
cblas_dger
cblas_sgemv
cblas_dgemv

cblas_sgemm
cblas_dgemm

mkl_sdnscsr
mkl_scsrmv
mkl_dcsrmv
mkl_scsrmm
mkl_dcsrmm
mkl_scscmm
mkl_scsrcsc
mkl_cspblas_scsrgemv

MKL_Simatcopy
MKL_Dimatcopy
MKL_Somatcopy
MKL_Domatcopy

LAPACKE_sgesvd
LAPACKE_dgesvd

LAPACKE_dpptrf
LAPACKE_dpptri
LAPACKE_dpptrs

;---- VML -----
vsAbs
vdAbs
vsAdd
vdAdd
vsTanh
vdTanh
vsExp
vdExp
vsMul
vdMul
vsSqr
vdSqr
vsSqrt
vdSqrt

;---- RNG ----
vslNewStream
vslDeleteStream
vdRngUniform
vsRngUniform

;---- FOURIER ----
DftiCreateDescriptor
DftiSetValue
DftiGetValue
DftiCommitDescriptor

DftiComputeForward
DftiComputeBackward

DftiFreeDescriptor
DftiErrorClass
DftiErrorMessage
10 changes: 10 additions & 0 deletions docs/building/MlNetMklDeps/version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Intel MKl SDK versions used to build the MlNetMklDeps v0.0.0.4-0.0.0.6

##Sdk Version
linux and windows: mkl 2018 update 3
mac: mkl 2018 update 1

##Exact versions, including minors
mac: 2018.1.126
linux: 2018.3.222
windows: 2018.3.210