Skip to content

Commit

Permalink
use correct fsdp act ckpt & redo benchmark (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronHsu authored Aug 16, 2024
1 parent afe4d8c commit 8d88214
Show file tree
Hide file tree
Showing 11 changed files with 439 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

| **Example** | **Description** | **Lightning Studio** |
|------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------|
| [**Hugging Face Trainer**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/huggingface) | Increase 20% throughput and reduce memory usage by 60% with LLaMA3-8B on Alpaca dataset using 4 A100s | TBA |
| [**Hugging Face Trainer**](https://github.com/linkedin/Liger-Kernel/tree/main/examples/huggingface) | Train llama3 8B ~20% faster with over 40% memory reduction on Alpaca dataset using 4 A100s | TBA |
| [**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 | TBA |

### Advanced
Expand Down
7 changes: 6 additions & 1 deletion examples/huggingface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ sh run.sh


## Benchmark Result
![MFU](img/hf_mfu.png)

Benchmark conditions: LLaMA 3-8B, Alpaca Dataset, Max seq len = 512, Data Type = bf16, Optimizer = AdamW, Gradient Checkpointing = True, Distributed Strategy = FSDP1 on 4 A100s.

The throughput increases by approximately 20% with more data, but the GPU memory is reduced by 40%. This means you can train the model on smaller GPUs, with larger batch sizes, or with longer sequence lengths at no additional cost.

![Throughput](img/hf_tps.png)
![GPU Memory Allocated](img/hf_mem_alloc.png)
Loading

0 comments on commit 8d88214

Please sign in to comment.