Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ReplaceWhileOperandShape api to HloInstruction. This function provides an interface to change the shape an tuple operand in while loops. #67127

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link

Introduce ReplaceWhileOperandShape api to HloInstruction. This function provides an interface to change the shape an tuple operand in while loops.

The default implementation (ShapeTransformer) propagates shape change through instructions in which the output shape is directly inferred from operands, namely, gte, tuple, and nested while loops.

As the result, if the changed operand of the while loop is only used by the mentioned instructions, the call to ReplaceWhileOperandShape guarantees validity of the hlo graph after shape replacement. Currently, the replace function simply bails and returns false if there are any users other than the mentioned instructions.

…on provides an interface to change the shape an tuple operand in while loops.

The default implementation (ShapeTransformer) propagates shape change through instructions in which the output shape is directly inferred from operands, namely, gte, tuple, and nested while loops.

As the result, if the changed operand of the while loop is only used by the mentioned instructions, the call to ReplaceWhileOperandShape guarantees validity of the hlo graph after shape replacement. Currently, the replace function simply bails and returns false if there are any users other than the mentioned instructions.

PiperOrigin-RevId: 631561771
@copybara-service copybara-service bot closed this May 30, 2024
@copybara-service copybara-service bot deleted the exported_pr_631561771 branch May 30, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant