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

dialects: (memref_stream) remove unused operands in canonicalization #2851

Merged
merged 69 commits into from
Jul 8, 2024

Conversation

superlopuh
Copy link
Member

@superlopuh superlopuh commented Jul 6, 2024

This happens in pooling, where a tensor with a shape and no contents is created to specify the iteration space.

superlopuh added 30 commits July 2, 2024 09:43
…eaved' into sasha/memref_stream/lower-interleaved
Copy link

codecov bot commented Jul 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@7fd68f4). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2851   +/-   ##
=======================================
  Coverage        ?   89.86%           
=======================================
  Files           ?      396           
  Lines           ?    49796           
  Branches        ?     7679           
=======================================
  Hits            ?    44749           
  Misses          ?     3837           
  Partials        ?     1210           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor nit: It seems that you have some left-over bits of also dropping results, but most of it seems removed...

// CHECK-NEXT: ],
// CHECK-NEXT: iterator_types = ["parallel", "parallel", "reduction"]
// CHECK-NEXT: } ins(%{{.*}} : memref<4x2xf64>) outs(%{{.*}}, %{{.*}} : memref<4x3xf64>, memref<4x3xf64>) inits(%H : f64, None) {
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64):
// CHECK-NEXT: ^{{\S*}}(%{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64):

Otherwise this will still pass for blocks with 15 arguments.

// CHECK-NEXT: ],
// CHECK-NEXT: iterator_types = ["parallel", "parallel", "reduction", "interleaved"]
// CHECK-NEXT: } ins(%{{.*}}, %{{.*}} : memref<3x5xf64>, memref<5x8xf64>) outs(%{{.*}} : memref<3x8xf64>) {
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// CHECK-NEXT: ^{{.*}}(%{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64, %{{.*}} : f64):
// CHECK-NEXT: ^{{\S*}}(%{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64, %{{\S*}} : f64):

num_outputs_dropped = 0
for index, arg in enumerate(block_args[:num_inputs]):
drop_operand = index in unused_input_indices
is_input = index < num_inputs
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this always the case, as you are only iterating over the first num_inputs block args?

Copy link
Member Author

@superlopuh superlopuh Jul 8, 2024

Choose a reason for hiding this comment

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

indeed, this is from a previous version of the code, I'll remove it

  • remove it

Base automatically changed from sasha/memref_stream/really-lower to main July 8, 2024 16:14
@superlopuh superlopuh merged commit dabcdd2 into main Jul 8, 2024
10 checks passed
@superlopuh superlopuh deleted the sasha/memref_stream/unused-operands branch July 8, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants