Point usage at the kernel repo
Browse files
README.md
CHANGED
|
@@ -20,26 +20,11 @@ tens-of-gigabytes operation into a flat, small one.
|
|
| 20 |
# pip install -U kernels
|
| 21 |
from kernels import get_kernel
|
| 22 |
|
| 23 |
-
flce = get_kernel("
|
| 24 |
|
| 25 |
loss = flce.fused_linear_cross_entropy(hidden, lm_head.weight, labels)
|
| 26 |
```
|
| 27 |
|
| 28 |
-
> **Note on loading.** `kernels` resolves kernels against the Hub's dedicated *kernel* repo type.
|
| 29 |
-
> Creating one is currently access-gated for this namespace, so this repo is published as a
|
| 30 |
-
> **model** repo carrying the standard kernel layout. Until it is recreated under the kernel repo
|
| 31 |
-
> type the call above will not resolve; clone the repo and load it locally instead:
|
| 32 |
-
>
|
| 33 |
-
> ```python
|
| 34 |
-
> from pathlib import Path
|
| 35 |
-
> from kernels import get_local_kernel
|
| 36 |
-
>
|
| 37 |
-
> flce = get_local_kernel(Path("/path/to/clone/of/fused-linear-ce"))
|
| 38 |
-
> ```
|
| 39 |
-
>
|
| 40 |
-
> The layout, `metadata.json` and variant resolution are already exactly what a kernel repo needs,
|
| 41 |
-
> so recreating it under the kernel repo type is a straight copy of these files.
|
| 42 |
-
|
| 43 |
Full signature:
|
| 44 |
|
| 45 |
```python
|
|
|
|
| 20 |
# pip install -U kernels
|
| 21 |
from kernels import get_kernel
|
| 22 |
|
| 23 |
+
flce = get_kernel("qgallouedec/fused-linear-ce", version=1, trust_remote_code=True)
|
| 24 |
|
| 25 |
loss = flce.fused_linear_cross_entropy(hidden, lm_head.weight, labels)
|
| 26 |
```
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
Full signature:
|
| 29 |
|
| 30 |
```python
|