Skip to content
Projects

GeeeekExplorer/transformers-patch has 38 GitHub stars and 6 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 15:58 UTC. Last push 2026-05-09.

How these counts are measured

What you can do

  • Memory Reduction - Significantly lowers memory usage in Transformers models
  • Zero Configuration - Works automatically after import

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

patches for huggingface transformers to save memory

Machine Learning

README.md

Original

Transformers-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 πŸ™