mkldnn activations.relu#86
mkldnn activations.relu#86pranavsharma merged 5 commits intomicrosoft:masterfrom sreekanth-yalachigere:master
Conversation
| @@ -0,0 +1,238 @@ | |||
| /* Copyright(C) 2018 Intel Corporation | |||
There was a problem hiding this comment.
Is there a legal reason to use this license? This has to be under MIT license, not Apache.
There was a problem hiding this comment.
I believe this should be ok. Will double check.
| ReluPrimitive<T>* relulPrimitive = ReluPrimitivePool<T>::Get(pool_params); | ||
|
|
||
| relulPrimitive->Compute(src_data, dst_data); | ||
| } catch (mkldnn::error& e) { |
| @@ -0,0 +1,32 @@ | |||
| /* Copyright(C) 2018 Intel Corporation | |||
There was a problem hiding this comment.
same comment as above for the license
There was a problem hiding this comment.
I believe this should be ok. Will double check.
| mkldnn::engine& cpu_engine_; | ||
| }; | ||
|
|
||
| // Pool which allows for reuse of MKLDNN Conv2d primitives which are expensive |
There was a problem hiding this comment.
It should be not Conv2d.
There was a problem hiding this comment.
Changing Conv2d to Relu
pranavsharma
left a comment
There was a problem hiding this comment.
Blocking this for license related changes.
pranavsharma
left a comment
There was a problem hiding this comment.
Unblocking for now. Will double check.
Unblocking for now. Will double check.
| // Used as the key for Pool Primitive Reuse Pool. | ||
| std::string ToString() const { | ||
| std::string key; | ||
| key.reserve(128); |
There was a problem hiding this comment.
probably don't need 128 bytes for just a src and dst dims.
There was a problem hiding this comment.
will change this to 64 bytes
| return; | ||
| } | ||
|
|
||
| mkldnn::memory::format GetSrcMemoryFormat() const { return context_.src_fmt; } |
There was a problem hiding this comment.
GetSrcMemoryFormat and GetDstMemoryFormat are not used?
can get rid of the members (src_fmt, dst_fmt) in context as well then.
There was a problem hiding this comment.
Removed
|
|
||
| private: | ||
| struct ReluContext { | ||
| mkldnn::memory::format src_fmt; |
There was a problem hiding this comment.
per comment above. remove src_fmt, and dst_fmt if no need for them.
There was a problem hiding this comment.
removed
|
@pranavsharma committed the following. added const at catch
|
|
I still don't see MIT license mentioned like other files. You should mention |
|
@pranavsharma added second line in header
|
|
We did some build pipeline changes recently. Can you please rebase your changes? Thanks. |
|
@pranavsharma rebase done. |
|
|
||
| // Pool which allows for reuse of MKLDNN Relu primitives which are expensive | ||
| // to instantiate. To address thread safety, the primitives are stored in a map | ||
| // on thread local storage. |
There was a problem hiding this comment.
Who is in the thread local storage?
There was a problem hiding this comment.
@snnn kernel objects like Relu lives in thread local storage. This is very similar to @weixingzhang's implementation of Conv and Pool kernels.
* provider_options * use migraphx_provider_option contants * use migraphx_* constants for printing flags * add kDeviceId
* provider_options * use migraphx_provider_option contants * use migraphx_* constants for printing flags * add kDeviceId
Activator Relu is implemented using MKLDNN.
Modified CPU Relu class definition to enable MKLDNN Relu class to inherit for fallback option
class Relu final : public OpKernel {to
class Relu : public OpKernel {