-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: how to support a new model tutorial (#181)
* feat: first commit for how to support a new model tutorial * feat: more explanations on torch FX * docs: add more on torch fx * docs: move to tutorial folder * docs: some mispell fixes * docs: new documentation structure * docs: update get started page with titles * fix: grammar check * doc: few corrections Co-authored-by: Michaël Benesty <pommedeterresautee@users.noreply.github.com>
- Loading branch information
1 parent
306aa3a
commit 91530e6
Showing
11 changed files
with
740 additions
and
10 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Get started | ||
|
||
## Install | ||
|
||
To install Kernl library, you just have to pip install it: | ||
|
||
``` { .bash } | ||
python3 -m pip install install 'git+https://github.com/ELS-RD/kernl' --extra-index-url https://download.pytorch.org/whl/nightly/cu117 | ||
``` | ||
|
||
## Optimize a model | ||
|
||
Then, in your progam, you have to import the optimization function and apply it to your model: | ||
|
||
``` { .py } | ||
from transformers import AutoModel | ||
from kernl.model_optimization import optimize_model | ||
|
||
model = AutoModel.from_pretrained(model_name).eval().cuda() | ||
optimize_model(model) | ||
``` | ||
|
||
That's it, you have your model with Kernl's optimizations ! | ||
|
||
Beware, Kernl works only on Ampere GPU and with python `3.9.*` for now. | ||
|
||
Look at the [repository README](https://github.com/ELS-RD/kernl#readme) for more informations. |
Oops, something went wrong.