-
Notifications
You must be signed in to change notification settings - Fork 75
[NFI]: XPUBackend refactoring to facilitate arch-specific implementations #5329
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
base: main
Are you sure you want to change the base?
Conversation
etiotto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering whether we should use easier to understand alternative. Have you considered:
- Inheritance: create a base class that can be derived (my preference)
- class Decorators to modify the behavior of the BE after creation
XPUBackend is the base class. Arch-specific implementations derive from it and override the required methods. For example, they could override
It could be done, by defining a metaclass, but the inheritance should be used in most use-cases. |
2c0c89d to
055acd2
Compare
055acd2 to
abbf291
Compare
abbf291 to
82ab83b
Compare
|
@AndreyPavlenko please resolve the merge conflicts, and merge it tomorrow as there are no more review comments. |
d3ce2a9 to
b0263fb
Compare
|
Seems there is some issue with CI. I see the same errors on the main branch: |
Should be fixed now. |
b0263fb to
2dec49c
Compare
|
The SPIRVRunner test is also failing. |
2dec49c to
a37ad7e
Compare
- Allow metaclasses injection: use XPUBackendMeta from the .meta submodule as the metaclass, if it exists. - Try to find an arch-specific implementation in the .arch.<name> submodule. - Create the list of passes in separate methods to allow subclasses to modify it.
a37ad7e to
cade688
Compare
The purpose of this refactoring is to simplify development for new architectures by subclassing the base class instead of adding conditional code blocks.
The main changes:
.arch.<name>submodule.