You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/04/21 15:31:59 UTC
[GitHub] [incubator-mxnet] szha opened a new issue #20196: Decouple oneDNN data structures in MXNet C API
szha opened a new issue #20196:
URL: https://github.com/apache/incubator-mxnet/issues/20196
## Description
Currently, onednn/mkldnn header is required in ndarray.h header, and thus requires the onednn/mkldnn headers when linking with libmxnet if mkldnn is turned on (see [here](https://github.com/apache/incubator-mxnet/blob/master/include/mxnet/ndarray.h#L41). To mitigate this, we should look for ways to decouple onednn/mkldnn headers from ndarray.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org
[GitHub] [incubator-mxnet] mozga-intel commented on issue #20196: Decouple oneDNN data structures in MXNet C++ API
Posted by GitBox <gi...@apache.org>.
mozga-intel commented on issue #20196:
URL: https://github.com/apache/incubator-mxnet/issues/20196#issuecomment-860544111
Thanks, @szha, @leezu for this issue.
Currently, there are a lot of places, where it is needed. I got a few ideas to discuss. Since we can't define a variable/objects in a header file as an explicitly defined object `const mkldnn::memory::desc &md` and if this type is used by multiple functions: (i.e `Reorder2DefaultAsync` ), then the object might be passed by using a void pointer `const void *md`. In the same way, each time you call oneDNN function, the `static_cast` is needed to create a particular object.
```
const mkldnn::memory *mem = static_cast<const mkldnn::memory *>(GetMKLDNNData());
```
Therefore, a header might be placed in *cc file.
Please have a look: #20349
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org
[GitHub] [incubator-mxnet] mozga-intel edited a comment on issue #20196: Decouple oneDNN data structures in MXNet C++ API
Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on issue #20196:
URL: https://github.com/apache/incubator-mxnet/issues/20196#issuecomment-860544111
Thanks, @szha, @leezu for this issue.
Currently, there are a lot of places, where it is needed. I got an idea to discuss. Since we can't define a variable/objects in a header file as an explicitly defined object `const mkldnn::memory::desc &md` and if this type is used by multiple functions: (i.e `Reorder2DefaultAsync` ), then the object might be passed by using a void pointer `const void *md`. In the same way, each time you call oneDNN function, the `static_cast` is needed to create a particular object.
```
const mkldnn::memory *mem = static_cast<const mkldnn::memory *>(GetMKLDNNData());
```
Therefore, a header might be placed in *cc file.
Please have a look: #20349
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org
[GitHub] [incubator-mxnet] leezu commented on issue #20196: Decouple oneDNN data structures in MXNet C++ API
Posted by GitBox <gi...@apache.org>.
leezu commented on issue #20196:
URL: https://github.com/apache/incubator-mxnet/issues/20196#issuecomment-824184703
ndarray.h is a C++ header that's currently only exposed because the C API is not convenient enough for https://github.com/horovod/horovod/ Nevertheless, removing onednn/mkldnn headers from ndarray.h could still be useful for consumers of the C++ header.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org
[GitHub] [incubator-mxnet] mozga-intel edited a comment on issue #20196: Decouple oneDNN data structures in MXNet C++ API
Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on issue #20196:
URL: https://github.com/apache/incubator-mxnet/issues/20196#issuecomment-860544111
Thanks, @szha, @leezu for this issue.
Currently, there are a lot of places, where it is needed. I got an idea to discuss. Since we can't define a variable/objects in a header file as an explicitly defined object `const mkldnn::memory::desc &md` and if this type is used by multiple functions: (i.e `Reorder2DefaultAsync` ), then the object might be passed by using a void pointer `const void *md`. In the same way, each time you call oneDNN function, the `static_cast` is needed to create a particular object.
```
const mkldnn::memory *mem = static_cast<const mkldnn::memory *>(GetMKLDNNData());
```
Therefore, a header might be placed in *cc file.
Please have a look at: #20349
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org