[KB] Enable dynamo plugin for KB tests#157
Open
rengolin wants to merge 3 commits into
Open
Conversation
This PR enables a new mode in kernel_bench that allows one to use the Torch Dynamo compiler plugin (CPU only for now). This is similar to the previous imported module: it runs the same pipeline, compiles the same MLIR modules and yield the same results. Major changes: * Factoring some code around import & pipeline - import_module extracted in lh.ingress.torch - make_function_callable an external helper now * Make kernel_bench import the Torch model first - Run torch eager to gather the reference output - import to MLIR or run with torch.compile - reuse the same pipeline on both cases - Compare outputs instead of printing output * Allowing empty input/output shapes for torch-compile - For Dynamo this can be fetched from model and used - Import can probably also, but for a later PR Torch Compile mode enabled in CI with the previous tests. Note: This is not the default yet due to benchmark not enabled on this mode yet. A follow up PR will add support and enable it by default.
so that we know they're always correct you can still override in kernel_bench, this just makes the smoke test much easier CI wants to be fast, so we allow to pass the shapes by cmd line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables a new mode in kernel_bench that allows one to use the Torch Dynamo compiler plugin (CPU only for now). This is similar to the previous imported module: it runs the same pipeline, compiles the same MLIR modules and yield the same results.
Major changes:
Torch Compile mode enabled in CI with the previous tests.
Note: This is not the default yet due to benchmark not enabled on this mode yet. A follow up PR will add support and enable it by default.