Proyek
Lihat di GitHub
GeeeekExplorer/transformers-patch
Tentang
patches for huggingface transformers to save memory
AI dan pembelajaran mesinYang dapat Anda lakukan
- Memory Reduction - Significantly lowers memory usage in Transformers models
- Zero Configuration - Works automatically after import
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- +1
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliTransformers-Patch π οΈ
Memory optimization patches for HuggingFace Transformers.
Features β¨
Memory Reduction - Significantly lowers memory usage in Transformers models
Zero Configuration - Works automatically after import
Installation β‘
pip install git+https://github.com/GeeeekExplorer/transformers-patch.git
Quick Start π
Just import the patch before loading any Transformers models:
import transformers_patch
from transformers import AutoModel
Benchmark π
Test Configuration:
- 8x GPU machine
- Micro batch size: 1
- Sequence length: 4096
- Gradient checkpointing: Disabled
- Model: Qwen3-8B
| Memory Component | Fixed Allocation | Before Patch | After Patch |
|---|---|---|---|
| Model + Gradients | 30.5 GB | - | - |
| ZeRO Optimizer States | 11.4 GB | - | - |
| Activations | - | 35.4 GB | 17.8 GB |
50% reduction in activation memory!
Example Usage π
See complete example in train.py.
Acknowledgements π
Jelajahi proyek terkait
Memuatβ¦