Instructions to use replicate/flashinfer-draft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/flashinfer-draft with Kernels:
# !pip install kernels from kernels import get_kernel kernel = get_kernel("replicate/flashinfer-draft") - Notebooks
- Google Colab
- Kaggle
drbh commited on
Commit ·
1f702ad
1
Parent(s): 3a9af28
fix: adjust doc typo
Browse files- generate-source.md +8 -4
generate-source.md
CHANGED
|
@@ -12,10 +12,6 @@ export CUDA_HOME=/usr/local/cuda-12.6 && export TORCH_CUDA_ARCH_LIST="7.5 8.0 8.
|
|
| 12 |
|
| 13 |
# 4. Copy generated files to csrc directory
|
| 14 |
cp -r build/aot/generated ../csrc/generated
|
| 15 |
-
|
| 16 |
-
# 5. Push to HuggingFace
|
| 17 |
-
git remote add origin git@hf.co:kernels-community/flashinfer-draft
|
| 18 |
-
git push origin main
|
| 19 |
```
|
| 20 |
|
| 21 |
now manually comment out the `TORCH_LIBRARY_FRAGMENT` in the generated files
|
|
@@ -25,4 +21,12 @@ specifically in the activation `csrc/generated/gelu_and_mul.cu` and etc since th
|
|
| 25 |
### build and test
|
| 26 |
|
| 27 |
```bash
|
|
|
|
| 28 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# 4. Copy generated files to csrc directory
|
| 14 |
cp -r build/aot/generated ../csrc/generated
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
```
|
| 16 |
|
| 17 |
now manually comment out the `TORCH_LIBRARY_FRAGMENT` in the generated files
|
|
|
|
| 21 |
### build and test
|
| 22 |
|
| 23 |
```bash
|
| 24 |
+
nix develop -L .#test --command python tests/simple_test.py
|
| 25 |
```
|
| 26 |
+
|
| 27 |
+
```txt
|
| 28 |
+
GELU and multiply operation completed. Output shape: torch.Size([128, 2048])
|
| 29 |
+
Output tensor sample: tensor([[ 7.8613e-02, -4.7656e-01, -4.8637e-03, 6.2073e-02, -3.8745e-01],
|
| 30 |
+
[ 1.5686e-01, -5.0964e-03, -3.8981e-04, 1.8945e+00, -7.3792e-02],
|
| 31 |
+
...
|
| 32 |
+
```
|