Skip to content

Delay pass creation until time to run #1621

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
Open

Delay pass creation until time to run #1621

wants to merge 1 commit into from

Conversation

shaahji
Copy link
Contributor

@shaahji shaahji commented Feb 14, 2025

Delay pass creation until time to run

Logic avoids instantiating a Pass unless it is to be run. To avoid instantiation, only FullPassConfig is passed around.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
  • Is this PR including examples changes? If yes, please remember to update example documentation in a follow-up PR.

(Optional) Issue link

@shaahji shaahji force-pushed the shaahji/system branch 2 times, most recently from 50e7c70 to 8d49aed Compare March 5, 2025 17:49
Logic avoids instantiating a Pass unless it is to be run.
To avoid instantiation, only FullPassConfig is passed around.
pass_cls: Type[Pass] = olive_config.import_pass_module(full_pass_config.type)

config_dict = full_pass_config.to_json().get("config") or {}
for param, param_config in pass_cls.default_config(full_pass_config.accelerator).items():
Copy link
Contributor

@xiaoyu-work xiaoyu-work Mar 25, 2025

Choose a reason for hiding this comment

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

Little bit confused here, can we use full_pass_config.config to get pass config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we need a dictionary here not an object of type BasePassConfig.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the only way to get a dict config? I just realize one of our test is failing due to this as well after this pr. Can you fix this?

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