patches for huggingface transformers to save memory
37
stars
14
commits
Python
primary language
May 9, 2026
updated
Memory optimization patches for HuggingFace Transformers.
Memory Reduction - Significantly lowers memory usage in Transformers models
Zero Configuration - Works automatically after import
pip install git+https://github.com/GeeeekExplorer/transformers-patch.git
Just import the patch before loading any Transformers models:
import transformers_patch
from transformers import AutoModel
Test Configuration:
| 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!
See complete example in train.py.
13 commits
1 commits
Python
100.0%
patches for huggingface transformers to save memory
37
stars
14
commits
Python
primary language
May 9, 2026
updated
Memory optimization patches for HuggingFace Transformers.
Memory Reduction - Significantly lowers memory usage in Transformers models
Zero Configuration - Works automatically after import
pip install git+https://github.com/GeeeekExplorer/transformers-patch.git
Just import the patch before loading any Transformers models:
import transformers_patch
from transformers import AutoModel
Test Configuration:
| 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!
See complete example in train.py.
13 commits
1 commits
Python
100.0%