You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/07/12 18:47:08 UTC
[GitHub] [incubator-mxnet] szha opened a new issue #18697: AMP for mx2
szha opened a new issue #18697:
URL: https://github.com/apache/incubator-mxnet/issues/18697
## Description
We will need to AMP support in order to achieve the best performance with fp16 on NVIDIA GPU. In terms of approach, AMP should rely on custom graph pass functionality in 2.0 and not be monkey patching the frontend for swapping the operators
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] ptrendx commented on issue #18697: AMP for mx2
Posted by GitBox <gi...@apache.org>.
ptrendx commented on issue #18697:
URL: https://github.com/apache/incubator-mxnet/issues/18697#issuecomment-657703538
Hi @szha, could you clarify how this approach (graph pass) would work for the non-hybridized execution? I don't think it would be applied then, which would produce a difference in the behavior. That would negatively impact debuggability of models for example, which is pretty bad.
That said, one of the prerequisites for the graph pass is to remove AMP lists and instead put their content as op's attributes and I believe this should be doable and beneficial.
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] szha commented on issue #18697: AMP for mx2
Posted by GitBox <gi...@apache.org>.
szha commented on issue #18697:
URL: https://github.com/apache/incubator-mxnet/issues/18697#issuecomment-735016283
@mk-61 mostly cleaner abstraction and feature interaction. Multiple features that rely on monkey patch can't work together.
----------------------------------------------------------------
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] szha commented on issue #18697: AMP for mx2
Posted by GitBox <gi...@apache.org>.
szha commented on issue #18697:
URL: https://github.com/apache/incubator-mxnet/issues/18697#issuecomment-657767388
@ptrendx the reasoning is that we shouldn't need to optimize pure imperative program, because that is designed for model debugging and development, and not for performance.
That said, I recognize that there are still cases where we can't hybridize fully yet and still need performance. One short-term approach could be to utilize the [`mx.set_np_default_dtype`](https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/util.py#L1108-L1146) interface. The problem it solves is to switch between fp32 and fp64 as default output data type, as the former is commonly used in deep learning and the later is used in numpy. It should be straightforward to add more data types to it.
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] mk-61 commented on issue #18697: AMP for mx2
Posted by GitBox <gi...@apache.org>.
mk-61 commented on issue #18697:
URL: https://github.com/apache/incubator-mxnet/issues/18697#issuecomment-724958074
Hi @szha, why do you want to implement AMP with a graph pass? Which aspects of the current approach do you expect to improve by switching to a graph pass?
One drawback of the Python-side monkey patching I see is that it is sensitive to how various ops are registered on the client side - NumPy vs legacy, imperative vs hybridized, etc. - ideally, we want to handle this in a uniform way, since we don't really care about these distinctions, as far as AMP itself is concerned.
But I am curious if you have some other deficiencies of the current approach in mind.
----------------------------------------------------------------
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] ptrendx commented on issue #18697: AMP for mx2
Posted by GitBox <gi...@apache.org>.
ptrendx commented on issue #18697:
URL: https://github.com/apache/incubator-mxnet/issues/18697#issuecomment-657777556
It is not just about performance though - AMP changes numerics of the model, so I don't believe it would be great user experience if they got the model to where they liked it, hybridized it and suddenly got different answer.
One way of solving this I guess could be similar to what happens with the storage type (but just on the input side), where the input would be cast before the operator.
----------------------------------------------------------------
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