Skip to content

Remove transpose from reshape builder#22901

Closed
shraiysh wants to merge 3 commits intoopenxla:mainfrom
shraiysh:fix_reshape_and_shape_inference
Closed

Remove transpose from reshape builder#22901
shraiysh wants to merge 3 commits intoopenxla:mainfrom
shraiysh:fix_reshape_and_shape_inference

Conversation

@shraiysh
Copy link
Copy Markdown
Contributor

@shraiysh shraiysh commented Feb 20, 2025

Reshape builder unnecessarily accepts two arguments:

  1. dimensions which permutation of the layoyt of the shape.
  2. new_sizes which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.

@shraiysh shraiysh added the kokoro:force-run Forces CI to rerun label Feb 20, 2025
@shraiysh shraiysh force-pushed the fix_reshape_and_shape_inference branch 3 times, most recently from 49b54f9 to eb35b77 Compare February 20, 2025 18:04
@shraiysh
Copy link
Copy Markdown
Contributor Author

The tensorflow CI failure is because of no storage on device, and is not related to this PR.

@shraiysh shraiysh requested a review from reedwm February 20, 2025 19:57
@akuegel
Copy link
Copy Markdown
Member

akuegel commented Feb 21, 2025

If this is changed, the operation semantics should be changed as well:
https://openxla.org/xla/operation_semantics#reshape

In general I think it is probably a good idea to change this, as for stablehlo we already don't allow the implicit transpose:
https://github.com/openxla/stablehlo/blob/main/docs/spec.md#reshape

@shraiysh
Copy link
Copy Markdown
Contributor Author

shraiysh commented Feb 21, 2025

If this is changed, the operation semantics should be changed as well:
https://openxla.org/xla/operation_semantics#reshape

Can you tell me where the source for this is?
Edit: nevermind, found it

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.
@shraiysh shraiysh force-pushed the fix_reshape_and_shape_inference branch from eb35b77 to b250412 Compare February 21, 2025 16:10
Copy link
Copy Markdown
Member

@akuegel akuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

copybara-service Bot pushed a commit that referenced this pull request Feb 25, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 25, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 25, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 25, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 25, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 25, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 26, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 26, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 26, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 26, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
@shraiysh
Copy link
Copy Markdown
Contributor Author

Are there internal failures with this PR? Let me know if there is anything I can do to help merge this.

@akuegel
Copy link
Copy Markdown
Member

akuegel commented Feb 27, 2025

There were internal adjustments needed. I did the last ones yesterday, but I need approval for them and unfortunately so far I didn't get it. Hopefully I can merge it either later today or tomorrow.

copybara-service Bot pushed a commit that referenced this pull request Feb 28, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 28, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 28, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 28, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 28, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 28, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit that referenced this pull request Feb 28, 2025
Imported from GitHub PR #22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc31 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cf by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b250412 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22901 from shraiysh:fix_reshape_and_shape_inference b250412
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 28, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#22901 from shraiysh:fix_reshape_and_shape_inference b25041292522834a544b2c7c463909fc576c4ba9
PiperOrigin-RevId: 730737886
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Feb 28, 2025
Imported from GitHub PR openxla/xla#22901

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which permutation of the  layoyt of the shape.
 2. `new_sizes` which are the new dimensions of the shape.

This is confusing, and the we can simply remove the support for permutation of layout - as it is just a transpose and such a transpose can be easily constructed wherever required.
Copybara import of the project:

--
b44dc317188053cd51b7af4e90598ba357ba1197 by Shraiysh Vaishay <svaishay@nvidia.com>:

Remove transpose from reshape builder

Reshape builder unnecessarily accepts two arguments:

 1. `dimensions` which is the "layout" of the shape.
 2. `new_sizes` which is the "dimensions" of the shape.

This is confusing, and the we can simply remove the support for
layout - as it is just a transpose and such a transpose can be
easily constructed wherever required.

--
a7100cfc2185f5b8fd9dcf6dfa52c221b195021c by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix unrelated clang-format issues in xla/python/ops.cc

--
b25041292522834a544b2c7c463909fc576c4ba9 by Shraiysh Vaishay <svaishay@nvidia.com>:

Fix semantics doc

Merging this change closes #22901

PiperOrigin-RevId: 732082186
tengyifei added a commit to pytorch/xla that referenced this pull request Mar 5, 2025
I need to rewrite reshape usage according to
openxla/xla#22901 and handle some breaking
xla::ifrt changes.
tengyifei added a commit to pytorch/xla that referenced this pull request Mar 5, 2025
I need to rewrite reshape usage according to
openxla/xla#22901 and handle some breaking
xla::ifrt changes.

I also need to force HLO printing to use the Default (long) format
due to https://github.com/openxla/xla/pull/22614/files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run Forces CI to rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants