Skip to main content

Training-dynamics-driven mixed-precision LLM quantization, with prebuilt CUDA kernels.

Project description

dynquant

Mixed-precision LLM quantization that decides bit-widths from your fine-tune's own training dynamics.

pip install dynquant
dynquant doctor

This distribution contains no code. It is the one name to install, and it pulls in:

  • dynquant-core — the Python half: signal collection hook, role classification, scoring, allocation, packing, CLI. Installs anywhere, no compiler required.
  • dynquant-kernels — prebuilt CUDA kernels, where a wheel exists for your platform. Without them everything still works on the reference backend; you lose inference speed and the VRAM saving, not correctness.

Usage

Collect signals during the fine-tune you were going to run anyway:

from transformers import Trainer
from dynquant import DynQuantCallback

trainer = Trainer(model=model, ..., callbacks=[DynQuantCallback("stats/")])
trainer.train()

Allocate and pack:

dynquant quantize ./merged --stats stats/dynquant_stats.json --target 3.0 -o ./q3

Load through plain transformers:

from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("./q3")

Full documentation: https://github.com/kambojvikram/dynquant

Extras

pip install 'dynquant[train]'     # transformers, peft, trl, datasets
pip install 'dynquant[eval]'      # lm-eval-harness
pip install 'dynquant[triton]'    # portability fallback for ROCm / newer GPUs
pip install 'dynquant[kernels]'   # force the compiled kernels (builds from sdist)

License

Apache-2.0.

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

dynquant-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

dynquant-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynquant-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dynquant-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c35c31b1df0936f51ba026a0551b4466155fdab1f480477d5809dbc5886ba289
MD5 2ad32fcd49c229dac3adcc7b8f040af3
BLAKE2b-256 8e00927c602beaddc6bb9d3ae3412848b4e7222d20d49c5ab0472aeb3b3b6ace

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynquant-0.1.1.tar.gz:

Publisher: wheels.yml on kambojvikram/dynquant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: dynquant-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dynquant-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f59e139cff8f8876e82b8de158e598920195304c6b1e39dbf0731c701d1faf8
MD5 6aee2f3dfe939b212f1c96c23ee581e3
BLAKE2b-256 5cc0a185aa28458f5a001da6af4808f8f2f9905836d390d001274e176fe66510

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynquant-0.1.1-py3-none-any.whl:

Publisher: wheels.yml on kambojvikram/dynquant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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