Skip to content

Commit

Permalink
docs: how to support a new model tutorial (#181)
Browse files Browse the repository at this point in the history
* 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
jonathlela and pommedeterresautee authored Jan 22, 2023
1 parent 306aa3a commit 91530e6
Show file tree
Hide file tree
Showing 11 changed files with 740 additions and 10 deletions.
3 changes: 0 additions & 3 deletions docs/get-started/start.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/how-to-guides/attention.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/how-to-guides/attention_fused.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/how-to-guides/attention_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/how-to-guides/fx_graph.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions docs/how-to-guides/get-started.md
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.
Loading

0 comments on commit 91530e6

Please sign in to comment.