Skip to content

Conversation

@Lallapallooza
Copy link
Contributor

Teach the TorchToTosa reducer that an explicit empty dim list means "all dims" and cast the result back to the requested dtype. Add MLIR and e2e regression cases and update XFAILs.

Teach the TorchToTosa reducer that an explicit empty dim list means "all dims"
and cast the result back to the requested dtype. Add MLIR and e2e regression
cases and update XFAILs.

Change-Id: Ibd1be38d219ad5c1986eb4a641efbb9ff0cb6a55
@Lallapallooza
Copy link
Contributor Author

@sahas3 @sjarus can you please take a look?

@catcor01
Copy link

Reviewed. Looks good to me.

Copy link
Member

@sahas3 sahas3 left a comment

Choose a reason for hiding this comment

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

Thanks for the enhancement.

}

// Ensure the result element type matches the expected output type.
if (val.getType() != output_type) {
Copy link
Member

Choose a reason for hiding this comment

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

Clarification: In what scenarios will this happen? From the added LIT test it seems that this cast wasn't necessary.

// -----

// CHECK-LABEL: func.func @test_reduce_sum_empty_dims$basic(
// CHECK-SAME: %[[VAL_0:.*]]: !torch.vtensor<[2,3,4],f32>) -> !torch.vtensor<[],f32> {
Copy link
Member

Choose a reason for hiding this comment

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

It'll be nice to update the variable names similar to the other PR.

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.

3 participants