8000 [inductor] dtype promotion error in cat decomp by pianpwk · Pull Request #152995 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[inductor] dtype promotion error in cat decomp #152995

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

Closed
wants to merge 9 commits into from

Conversation

pianpwk
Copy link
Contributor
@pianpwk pianpwk commented May 6, 2025

Copy link
pytorch-bot bot commented May 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/152995

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 10302c4 with merge base cbcb57d (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@@ -389,7 +393,7 @@ def non_empty_tensor(x: torch.Tensor) -> bool:

filtered_tensors = list(filter(non_empty_tensor, tensors))

if len(filtered_tensors) == 1:
if len(filtered_tensors) == 1 and all_tensors_same_dtype(tensors):
return filtered_tensors[0].clone()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use elementwise_dtypes() to figure out the output dtype and do type conversion here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah thanks, didn't know about this. just updated.

*tensors,
type_promotion_kind=ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
)[1]
) != filtered_tensors[0].dtype
Copy link
Contributor

Choose a reason for hiding this comment

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

With this, I don't think you need to check all_tensors_same_dtype anymore?

8000
return z * 2

model = Foo()
inps = (torch.randn(4, 10, dtype=torch.bfloat16), torch.randn(4, 0))
Copy link
Contributor

Choose a reason for hiding this comment

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

self.check_model is the common utility for AOTI compile and check.

Comment on lines 398 to 400
not all_tensors_same_dtype(tensors)
and (
promoted_dtype := elementwise_dtypes(
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 dont need both all_tensors_same_dtype and elementwise_dtypes.

promoted_dtype = elementwise_dtypes(...)[0]
filter_t = filter_t[0]
return filter_t if promoted_dtype != filter_t.dtype else filter_t.to(promoted_dtype)

@pianpwk
Copy link
Contributor Author
pianpwk commented May 7, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 7, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pianpwk
Copy link
Contributor Author
pianpwk commented May 8, 2025

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pianpwk
Copy link
Contributor Author
pianpwk commented May 9, 2025

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0