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

Select in Generic Pattern Matching for FP8 GEMMs in XLA #61758

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

philipphack
Copy link
Contributor

Adds Select to the set of ops supported by the generic pattern matching for FP8 GEMMs.

@google-ml-butler google-ml-butler bot added the size:L CL Change Size: Large label Aug 30, 2023
@philipphack
Copy link
Contributor Author

CC @reedwm.

@reedwm reedwm self-requested a review August 30, 2023 22:52
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Aug 30, 2023
Comment on lines +263 to +264
!Match(subgraph[i].first->operand(subgraph[i].second == 2 ? 1 : 2),
m::Broadcast(m::ConstantScalar(0)))) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test for the case where the other operand is nonzero?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We generally don't have negative tests. Do we need one here?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's worthwhile to have one in this case, since otherwise we wouldn't catch bugs like if you hypothetically matched any ConstantScalar instead of a ConstantScalar of 1.

But for the sake of expediency in getting FP8 models working, I'll approve and merge now. Can you add a test in a follow up PR? If you are too busy I can also add one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me quickly add one here then.

Copy link
Member

Choose a reason for hiding this comment

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

Ok i'll hold off on merging until you added the test

@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Aug 31, 2023
@gbaned gbaned added the comp:xla XLA label Aug 31, 2023
Comment on lines +263 to +264
!Match(subgraph[i].first->operand(subgraph[i].second == 2 ? 1 : 2),
m::Broadcast(m::ConstantScalar(0)))) {
Copy link
Member

Choose a reason for hiding this comment

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

I think it's worthwhile to have one in this case, since otherwise we wouldn't catch bugs like if you hypothetically matched any ConstantScalar instead of a ConstantScalar of 1.

But for the sake of expediency in getting FP8 models working, I'll approve and merge now. Can you add a test in a follow up PR? If you are too busy I can also add one.

PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Aug 31, 2023
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Aug 31, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Aug 31, 2023
@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label Aug 31, 2023
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Aug 31, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Aug 31, 2023
@copybara-service copybara-service bot merged commit 6bffcec into tensorflow:master Aug 31, 2023
14 of 15 checks passed
PR Queue automation moved this from Approved by Reviewer to Merged Aug 31, 2023
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Aug 31, 2023
Imported from GitHub PR tensorflow/tensorflow#61758

Adds Select to the set of ops supported by the generic pattern matching for FP8 GEMMs.
Copybara import of the project:

--
4aa0659cac381691817b02cc5a33ac16ccc6c433 by Philipp Hack <phack@nvidia.com>:

Support for select in generic pattern matching for FP8 GEMMs.

--
88ba2208aff790f5aa32f5c779ec32b0511b29e7 by Philipp Hack <phack@nvidia.com>:

Support for select in generic pattern matching for FP8 GEMMs.

--
7b3b60cd73f10899e5980c14cd63616bdc5c5ef2 by Philipp Hack <phack@nvidia.com>:

Support for select in generic pattern matching for FP8 GEMMs.

Merging this change closes #61758

PiperOrigin-RevId: 561735390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review Pull request awaiting review comp:xla XLA ready to pull PR ready for merge process size:L CL Change Size: Large
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants