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/11 23:30:57 UTC

[GitHub] [incubator-mxnet] JeanKossaifi opened a new issue #18695: Transpose only supports up to 6 dimensions

JeanKossaifi opened a new issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695


   ## Description
   Transpose does not currently support tensors with more than 6 dimensions.
   
   ### Error Message
   ```
   E           mxnet.base.MXNetError: Traceback (most recent call last):
   E             File "src/operator/tensor/./matrix_op-inl.h", line 459
   E           MXNetError: Check failed: shp.ndim() <= 6 (7 vs. 6) : Transpose support at most 6 dimensions
   ```
   
   ## To Reproduce
   Apply transpose to a higher-order tensor.
   
   ## Environment
   Python 3.7.3
   MXNet 2.0.0
   


----------------------------------------------------------------
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 #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
szha commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657255680


   Two changes will help immediately:
   - Collapse consecutive axes of the input array into a single axis here https://github.com/apache/incubator-mxnet/blob/master/src/operator/numpy/np_matrix_op-inl.h#L142-L149
   - Extend the implementation to support more https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/matrix_op-inl.h#L362-L419
   
   The root cause is really the limitation of template based programming in mshadow. Because of that choice, the axis is in template variable and thus needs to be expanded at compile time. We should move away from this approach and have a transpose implementation without mshadow instead.
   
   Let's focus on only the immediate changes, and I will open a separate issue for the larger change.


----------------------------------------------------------------
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] wkcn edited a comment on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
wkcn edited a comment on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657934929


   Hi @szha , I create a [`TransposeKernel`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L324) and need to copy the argument (namely `axes`) into the target context. Is there any good way to copy it?
   
   I try to call [`get_space_typed`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L429) to alloc a workspace, but it need to declare a temporary space in each operator which calls `TransposeImpl`.
   
   ## Solution
   I will create a new function `TransposeExImpl` to support up to 6 dimensions, which needs to alloc extra workspace.


----------------------------------------------------------------
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] wkcn edited a comment on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
wkcn edited a comment on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657934929


   Hi @szha , I create a [`TransposeKernel`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L324) and need to copy the argument (namely `axes`) into the target context. Is there any good way to copy it?
   
   I try to call [`get_space_typed`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L429) to alloc a workspace, but it need to declare a temporary space in each operator which calls `TransposeImpl`.
   
   ## Solution
   I will create a new function `TransposeExImpl` to support up to 6 dimensions, which needs to alloc extra workspace. The original `TransposeImpl` will not be modified.


----------------------------------------------------------------
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] wkcn edited a comment on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
wkcn edited a comment on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657934929


   Hi @szha , I create a [`TransposeKernel`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L324) and need to copy the argument (namely `axes`) into the target context. Is there any good way to copy it?
   
   I try to call [`get_space_typed`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L429) to alloc a workspace, but it need to declare a temporary space in each operator which calls `TransposeImpl`.


----------------------------------------------------------------
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 #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
szha commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-907721986


   It would be
   ```
   pip install mxnet<3 --pre -f https://dist.mxnet.io/python
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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 #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
szha commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-905603367


   @JeanKossaifi you can use the nightly version for development and testing purpose from https://dist.mxnet.io/python


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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] JeanKossaifi commented on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
JeanKossaifi commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-904141001


   I still get the issue with `mxnet-1.8.0.post`: 
   
   ```python
   import mxnet.numpy as mnp
   
   a = mnp.arange(2**7).reshape((2,)*7)
   a = mnp.transpose(a)
   ```
   
   raises the following issue:
   ```python
   MXNetError: Traceback (most recent call last):
     File "../src/operator/numpy/np_matrix_op.cc", line 53
   MXNetError: Check failed: shp.ndim() <= 6 (7 vs. 6) : Transpose support at most 6 dimensions
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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 closed issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
szha closed issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695


   


----------------------------------------------------------------
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] wkcn commented on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
wkcn commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657825425


   Hi @szha , I am trying to fix it and select 'Collapse consecutive axes of the input array into a single axis here when axes.ndim() > 2'.


----------------------------------------------------------------
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] JeanKossaifi commented on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
JeanKossaifi commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-904580889


   Thanks @szha -- what's the recommended way to install mxnet 2.0? 
   I'm looking mostly for a pypi version for the CI. I tried `pip install mxnet==2.0.0a0` but I get an error: 
   ```
   ERROR: Could not find a version that satisfies the requirement mxnet==2.0.0a0 (from versions: 1.6.0, 1.7.0.post1, 1.7.0.post2, 1.8.0.post0)
   ERROR: No matching distribution found for mxnet==2.0.0a0
   ```
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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] wkcn edited a comment on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
wkcn edited a comment on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657825425


   Hi @szha , I am trying to fix it and select 'Collapse consecutive axes of the input array into a single axis here when axes.ndim() > 2'.
   
   https://github.com/wkcn/incubator-mxnet/tree/support_transpose_dim_gt_6


----------------------------------------------------------------
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 #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
szha commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-904226490


   @JeanKossaifi I think the change was not included in the 1.x but only in 2.0. The np support in 1.x is experimental, and if you plan on integrating with the np interface, it's probably a good idea to do so with 2.0 which includes all the latest fixes.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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 #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
szha commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657254886


   Thanks for reporting, Jean. I confirm that this affects numpy operators too.


----------------------------------------------------------------
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] wkcn commented on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
wkcn commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657934929


   Hi @szha , I create a [`TransposeKernel`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L324) and need to copy the argument (namely `axes`) into the target context. Is there any good way to copy it?
   
   I try to call [`get_space_typed`](https://github.com/wkcn/incubator-mxnet/blob/support_transpose_dim_gt_6/src/operator/tensor/matrix_op-inl.h#L429), but it need to declare a temporary space in each operator which calls `TransposeImpl`.


----------------------------------------------------------------
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] JeanKossaifi commented on issue #18695: Transpose only supports up to 6 dimensions

Posted by GitBox <gi...@apache.org>.
JeanKossaifi commented on issue #18695:
URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-907488399


   Thanks! Which version should we use for CI (CPU only)? Is there a way to directly pip install (the latest) version from there? 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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