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

Julia: add binding for runtime feature detection #13992

Merged
merged 5 commits into from
Mar 12, 2019

Conversation

iblislin
Copy link
Member

@iblislin iblislin commented Jan 25, 2019

Ref: #13549

julia> mx.features_enabled()
8-element Array{MXNet.mx.MXFeatures.Feature,1}:
 CPU_SSE::Feature = 5   
 CPU_SSE2::Feature = 6  
 CPU_SSE3::Feature = 7  
 CPU_SSE4_1::Feature = 8
 CPU_SSE4_2::Feature = 9
 CPU_AVX::Feature = 11  
 F16C::Feature = 15     
 LAPACK::Feature = 21

julia> mx.features_enabled(Symbol)
8-element Array{Symbol,1}:
 :CPU_SSE
 :CPU_SSE2
 :CPU_SSE3
 :CPU_SSE4_1
 :CPU_SSE4_2
 :CPU_AVX
 :F16C
 :LAPACK

julia> mx.features_enabled(String)
"CPU_SSE, CPU_SSE2, CPU_SSE3, CPU_SSE4_1, CPU_SSE4_2, CPU_AVX, F16C, LAPACK"

@iblislin iblislin added the Julia label Jan 25, 2019
@larroy
Copy link
Contributor

larroy commented Jan 25, 2019

Let's merge this first, #13964 the enum is now internalized.

szha
szha previously requested changes Jan 25, 2019
Copy link
Member

@szha szha left a comment

Choose a reason for hiding this comment

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

The API that this PR depends on needs update which is being addressed in #13964

@vandanavk
Copy link
Contributor

@mxnet-label-bot add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Feb 5, 2019
@larroy
Copy link
Contributor

larroy commented Feb 11, 2019

#13964

@szha szha dismissed their stale review February 12, 2019 01:57

API patch is merged.

@iblislin
Copy link
Member Author

so... features_enabled has gone?

@iblislin iblislin changed the title Julia: add binding for runtime feature detection WIP: Julia: add binding for runtime feature detection Feb 12, 2019
@iblislin iblislin removed the pr-awaiting-review PR is waiting for code review label Feb 12, 2019
@iblislin
Copy link
Member Author

iblislin commented Feb 12, 2019

New API:

julia> mx.libinfo_features()
30-element Array{MXNet.mx.MXRuntime.LibFeature,1}:
 ✖  CUDA
 ✖  CUDNN
 ✖  NCCL
 ✖  CUDA_RTC
 ✖  TENSORRT
 ✔  CPU_SSE
 ✔  CPU_SSE2
 ✔  CPU_SSE3
 ✔  CPU_SSE4_1
 ✔  CPU_SSE4_2
 ✖  CPU_SSE4A
 ✔  CPU_AVX
 ✖  CPU_AVX2
 ✖  OPENMP
 ✖  SSE
 ✔  F16C
 ✖  JEMALLOC
 ✖  BLAS_OPEN
 ✖  BLAS_ATLAS
 ✖  BLAS_MKL
 ✖  BLAS_APPLE
 ✔  LAPACK
 ✖  MKLDNN
 ✖  OPENCV
 ✖  CAFFE
 ✖  PROFILER
 ✖  DIST_KVSTORE
 ✖  CXX14
 ✖  SIGNAL_HANDLER
 ✖  DEBUG

@iblislin
Copy link
Member Author

And I want to add a comparison method like:

:CUDA in mx.libinfo_features()

to let user check a feature enabled or not.

@larroy
Copy link
Contributor

larroy commented Feb 12, 2019

What is ":CUDA" in Julia? is it an atom like in erlang?

@larroy
Copy link
Contributor

larroy commented Feb 12, 2019

Yes the new API just returns a list of struct with boolean field indicating enabled or not.

@iblislin
Copy link
Member Author

yeah, :CUDA is a Symbol in Julia, exactly the same as atom in Erlang.

@larroy
Copy link
Contributor

larroy commented Feb 12, 2019

LGTM % I don't know Julia.

@iblislin
Copy link
Member Author

Finally, I decide to make this:

julia> mx.isenabled(:CUDA)
false

julia> mx.isenabled(:CPU_SSE)
true

@iblislin iblislin changed the title WIP: Julia: add binding for runtime feature detection Julia: add binding for runtime feature detection Feb 12, 2019
@larroy
Copy link
Contributor

larroy commented Feb 22, 2019

I guess this can be resumed when you have some bandwidth.

@iblislin
Copy link
Member Author

okay, I updated it.

@iblislin iblislin closed this Feb 26, 2019
@iblislin iblislin reopened this Feb 26, 2019
@larroy
Copy link
Contributor

larroy commented Mar 2, 2019

Needs rebase

@iblislin
Copy link
Member Author

iblislin commented Mar 4, 2019

rebased

@iblislin
Copy link
Member Author

iblislin commented Mar 6, 2019

well, the ci status blocks the merge button.

@szha
Copy link
Member

szha commented Mar 6, 2019

could you try another rebase? CI had a hiccup a couple of days ago.

@iblislin
Copy link
Member Author

iblislin commented Mar 6, 2019

sure

@iblislin iblislin merged commit 73b29fa into master Mar 12, 2019
@iblislin iblislin deleted the ib/jl-runtime-features branch March 12, 2019 07:52
vdantu pushed a commit to vdantu/incubator-mxnet that referenced this pull request Mar 31, 2019
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants