szha commented on issue #19458:
URL: 
https://github.com/apache/incubator-mxnet/issues/19458#issuecomment-721199400


   > I've checked the implementation, the way to solve the problem is to create 
a large workspace, pre-compute the size of the workspace required by reduce and 
then slice the large workspace:
   > 
   > Example code in LayerNorm:
   > 
   > 
https://github.com/apache/incubator-mxnet/blob/33d94f1d59335f504ed5b9a7b32f0e81a5d5da56/src/operator/nn/layer_norm-inl.h#L247-L271
   
   Attention needs to be paid to memory alignment when dtypes for different 
chunks are different. It didn't matter in this example.


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to