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

Add lazy dialect loading #357

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Add lazy dialect loading #357

merged 2 commits into from
Jan 31, 2025

Conversation

JosseVanDelm
Copy link
Contributor

This is a first refactoring towards making something like snax-runner,
I'm refactoring the way our dialects get loaded to be more in line with how xdsl is doing it.
This gives us the benefit of quickly loading dialects in many different python files.
Furthermore it seems to enable lazy loading, which means that the context does not import the dialect definition unless it is really necessary, which is pretty nice!

@jorendumoulin
Copy link
Contributor

jorendumoulin commented Jan 30, 2025

very nice!
I slightly prefer how it is done in https://github.com/xdslproject/inconspiquous and https://github.com/xdslproject/xdsl-aie/, where the the get_all_dialects is overriden, instead of register_all_dialects. This way we can explicitly note down which dialects to include, rahter than to include all of them, and override some of them

What do you think about that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just put this one along in the dialects/init?

@JosseVanDelm JosseVanDelm merged commit bdd3e87 into main Jan 31, 2025
14 checks passed
@JosseVanDelm JosseVanDelm deleted the Josse/add-lazy-dialect-loading branch January 31, 2025 09:17
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