Skip to content

Allow operands and results of tosa.custom to be None. #579

Closed
jorickert wants to merge 1 commit intofeature/fused-opsfrom
jrickert.custom_none
Closed

Allow operands and results of tosa.custom to be None. #579
jorickert wants to merge 1 commit intofeature/fused-opsfrom
jrickert.custom_none

Conversation

@jorickert
Copy link
Copy Markdown

This enables lowering from dialects that support None operands or results

…wering from dialects that support None operands or results
@jorickert jorickert requested a review from mathmer-amd June 23, 2025 06:36
Copy link
Copy Markdown

@mathmer-amd mathmer-amd left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Comment on lines +698 to +702
// CHECK-LABEL: test_custom_none
func.func @test_custom_none(%arg0: tensor<10xi32>, %arg1: none) -> tensor<10xi32> {
%0 = tosa.custom %arg0, %arg1 {operator_name="custom_test", domain_name="tosa.mlir_test", implementation_attrs="" } : (tensor<10xi32>, none) -> (tensor<10xi32>)
return %0 : tensor<10xi32>
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NIT: I think it could be nice to have the other test where the output of tosa.custom is None

@jorickert
Copy link
Copy Markdown
Author

Closing, its likely better to not convert operations with a none argument to tosa.custon

@jorickert jorickert closed this Jun 23, 2025
@roberteg16
Copy link
Copy Markdown

Closing, its likely better to not convert operations with a none argument to tosa.custon

Aggred, I think it is a better idea to fail the lowering until we have a clear understanding on how TOSA deals with none

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