Skip to main content

GPU Memory Estimator for QLoRA / LoRA / Transformers

Project description

qmemcalc

Quantized Memory Calculator for Transformers (QLoRA / LoRA / full fine-tuning)

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)

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.0.tar.gz (4.4 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.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qmemcalc-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 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.0.tar.gz
Algorithm Hash digest
SHA256 e4e90a869bd453b18fedd7e6898beddc4f87a8caecb50f1e34b9353dd18f6211
MD5 6f24656b4687196e0c824171bcc1781b
BLAKE2b-256 d237a841e4e6cabc34ba77c54a7ca679659499085d97ca64833cd5bf86cf9e77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qmemcalc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 280a871132bc14de79b47084c6997a8d65481868c9143840c98f40e4f14a41fe
MD5 d3cb5d11817c7e82607926823cf9d739
BLAKE2b-256 da7f1021336cd33752df71e8513fe476052f30043ce08468e455f4d400e9538e

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