Skip to main content

Brevitas

Downloads Pytest Examples Pytest DOI

Brevitas is a PyTorch library for neural network quantization, with support for both post-training quantization (PTQ) and quantization-aware training (QAT).

Please note that Brevitas is a research project and not an official Xilinx product.

If you like this project please consider ⭐ this repo, as it is the simplest and best way to support it.

Requirements

  • Python >= 3.10
  • Pytorch >= 1.13, <= 2.13 (more recent versions would be untested).
  • Windows, Linux or macOS.
  • GPU training-time acceleration (Optional but recommended).

Installation

You can install the latest release from PyPI:

pip install brevitas

Getting Started

Brevitas currently offers quantized implementations of the most common PyTorch layers used in DNN under brevitas.nn, such as QuantConv1d, QuantConv2d, QuantConvTranspose1d, QuantConvTranspose2d, QuantMultiheadAttention, QuantRNN, QuantLSTM etc., for adoption within PTQ and/or QAT. For each one of these layers, quantization of different tensors (inputs, weights, bias, outputs, etc) can be individually tuned according to a wide range of quantization settings.

As a reference for PTQ, Brevitas provides an example user flow for ImageNet classification models under brevitas_examples.imagenet_classification.ptq that quantizes an input torchvision model using PTQ under different quantization configurations (e.g. bit-width, granularity of scale, etc).

For more info, checkout our documentation.

Cite as

If you adopt Brevitas in your work, please cite it as:

@software{brevitas,
  author       = {Franco, Giuseppe and Monteagudo-Lago, Pablo and Colbert, Ian and Pappalardo, Alessandro and Fraser, Nicholas J},
  title        = {Xilinx/brevitas},
  year         = {2026},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.3333552},
  url          = {https://doi.org/10.5281/zenodo.3333552}
}

History

  • 2026/09/23 - Release version 0.13.4, see the release notes.
  • 2026/09/18 - Release version 0.13.3, see the release notes.
  • 2026/08/28 - Release version 0.13.2, see the release notes.
  • 2026/08/25 - Release version 0.13.1, see the release notes.
  • 2026/07/14 - Release version 0.13.0, see the release notes.
  • 2025/08/28 - Release version 0.12.1, see the release notes.
  • 2025/05/09 - Release version 0.12.0, see the release notes.
  • 2024/10/10 - Release version 0.11.0, see the release notes.
  • 2024/07/23 - Minor release version 0.10.3, see the release notes.
  • 2024/02/19 - Minor release version 0.10.2, see the release notes.
  • 2024/02/15 - Minor release version 0.10.1, see the release notes.
  • 2023/12/08 - Release version 0.10.0, see the release notes.
  • 2023/04/28 - Minor release version 0.9.1, see the release notes.
  • 2023/04/21 - Release version 0.9.0, see the release notes.
  • 2023/01/10 - Release version 0.8.0, see the release notes.
  • 2021/12/13 - Release version 0.7.1, fix a bunch of issues. Added TVMCon 2021 tutorial notebook.
  • 2021/11/03 - Re-release version 0.7.0 (build 1) on PyPI to fix a packaging issue.
  • 2021/10/29 - Release version 0.7.0, see the release notes.
  • 2021/06/04 - Release version 0.6.0, see the release notes.
  • 2021/05/24 - Release version 0.5.1, fix a bunch of minor issues. See release notes.
  • 2021/05/06 - Release version 0.5.0, see the release notes.
  • 2021/03/15 - Release version 0.4.0, add support for __torch_function__ to QuantTensor.
  • 2021/03/04 - Release version 0.3.1, fix bug w/ act initialization from statistics w/ IGNORE_MISSING_KEYS=1.
  • 2021/03/01 - Release version 0.3.0, implements enum and shape solvers within extended dependency injectors. This allows declarative quantizers to be self-contained.
  • 2021/02/04 - Release version 0.2.1, includes various bugfixes of QuantTensor w/ zero-point.
  • 2021/01/30 - First release version 0.2.0 on PyPI.

Metadata

Release files for brevitas 0.13.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brevitas 0.13.4
File Size Uploaded
brevitas-0.13.4.tar.gz 840.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brevitas 0.13.4
File Interpreter ABI Platform
brevitas-0.13.4-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / brevitas-0.13.4.tar.gz

Download URL brevitas-0.13.4.tar.gz
Size 840.8 kB
Tags Source
SHA-256 checksum
How to use checksums
925099c57239a1d7e90e22653785bd221b9b9f8d05223d10434e8a13ed57f3d6
BLAKE2b-256 checksum
How to use checksums
99887cdd12cf87835b1b0689a1195157f5ff40332caa79d9459d8f7a012e5a58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release files / brevitas-0.13.4-py3-none-any.whl

Download URL brevitas-0.13.4-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
44bc191afe5fcbe2bf8a8dda7b6afcf9fe901b0c3d12d8adff337b88dc1495f4
BLAKE2b-256 checksum
How to use checksums
0db9c3d383235feff58ef1f1ddadc71d6cab5c6d1dfda71e6da0ddac7d52399e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.13.4 This release

2 release files

0.13.3

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.11.0

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

3 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page