Skip to content

[TOSA] Add TosaLayerwiseConstantFoldPass and TosaReduceTransposes passes #4165

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justin-ngo-arm
Copy link
Contributor

Add the following passes to TorchBackendToTosaBackendPipeline:

  • TosaLayerwiseConstantFoldPass: fold full-layer operations on TOSA consts
  • TosaReduceTransposes: remove unnecessary TOSA transposes to reduce data movements

Add the following passes to TorchBackendToTosaBackendPipeline:
- TosaLayerwiseConstantFoldPass: fold full-layer operations on TOSA
  consts
- TosaReduceTransposes: remove unnecessary TOSA transposes to reduce
  data movements

Signed-off-by: Justin Ngo <[email protected]>
Change-Id: I44636a7392a571e57c2c3a2c0316835d2d2ca938
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.

LGTM, except for the timeout comment. I am not sure if increasing the timeout for all conversion paths is acceptable.

# File "torch-mlir/build/tools/torch-mlir/python_packages/torch_mlir/torch_mlir_e2e_test/framework.py", line 316, in handle_timeout
# raise TimeoutError(self.error_message)
# TimeoutError: Timeout
"BertModule_basic",
Copy link
Member

Choose a reason for hiding this comment

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

It's possible to specify a timeout value like

@register_test_case(module_factory=lambda: TimeOutModule(), timeout_seconds=10)
but I don't know if it's possible to increase the value only to Tosa conversion path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's a good idea to increase the timeout for all conversion paths. Right now, the BertModule test is marked as XFail any way, so maybe it can be fixed altogether later.

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.

2 participants