Skip to main content

GPU Memory Estimator for QLoRA / LoRA / Transformers

Project description

qmemcalc

Quantized Memory Calculator for Transformers (QLoRA / LoRA / Full Fine-Tuning)

Estimate GPU memory requirements for training or fine-tuning transformer models with ease. Supports multiple precision types, quantization, and LoRA configurations.

PyPI Version Python Version License


Features

  • Estimate GPU memory for FP32/FP16/BF16
  • Supports 4-bit / 8-bit quantization
  • LoRA rank or fraction support
  • Extended optimizer support
  • Gradient checkpointing
  • CLI for quick estimation

Installation

pip install qmemcalc

Python API Usage

from qmemcalc import estimate_memory

result = estimate_memory(
    model_name="sshleifer/tiny-gpt2",
    batch_size=2,
    seq_len=16,
    lora_r=4,
    precision="fp16",
    quantization="4bit"
)

print(result)

Contributing

Contributions are welcome! Please open issues or submit pull requests.

git clone https://github.com/sachin62025/qmemcalc.git
cd qmemcalc
pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qmemcalc-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qmemcalc-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file qmemcalc-0.1.1.tar.gz.

File metadata

  • Download URL: qmemcalc-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for qmemcalc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 00d3cf164ad74108ba0bc7b6768288656e227d60bffdcd4824aa7c6deefad3e3
MD5 392d1d390df51eb7869966bc16fb71b1
BLAKE2b-256 c038258cbd73e03c1d9ecf9d9773247062a606ed823f9e077fb8235321a4923c

See more details on using hashes here.

File details

Details for the file qmemcalc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: qmemcalc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for qmemcalc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6230a45c31de9ff483075e5724764a1850a30ea2ab96767f1a391ff5a8c534e
MD5 058b774a6c5302f697976299141b7f05
BLAKE2b-256 2c945d2f77e3d7e2c76f13dc446c35d66ea219ab784bff87ca6b34f0da96726d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page