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

Create new TTIROpInterface methods #1272

Open
nsmithtt opened this issue Nov 14, 2024 · 3 comments
Open

Create new TTIROpInterface methods #1272

nsmithtt opened this issue Nov 14, 2024 · 3 comments
Assignees

Comments

@nsmithtt
Copy link
Contributor

Update include/ttmlir/Dialect/TTIR/IR/TTIROpsInterfaces.td, update op interface def TTIROpInterface to include 2 new op interface methods:

  • bool supportsCPUExecution();: Denotes that this op can use the CPU for execution
  • bool supportsOnlyCPUExecution();: Denotes that this op must use the CPU for execution

Both should default return false, individual ops will have to override them to return true. If they return true, it can be asserted that there exists a dialect conversion for this TTIR op into a CPU compatible dialect.

@nsmithtt
Copy link
Contributor Author

@sdjordjevicTT, in the doc we said these should be traits, do you have any preference if they have dedicated traits vs just being boolean queries on TTIROpInterface?

@sdjordjevicTT
Copy link
Contributor

sdjordjevicTT commented Nov 14, 2024

@sdjordjevicTT, in the doc we said these should be traits, do you have any preference if they have dedicated traits vs just being boolean queries on TTIROpInterface?

Sound good and makes sense as each op can override it through interface methods, hence we are getting the same behaviour.

@nsmithtt
Copy link
Contributor Author

The only thing I was thinking is that presumably we will have a dialect conversion that does TTIRToTOSA or something, then there is just kind of an implicit contract that if supportsCPUExecution returns true there must be a conversion path for it. That said, it might not be a big deal, and there might be cases where we want to selectively disable supportsCPUExecution despite there being a tosa conversion for it. I'm probably overthinking it 😅

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

No branches or pull requests

3 participants