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

Adding e2e tests for i1 mask attentions #19312

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

lialan
Copy link
Contributor

@lialan lialan commented Nov 27, 2024

  • New tests are aimed at testing with option --iree-experimental-packed-i1-storage turned on, which allows real packed i1 datatype in memory.
  • Only certain shapes are correct at this moment as upstream patches for emulating unaligned vector stores are not yet merged.

@lialan lialan force-pushed the lialan/attention_i1_e2e branch 6 times, most recently from 35f7356 to 9985827 Compare November 29, 2024 03:24
@lialan lialan marked this pull request as ready for review November 29, 2024 04:36
@lialan lialan requested review from ScottTodd, rsuderman, Max191 and raikonenfnu and removed request for ScottTodd and rsuderman December 3, 2024 02:29
@lialan lialan force-pushed the lialan/attention_i1_e2e branch from 9985827 to 6983fa5 Compare December 4, 2024 09:01
@lialan lialan requested a review from raikonenfnu December 4, 2024 09:52
@lialan
Copy link
Contributor Author

lialan commented Dec 4, 2024

@raikonenfnu @ScottTodd comments are addressed. Can you review again?

Comment on lines +85 to +88
%mask = util.unfoldable_constant dense<[[[true, true, true, true],
[true, true, true, true],
[true, true, true, true],
[true, true, true, true]]]> : tensor<1x4x4xi1>
Copy link
Member

Choose a reason for hiding this comment

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

For unit testing, would it be useful to set some of these mask values to false?

Maybe add a new test case attention1x4x4_i1_mask_some_ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is already a test which has some mask values set to false in the same file, so I am not testing it for general cases. This all ones test has a copy in attention_i1_mask.mlir, the purpose is to test that the results are exactly the same under both memory layout configurations.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we intend to set all values to true, why not just write something like dense<true>?

@lialan lialan force-pushed the lialan/attention_i1_e2e branch from 372984a to f2587f5 Compare December 5, 2024 00:57
@lialan lialan requested a review from ScottTodd December 5, 2024 00:57
Copy link
Collaborator

@raikonenfnu raikonenfnu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

To test actual i1 handling with attention op.

Signed-off-by: Alan Li <me@alanli.org>
@lialan lialan force-pushed the lialan/attention_i1_e2e branch from f2587f5 to b26f268 Compare December 5, 2024 03:30
@lialan lialan merged commit 5dee2c8 into main Dec 5, 2024
41 checks passed
@lialan lialan deleted the lialan/attention_i1_e2e branch December 5, 2024 04:05
@lialan lialan restored the lialan/attention_i1_e2e branch December 5, 2024 04:05
@lialan lialan deleted the lialan/attention_i1_e2e branch December 5, 2024 04:06
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to name it to attention_i1_packed_mask.mlir, which clearly make a distinction between this and the test in the other file.

Copy link
Contributor

@hanhanW hanhanW left a comment

Choose a reason for hiding this comment

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

@lialan can you add me to reviewers for all the i1 changes? I mis-track it and it makes me hard to review other PRs like #19354

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.

4 participants