-
Notifications
You must be signed in to change notification settings - Fork 35
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
[tuner] Add direct TD spec generation for candidates #606
Conversation
This PR is broken right now because of an issue tracked here iree-org/iree#19269. Reviews are appreciated, but it won't be able to land until after this issue is resolved. |
de3e5e6
to
fb7846f
Compare
# Index 0 is reserved for default config, so it gets no td spec. | ||
with ir.Location.unknown() as loc: | ||
empty_module = ir.Module.create(loc) | ||
config_specs: list[ir.Module] = [empty_module] |
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.
To avoid this special case, we could also look up the lowering_config and translation_info from the original module and re-materialize it here, but I don't think it's worth it...
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.
Or we could generate a placeholder spec that never matches anything.
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.
I kind of like the empty module for now. It seems relatively clean to me, and it makes it clear to someone looking through the specs that it is a placeholder. Having an explicit placeholder spec would also be good.
872be87
to
119833b
Compare
083018d
to
41bb86d
Compare
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.
LGTM. Make sure you drop the benchmark mlir files before landing.
f37d82f
to
e435510
Compare
Signed-off-by: Max Dawkins <[email protected]>
259bd92
to
37a349c
Compare
This PR adds direct transform dialect spec generation for candidate configurations. This is the first part of the large refactoring described in nod-ai#577. The way TD specs are generated is by matching against certain types of operations, and then creating a named sequence with `transform.iree.match.cast_compatible_dag_from_root` based on the matched operation. This is done for each configuration found, and the specs are saved to the temporary tuning directory to be used later in tuning. One main difference in the flow of candidate generation is that state is no longer tracked by saving files to a temporary directory. Instead, ir modules are passed to each function, and only at the very end of candidate generation are the transform dialect specs written to files. This makes things cleaner, since there no longer needs to be a coordination of file paths. Signed-off-by: Max Dawkins <[email protected]>
This PR removes the old code paths for the tuner following the large refactoring done in #606 and #704. - The old compilation and benchmarking logic for models and dispatches are now gone, and the unified `benchmark` and `compile` functions should be used instead. - Much of the dispatch parsing logic is removed, and dispatch parsing is now done by 2 DispatchParser implementations for contraction ops and convolution ops. - The example tuning clients in `tuner/examples` for dispatches and punet are removed, since they use the old path. The new example to follow is in `tuner/examples/test`. - The candidate generation `tune` function is removed, and the `generate_configs_and_td_specs` should be used to generate candidates instead. - Many utility functions, structs, and struct fields are now removed, since they are no longer used. - All tests testing the old path are removed. --------- Signed-off-by: Max Dawkins <[email protected]>
This PR adds direct transform dialect spec generation for candidate configurations. This is the first part of the large refactoring described in #577. The way TD specs are generated is by matching against certain types of operations, and then creating a named sequence with `transform.iree.match.cast_compatible_dag_from_root` based on the matched operation. This is done for each configuration found, and the specs are saved to the temporary tuning directory to be used later in tuning. One main difference in the flow of candidate generation is that state is no longer tracked by saving files to a temporary directory. Instead, ir modules are passed to each function, and only at the very end of candidate generation are the transform dialect specs written to files. This makes things cleaner, since there no longer needs to be a coordination of file paths. Signed-off-by: Max Dawkins <[email protected]>
This PR removes the old code paths for the tuner following the large refactoring done in #606 and #704. - The old compilation and benchmarking logic for models and dispatches are now gone, and the unified `benchmark` and `compile` functions should be used instead. - Much of the dispatch parsing logic is removed, and dispatch parsing is now done by 2 DispatchParser implementations for contraction ops and convolution ops. - The example tuning clients in `tuner/examples` for dispatches and punet are removed, since they use the old path. The new example to follow is in `tuner/examples/test`. - The candidate generation `tune` function is removed, and the `generate_configs_and_td_specs` should be used to generate candidates instead. - Many utility functions, structs, and struct fields are now removed, since they are no longer used. - All tests testing the old path are removed. --------- Signed-off-by: Max Dawkins <[email protected]>
This PR adds direct transform dialect spec generation for candidate configurations. This is the first part of the large refactoring described in #577. The way TD specs are generated is by matching against certain types of operations, and then creating a named sequence with
transform.iree.match.cast_compatible_dag_from_root
based on the matched operation. This is done for each configuration found, and the specs are saved to the temporary tuning directory to be used later in tuning.One main difference in the flow of candidate generation is that state is no longer tracked by saving files to a temporary directory. Instead, ir modules are passed to each function, and only at the very end of candidate generation are the transform dialect specs written to files. This makes things cleaner, since there no longer needs to be a coordination of file paths.