liger-kernel-nightly 0.4.1.dev20241112233746__tar.gz → 0.4.1.dev20241113011623__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of liger-kernel-nightly might be problematic. Click here for more details.

Files changed (56) hide show
  1. {liger_kernel_nightly-0.4.1.dev20241112233746/src/liger_kernel_nightly.egg-info → liger_kernel_nightly-0.4.1.dev20241113011623}/PKG-INFO +15 -81
  2. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/README.md +14 -80
  3. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/pyproject.toml +1 -1
  4. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623/src/liger_kernel_nightly.egg-info}/PKG-INFO +15 -81
  5. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/LICENSE +0 -0
  6. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/NOTICE +0 -0
  7. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/setup.cfg +0 -0
  8. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/env_report.py +0 -0
  9. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/__init__.py +0 -0
  10. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/cross_entropy.py +0 -0
  11. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/experimental/embedding.py +0 -0
  12. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/experimental/mm_int8int2.py +0 -0
  13. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/fused_linear_cross_entropy.py +0 -0
  14. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/fused_linear_jsd.py +0 -0
  15. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/geglu.py +0 -0
  16. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/group_norm.py +0 -0
  17. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/jsd.py +0 -0
  18. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/kl_div.py +0 -0
  19. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/layer_norm.py +0 -0
  20. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/rms_norm.py +0 -0
  21. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/rope.py +0 -0
  22. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/swiglu.py +0 -0
  23. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/ops/utils.py +0 -0
  24. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/__init__.py +0 -0
  25. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/auto_model.py +0 -0
  26. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/cross_entropy.py +0 -0
  27. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/experimental/embedding.py +0 -0
  28. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/functional.py +0 -0
  29. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/fused_linear_cross_entropy.py +0 -0
  30. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/fused_linear_jsd.py +0 -0
  31. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/geglu.py +0 -0
  32. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/group_norm.py +0 -0
  33. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/jsd.py +0 -0
  34. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/kl_div.py +0 -0
  35. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/layer_norm.py +0 -0
  36. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/__init__.py +0 -0
  37. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/gemma.py +0 -0
  38. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/gemma2.py +0 -0
  39. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/llama.py +0 -0
  40. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/mistral.py +0 -0
  41. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/mixtral.py +0 -0
  42. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/mllama.py +0 -0
  43. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/phi3.py +0 -0
  44. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/qwen2.py +0 -0
  45. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/model/qwen2_vl.py +0 -0
  46. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/monkey_patch.py +0 -0
  47. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/rms_norm.py +0 -0
  48. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/rope.py +0 -0
  49. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/swiglu.py +0 -0
  50. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/transformers/trainer_integration.py +0 -0
  51. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/triton/__init__.py +0 -0
  52. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel/triton/monkey_patch.py +0 -0
  53. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel_nightly.egg-info/SOURCES.txt +0 -0
  54. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel_nightly.egg-info/dependency_links.txt +0 -0
  55. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel_nightly.egg-info/requires.txt +0 -0
  56. {liger_kernel_nightly-0.4.1.dev20241112233746 → liger_kernel_nightly-0.4.1.dev20241113011623}/src/liger_kernel_nightly.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: liger_kernel_nightly
3
- Version: 0.4.1.dev20241112233746
3
+ Version: 0.4.1.dev20241113011623
4
4
  Summary: Efficient Triton kernels for LLM Training
5
5
  License: BSD 2-CLAUSE LICENSE
6
6
  Copyright 2024 LinkedIn Corporation
@@ -99,7 +99,8 @@ Requires-Dist: seaborn; extra == "dev"
99
99
 
100
100
  <details>
101
101
  <summary>Latest News 🔥</summary>
102
-
102
+
103
+ - [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!
103
104
  - [2024/10/21] We have released the tech report of Liger Kernel on Arxiv: https://arxiv.org/pdf/2410.10989
104
105
  - [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!
105
106
  - [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)
@@ -127,18 +128,12 @@ With one line of code, Liger Kernel can increase throughput by more than 20% and
127
128
 
128
129
  ## Examples
129
130
 
130
- ### Basic
131
-
132
- | **Example** | **Description** | **Lightning Studio** |
133
- |------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
134
- | [**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 |
135
- | [**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 |
136
131
 
137
- ### Advanced
138
-
139
- | **Example** | **Description** | **Lightning Studio** |
140
- |------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
141
- | [**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 |
132
+ | **Use Case** | **Description** |
133
+ |------------------------------------------------|---------------------------------------------------------------------------------------------------|
134
+ | [**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 |
135
+ | [**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 |
136
+ | [**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 | |
142
137
 
143
138
  ## Key Features
144
139
 
@@ -149,13 +144,6 @@ With one line of code, Liger Kernel can increase throughput by more than 20% and
149
144
  - **Multi-GPU supported:** Compatible with multi-GPU setups (PyTorch FSDP, DeepSpeed, DDP, etc.).
150
145
  - **Trainer Framework Integration**: [Axolotl](https://github.com/axolotl-ai-cloud/axolotl), [LLaMa-Factory](https://github.com/hiyouga/LLaMA-Factory), [SFTTrainer](https://github.com/huggingface/trl/releases/tag/v0.10.1), [Hugging Face Trainer](https://github.com/huggingface/transformers/pull/32860), [SWIFT](https://github.com/modelscope/ms-swift)
151
146
 
152
- ## Target Audiences
153
-
154
- - **Researchers**: Looking to compose models using efficient and reliable kernels for frontier experiments.
155
- - **ML Practitioners**: Focused on maximizing GPU training efficiency with optimal, high-performance kernels.
156
- - **Curious Novices**: Eager to learn how to write reliable Triton kernels to enhance training efficiency.
157
-
158
-
159
147
  ## Installation
160
148
 
161
149
  ### Dependencies
@@ -261,23 +249,6 @@ loss = loss_fn(model.weight, input, target)
261
249
  loss.backward()
262
250
  ```
263
251
 
264
-
265
- ## Structure
266
-
267
- ### Source Code
268
-
269
- - `ops/`: Core Triton operations.
270
- - `transformers/`: PyTorch `nn.Module` implementations built on Triton operations, compliant with the `transformers` API.
271
-
272
- ### Tests
273
-
274
- - `transformers/`: Correctness tests for the Triton-based layers.
275
- - `convergence/`: Patches Hugging Face models with all kernels, runs multiple iterations, and compares weights, logits, and loss layer-by-layer.
276
-
277
- ### Benchmark
278
-
279
- - `benchmark/`: Execution time and memory benchmarks compared to Hugging Face layers.
280
-
281
252
  ## APIs
282
253
 
283
254
  ### AutoModel
@@ -296,7 +267,7 @@ loss.backward()
296
267
  | Mistral | `liger_kernel.transformers.apply_liger_kernel_to_mistral` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
297
268
  | Mixtral | `liger_kernel.transformers.apply_liger_kernel_to_mixtral` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
298
269
  | Gemma1 | `liger_kernel.transformers.apply_liger_kernel_to_gemma` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
299
- | Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss |
270
+ | Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
300
271
  | Qwen2 & Qwen2.5 | `liger_kernel.transformers.apply_liger_kernel_to_qwen2` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
301
272
  | Qwen2-VL | `liger_kernel.transformers.apply_liger_kernel_to_qwen2_vl` | RMSNorm, LayerNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
302
273
  | Phi3 & Phi3.5 | `liger_kernel.transformers.apply_liger_kernel_to_phi3` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
@@ -346,54 +317,17 @@ $$\text{GeGLU}(x)=\text{GELU}(xW+b)\otimes(xV+c)$$
346
317
  - **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.
347
318
  - **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
348
319
  <!-- TODO: be more specific about batch size -->
349
- > **Note:**
350
- > 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.
351
-
352
- ## Contributing
353
-
354
- [CONTRIBUTING GUIDE](https://github.com/linkedin/Liger-Kernel/blob/main/CONTRIBUTING.md)
355
-
356
- ## Acknowledgement
357
-
358
-
359
- ### Design
360
-
361
- - [@claire_yishan](https://twitter.com/claire_yishan) for the LOGO design
362
- - [Wave Snippets](https://www.wavesnippets.com/) for generating the animated code snippets
363
-
364
- ### Code
365
-
366
- We referenced or used the following projects:
367
-
368
-
369
-
370
- | # | Project | Description | Location | License |
371
- |---|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
372
- | 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) |
373
- | 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) |
374
- | 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) |
375
- | 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 |
376
- | 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) |
377
- | 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) |
378
- | 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) |
379
- | 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) |
380
-
381
- Many thanks to the contributors to these projects for their invaluable work that helped make Liger possible.
382
-
383
- ## License
384
320
 
385
- This project is licensed under the [BSD 2-CLAUSE](https://github.com/linkedin/Liger-Kernel/blob/main/LICENSE) License (see `LICENSE` for details).
386
- It also includes components from projects licensed under:
321
+ ## Contributing, Acknowledgements, and License
387
322
 
388
- - Apache License 2.0 (see `LICENSE-APACHE-2.0` for details).
389
- - MIT License (see `LICENSE-MIT-AutoAWQ` for details).
390
- - MIT License (see `LICENSE-MIT-Efficient Cross Entropy` for details).
391
- - MIT License (see `LICENSE-MIT-llmc` for details).
392
- - MIT License (see `LICENSE-MIT-triton` for details).
323
+ - [Contributing Guidelines](https://github.com/linkedin/Liger-Kernel/blob/main/docs/CONTRIBUTING.md)
324
+ - [Acknowledgements](https://github.com/linkedin/Liger-Kernel/blob/main/docs/Acknowledgement.md)
325
+ - [License Information](https://github.com/linkedin/Liger-Kernel/blob/main/docs/License.md)
393
326
 
394
327
  ## Contact
395
328
 
396
- - For public discussion, join [our discord channel](https://discord.gg/vNBDpjhb)
329
+ - For issues, create a Github ticket in this repository
330
+ - For open discussion, join [our discord channel](https://discord.gg/gpumode)
397
331
  - For formal collaboration, send an email to byhsu@linkedin.com
398
332
 
399
333
  ## Cite this work
@@ -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
80
81
 
81
82
  ## Examples
82
83
 
83
- ### Basic
84
-
85
- | **Example** | **Description** | **Lightning Studio** |
86
- |------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
87
- | [**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 |
89
84
 
90
- ### Advanced
91
-
92
- | **Example** | **Description** | **Lightning Studio** |
93
- |------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
94
- | [**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 |
85
+ | **Use Case** | **Description** |
86
+ |------------------------------------------------|---------------------------------------------------------------------------------------------------|
87
+ | [**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
102
97
  - **Multi-GPU supported:** Compatible with multi-GPU setups (PyTorch FSDP, DeepSpeed, DDP, etc.).
103
98
  - **Trainer Framework Integration**: [Axolotl](https://github.com/axolotl-ai-cloud/axolotl), [LLaMa-Factory](https://github.com/hiyouga/LLaMA-Factory), [SFTTrainer](https://github.com/huggingface/trl/releases/tag/v0.10.1), [Hugging Face Trainer](https://github.com/huggingface/transformers/pull/32860), [SWIFT](https://github.com/modelscope/ms-swift)
104
99
 
105
- ## Target Audiences
106
-
107
- - **Researchers**: Looking to compose models using efficient and reliable kernels for frontier experiments.
108
- - **ML Practitioners**: Focused on maximizing GPU training efficiency with optimal, high-performance kernels.
109
- - **Curious Novices**: Eager to learn how to write reliable Triton kernels to enhance training efficiency.
110
-
111
-
112
100
  ## Installation
113
101
 
114
102
  ### Dependencies
@@ -214,23 +202,6 @@ loss = loss_fn(model.weight, input, target)
214
202
  loss.backward()
215
203
  ```
216
204
 
217
-
218
- ## Structure
219
-
220
- ### Source Code
221
-
222
- - `ops/`: Core Triton operations.
223
- - `transformers/`: PyTorch `nn.Module` implementations built on Triton operations, compliant with the `transformers` API.
224
-
225
- ### Tests
226
-
227
- - `transformers/`: Correctness tests for the Triton-based layers.
228
- - `convergence/`: Patches Hugging Face models with all kernels, runs multiple iterations, and compares weights, logits, and loss layer-by-layer.
229
-
230
- ### Benchmark
231
-
232
- - `benchmark/`: Execution time and memory benchmarks compared to Hugging Face layers.
233
-
234
205
  ## APIs
235
206
 
236
207
  ### AutoModel
@@ -249,7 +220,7 @@ loss.backward()
249
220
  | Mistral | `liger_kernel.transformers.apply_liger_kernel_to_mistral` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
250
221
  | Mixtral | `liger_kernel.transformers.apply_liger_kernel_to_mixtral` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
251
222
  | Gemma1 | `liger_kernel.transformers.apply_liger_kernel_to_gemma` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
252
- | Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss |
223
+ | Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
253
224
  | Qwen2 & Qwen2.5 | `liger_kernel.transformers.apply_liger_kernel_to_qwen2` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
254
225
  | Qwen2-VL | `liger_kernel.transformers.apply_liger_kernel_to_qwen2_vl` | RMSNorm, LayerNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
255
226
  | Phi3 & Phi3.5 | `liger_kernel.transformers.apply_liger_kernel_to_phi3` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
@@ -299,54 +270,17 @@ $$\text{GeGLU}(x)=\text{GELU}(xW+b)\otimes(xV+c)$$
299
270
  - **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.
304
-
305
- ## Contributing
306
-
307
- [CONTRIBUTING GUIDE](https://github.com/linkedin/Liger-Kernel/blob/main/CONTRIBUTING.md)
308
-
309
- ## Acknowledgement
310
-
311
-
312
- ### Design
313
-
314
- - [@claire_yishan](https://twitter.com/claire_yishan) for the LOGO design
315
- - [Wave Snippets](https://www.wavesnippets.com/) for generating the animated code snippets
316
-
317
- ### Code
318
-
319
- We referenced or used the following projects:
320
-
321
-
322
-
323
- | # | Project | Description | Location | License |
324
- |---|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
325
- | 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).
276
+ - [Contributing Guidelines](https://github.com/linkedin/Liger-Kernel/blob/main/docs/CONTRIBUTING.md)
277
+ - [Acknowledgements](https://github.com/linkedin/Liger-Kernel/blob/main/docs/Acknowledgement.md)
278
+ - [License Information](https://github.com/linkedin/Liger-Kernel/blob/main/docs/License.md)
346
279
 
347
280
  ## Contact
348
281
 
349
- - For public discussion, join [our discord channel](https://discord.gg/vNBDpjhb)
282
+ - For issues, create a Github ticket in this repository
283
+ - For open discussion, join [our discord channel](https://discord.gg/gpumode)
350
284
  - For formal collaboration, send an email to byhsu@linkedin.com
351
285
 
352
286
  ## Cite this work
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "liger_kernel_nightly"
7
- version = "0.4.1.dev20241112233746"
7
+ version = "0.4.1.dev20241113011623"
8
8
  description = "Efficient Triton kernels for LLM Training"
9
9
  urls = { "Homepage" = "https://github.com/linkedin/Liger-Kernel" }
10
10
  readme = { file = "README.md", content-type = "text/markdown" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: liger_kernel_nightly
3
- Version: 0.4.1.dev20241112233746
3
+ Version: 0.4.1.dev20241113011623
4
4
  Summary: Efficient Triton kernels for LLM Training
5
5
  License: BSD 2-CLAUSE LICENSE
6
6
  Copyright 2024 LinkedIn Corporation
@@ -99,7 +99,8 @@ Requires-Dist: seaborn; extra == "dev"
99
99
 
100
100
  <details>
101
101
  <summary>Latest News 🔥</summary>
102
-
102
+
103
+ - [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!
103
104
  - [2024/10/21] We have released the tech report of Liger Kernel on Arxiv: https://arxiv.org/pdf/2410.10989
104
105
  - [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!
105
106
  - [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)
@@ -127,18 +128,12 @@ With one line of code, Liger Kernel can increase throughput by more than 20% and
127
128
 
128
129
  ## Examples
129
130
 
130
- ### Basic
131
-
132
- | **Example** | **Description** | **Lightning Studio** |
133
- |------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
134
- | [**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 |
135
- | [**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 |
136
131
 
137
- ### Advanced
138
-
139
- | **Example** | **Description** | **Lightning Studio** |
140
- |------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
141
- | [**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 |
132
+ | **Use Case** | **Description** |
133
+ |------------------------------------------------|---------------------------------------------------------------------------------------------------|
134
+ | [**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 |
135
+ | [**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 |
136
+ | [**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 | |
142
137
 
143
138
  ## Key Features
144
139
 
@@ -149,13 +144,6 @@ With one line of code, Liger Kernel can increase throughput by more than 20% and
149
144
  - **Multi-GPU supported:** Compatible with multi-GPU setups (PyTorch FSDP, DeepSpeed, DDP, etc.).
150
145
  - **Trainer Framework Integration**: [Axolotl](https://github.com/axolotl-ai-cloud/axolotl), [LLaMa-Factory](https://github.com/hiyouga/LLaMA-Factory), [SFTTrainer](https://github.com/huggingface/trl/releases/tag/v0.10.1), [Hugging Face Trainer](https://github.com/huggingface/transformers/pull/32860), [SWIFT](https://github.com/modelscope/ms-swift)
151
146
 
152
- ## Target Audiences
153
-
154
- - **Researchers**: Looking to compose models using efficient and reliable kernels for frontier experiments.
155
- - **ML Practitioners**: Focused on maximizing GPU training efficiency with optimal, high-performance kernels.
156
- - **Curious Novices**: Eager to learn how to write reliable Triton kernels to enhance training efficiency.
157
-
158
-
159
147
  ## Installation
160
148
 
161
149
  ### Dependencies
@@ -261,23 +249,6 @@ loss = loss_fn(model.weight, input, target)
261
249
  loss.backward()
262
250
  ```
263
251
 
264
-
265
- ## Structure
266
-
267
- ### Source Code
268
-
269
- - `ops/`: Core Triton operations.
270
- - `transformers/`: PyTorch `nn.Module` implementations built on Triton operations, compliant with the `transformers` API.
271
-
272
- ### Tests
273
-
274
- - `transformers/`: Correctness tests for the Triton-based layers.
275
- - `convergence/`: Patches Hugging Face models with all kernels, runs multiple iterations, and compares weights, logits, and loss layer-by-layer.
276
-
277
- ### Benchmark
278
-
279
- - `benchmark/`: Execution time and memory benchmarks compared to Hugging Face layers.
280
-
281
252
  ## APIs
282
253
 
283
254
  ### AutoModel
@@ -296,7 +267,7 @@ loss.backward()
296
267
  | Mistral | `liger_kernel.transformers.apply_liger_kernel_to_mistral` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
297
268
  | Mixtral | `liger_kernel.transformers.apply_liger_kernel_to_mixtral` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
298
269
  | Gemma1 | `liger_kernel.transformers.apply_liger_kernel_to_gemma` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
299
- | Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss |
270
+ | Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
300
271
  | Qwen2 & Qwen2.5 | `liger_kernel.transformers.apply_liger_kernel_to_qwen2` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
301
272
  | Qwen2-VL | `liger_kernel.transformers.apply_liger_kernel_to_qwen2_vl` | RMSNorm, LayerNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
302
273
  | Phi3 & Phi3.5 | `liger_kernel.transformers.apply_liger_kernel_to_phi3` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
@@ -346,54 +317,17 @@ $$\text{GeGLU}(x)=\text{GELU}(xW+b)\otimes(xV+c)$$
346
317
  - **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.
347
318
  - **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
348
319
  <!-- TODO: be more specific about batch size -->
349
- > **Note:**
350
- > 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.
351
-
352
- ## Contributing
353
-
354
- [CONTRIBUTING GUIDE](https://github.com/linkedin/Liger-Kernel/blob/main/CONTRIBUTING.md)
355
-
356
- ## Acknowledgement
357
-
358
-
359
- ### Design
360
-
361
- - [@claire_yishan](https://twitter.com/claire_yishan) for the LOGO design
362
- - [Wave Snippets](https://www.wavesnippets.com/) for generating the animated code snippets
363
-
364
- ### Code
365
-
366
- We referenced or used the following projects:
367
-
368
-
369
-
370
- | # | Project | Description | Location | License |
371
- |---|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
372
- | 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) |
373
- | 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) |
374
- | 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) |
375
- | 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 |
376
- | 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) |
377
- | 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) |
378
- | 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) |
379
- | 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) |
380
-
381
- Many thanks to the contributors to these projects for their invaluable work that helped make Liger possible.
382
-
383
- ## License
384
320
 
385
- This project is licensed under the [BSD 2-CLAUSE](https://github.com/linkedin/Liger-Kernel/blob/main/LICENSE) License (see `LICENSE` for details).
386
- It also includes components from projects licensed under:
321
+ ## Contributing, Acknowledgements, and License
387
322
 
388
- - Apache License 2.0 (see `LICENSE-APACHE-2.0` for details).
389
- - MIT License (see `LICENSE-MIT-AutoAWQ` for details).
390
- - MIT License (see `LICENSE-MIT-Efficient Cross Entropy` for details).
391
- - MIT License (see `LICENSE-MIT-llmc` for details).
392
- - MIT License (see `LICENSE-MIT-triton` for details).
323
+ - [Contributing Guidelines](https://github.com/linkedin/Liger-Kernel/blob/main/docs/CONTRIBUTING.md)
324
+ - [Acknowledgements](https://github.com/linkedin/Liger-Kernel/blob/main/docs/Acknowledgement.md)
325
+ - [License Information](https://github.com/linkedin/Liger-Kernel/blob/main/docs/License.md)
393
326
 
394
327
  ## Contact
395
328
 
396
- - For public discussion, join [our discord channel](https://discord.gg/vNBDpjhb)
329
+ - For issues, create a Github ticket in this repository
330
+ - For open discussion, join [our discord channel](https://discord.gg/gpumode)
397
331
  - For formal collaboration, send an email to byhsu@linkedin.com
398
332
 
399
333
  ## Cite this work