-
Notifications
You must be signed in to change notification settings - Fork 39
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
[sharktank] Add common model config, export and compile #1013
base: main
Are you sure you want to change the base?
Conversation
5f8d32b
to
f2850be
Compare
We don't have a standard way to configure, export and compile sharktank models. Here is introduced such mechanism and for demonstration the CLIP text model is refactored to utilize this new approach. `config.json`: ``` { "model_type": "MyModel", "mlir_path": "model.mlir", "parameters_path": "model.irpa", "iree_module_path": "model.vmfb", "compile_args": ["--iree-hal-target-device=local"], "export_functions": [ { "function": "forward", "batch_sizes": [1, 2, 3] } ] } ``` usage ``` model = create_model("config.json") model.export() model.compile() ```
f2850be
to
649f64a
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.
I'll need to set up some time aside to review this in detail. Can you tag related issues on this PR and connect this back to the overall goals? Bonus points if you could also comment on the issues and help coordinate their full resolution. Cross-cutting work like this goes more smoothly if the plans are communicated ahead of time, before jumping straight to code.
These issues appear related:
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.
Yes the are related issues.
This PR requires some modification to make it more interoperable with IREE build pipeline tooling. |
I added an export function to be used in an IREE build pipeline. |
I have some py functions / classes for managing LLMs in I like the class / function structure currently in there, but they use a very hacky bash-script-in-python-script kind of solution to call into sharktank and IREE to shard / export / compile models. Would be very cool if I could switch to using this instead. |
We don't have a standard way to configure, export and compile sharktank models.
Here is introduced such mechanism and for demonstration the CLIP text model is refactored to utilize this new approach.
config.json
:usage