You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,9 @@ checkstyle:
20
20
# Command to run pytest for convergence tests
21
21
# We have to explicitly set HF_DATASETS_OFFLINE=1, or dataset will silently try to send metrics and timeout (80s) https://github.com/huggingface/datasets/blob/37a603679f451826cfafd8aae00738b01dcb9d58/src/datasets/load.py#L286
Copy file name to clipboardExpand all lines: README.md
+14-80Lines changed: 14 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,8 @@
52
52
53
53
<details>
54
54
<summary>Latest News 🔥</summary>
55
-
55
+
56
+
-[2024/11/6] We release [v0.4.0](https://github.com/linkedin/Liger-Kernel/releases/tag/v0.4.0): Full AMD support, Tech Report, Modal CI, Llama-3.2-Vision!
56
57
-[2024/10/21] We have released the tech report of Liger Kernel on Arxiv: https://arxiv.org/pdf/2410.10989
57
58
-[2024/9/6] We release v0.2.1 ([X post](https://x.com/liger_kernel/status/1832168197002510649)). 2500+ Stars, 10+ New Contributors, 50+ PRs, 50k Downloads in two weeks!
58
59
-[2024/8/31] CUDA MODE talk, [Liger-Kernel: Real-world Triton kernel for LLM Training](https://youtu.be/gWble4FreV4?si=dxPeIchhkJ36Mbns), [Slides](https://github.com/cuda-mode/lectures?tab=readme-ov-file#lecture-28-liger-kernel)
@@ -80,18 +81,12 @@ With one line of code, Liger Kernel can increase throughput by more than 20% and
|[**Hugging Face Trainer**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/huggingface)| Train LLaMA 3-8B ~20% faster with over 40% memory reduction on Alpaca dataset using 4 A100s with FSDP | TBA |
88
-
|[**Lightning Trainer**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/lightning)| Increase 15% throughput and reduce memory usage by 40% with LLaMA3-8B on MMLU dataset using 8 A100s with DeepSpeed ZeRO3 | TBA |
|[**Medusa Multi-head LLM (Retraining Phase)**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/medusa)| Reduce memory usage by 80% with 5 LM heads and improve throughput by 40% using 8 A100s with FSDP |TBA |
|[**Hugging Face Trainer**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/huggingface)| Train LLaMA 3-8B ~20% faster with over 40% memory reduction on Alpaca dataset using 4 A100s with FSDP|
88
+
|[**Lightning Trainer**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/lightning)| Increase 15% throughput and reduce memory usage by 40% with LLaMA3-8B on MMLU dataset using 8 A100s with DeepSpeed ZeRO3 |
89
+
|[**Medusa Multi-head LLM (Retraining Phase)**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/medusa)| Reduce memory usage by 80% with 5 LM heads and improve throughput by 40% using 8 A100s with FSDP ||
95
90
96
91
## Key Features
97
92
@@ -102,13 +97,6 @@ With one line of code, Liger Kernel can increase throughput by more than 20% and
-**Embedding**: [Embedding](https://pytorch.org/docs/stable/generated/torch.nn.Embedding.html) is implemented by fusing embedding lookup and output operations. It achieves a peak speedup of ~1.5x in the forward pass and an overall speedup of ~1.1x.
300
271
-**Matmul int2xint8**: is implemented by using the cache tiled matrix multiplication and by fusing the matmul with the unpacking process which achieves a considerable speed up and performs on par with @torch.compile
301
272
<!-- TODO: be more specific about batch size -->
302
-
> **Note:**
303
-
> Reported speedups and memory reductions are with respect to the LLaMA 3-8B Hugging Face layer implementations. All models use 4K hidden size and 4K sequence length and are evaluated based on memory usage and wall time for the forward+backward pass on a single NVIDIA A100 80G GPU using small batch sizes. Liger kernels exhibit more efficient scaling to larger batch sizes, detailed further in the [Benchmark](./benchmark) folder.
| 1 |[Unsloth](https://github.com/unslothai/unsloth/blob/fd753fed99ed5f10ef8a9b7139588d9de9ddecfb/unsloth/kernels/utils.py#L43)|`calculate_settings` to determine block size and warp; We reuse it for Norm and MLP |[Liger Kernel Utils](https://github.com/linkedin/Liger-Kernel/blob/e249eee723978bf8610ff1ea2297d048a2417e20/src/liger_kernel/ops/utils.py#L23)|[Apache](https://github.com/unslothai/unsloth/blob/fd753fed99ed5f10ef8a9b7139588d9de9ddecfb/LICENSE)|
326
-
| 2 |[Unsloth](https://github.com/unslothai/unsloth/blob/976d11a10d54383aeb7a692c69e01151a20bfd72/unsloth/kernels/rms_layernorm.py#L48)| We modified and added dW calculation on top of Unsloth implementation |[Liger Kernel RMS Norm](https://github.com/linkedin/Liger-Kernel/blob/e249eee723978bf8610ff1ea2297d048a2417e20/src/liger_kernel/ops/rms_norm.py#L50)|[Apache](https://github.com/unslothai/unsloth/blob/fd753fed99ed5f10ef8a9b7139588d9de9ddecfb/LICENSE)|
327
-
| 3 |[Triton tutorial](https://triton-lang.org/main/index.html)| We modified on top of triton tutorials |[Liger Kernel RMS Norm](https://github.com/linkedin/Liger-Kernel/blob/e249eee723978bf8610ff1ea2297d048a2417e20/src/liger_kernel/ops/rms_norm.py#L50)|[MIT](https://github.com/triton-lang/triton/blob/main/LICENSE)|
328
-
| 4 |[tiny shakespeare dataset](https://huggingface.co/datasets/karpathy/tiny_shakespeare)| We use tiny shakespeare dataset to conduct convergence test on mini model |[Liger Kernel Convergence](https://github.com/linkedin/Liger-Kernel/tree/main/test/convergence)| N/A |
329
-
| 5 |[Efficient Cross Entropy](https://github.com/mgmalek/efficient_cross_entropy)| We use the idea of gradient-in-forward and chunking |[Liger Kernel Linear Cross Entropy](https://github.com/linkedin/Liger-Kernel/blob/main/src/liger_kernel/ops/fused_linear_cross_entropy.py)|[MIT](https://github.com/mgmalek/efficient_cross_entropy/blob/main/LICENSE)|
330
-
| 6 |[Flash attn](https://github.com/Dao-AILab/flash-attention)| We take many optimization ideas from the work, such as tiling and recomputation ||[BSD](https://github.com/Dao-AILab/flash-attention/blob/main/LICENSE)|
331
-
| 7 |[AutoAWQ](https://github.com/casper-hansen/AutoAWQ)| We reference the design of automodel |[Liger Kernel Auto Model](https://github.com/linkedin/Liger-Kernel/blob/main/src/liger_kernel/transformers/auto_model.py)|[MIT](https://github.com/casper-hansen/AutoAWQ/blob/main/LICENSE)|
332
-
| 8 |[llm.c](https://github.com/karpathy/llm.c)| We reference the design of end-to-end testing |[Liger Kernel Convergence Tests](https://github.com/linkedin/Liger-Kernel/tree/main/test/convergence)|[MIT](https://github.com/karpathy/llm.c/blob/master/LICENSE)|
333
-
334
-
Many thanks to the contributors to these projects for their invaluable work that helped make Liger possible.
335
-
336
-
## License
337
273
338
-
This project is licensed under the [BSD 2-CLAUSE](https://github.com/linkedin/Liger-Kernel/blob/main/LICENSE) License (see `LICENSE` for details).
339
-
It also includes components from projects licensed under:
274
+
## Contributing, Acknowledgements, and License
340
275
341
-
- Apache License 2.0 (see `LICENSE-APACHE-2.0` for details).
342
-
- MIT License (see `LICENSE-MIT-AutoAWQ` for details).
343
-
- MIT License (see `LICENSE-MIT-Efficient Cross Entropy` for details).
344
-
- MIT License (see `LICENSE-MIT-llmc` for details).
345
-
- MIT License (see `LICENSE-MIT-triton` for details).
0 commit comments