# Brevitas

A PyTorch research library for neural network quantization, supporting both post-training quantization and quantization-aware training for common layer types.

Brevitas is a PyTorch library for neural network quantization, supporting both post-training quantization and quantization-aware training. It provides quantized implementations of common PyTorch layers, such as convolutional, transposed-convolutional, multi-head attention, RNN and LSTM layers, and lets a user tune the quantization of different tensors, including inputs, weights, biases and outputs, independently for each layer.

As a reference workflow, it includes an example ImageNet classification flow that quantizes a torchvision model using post-training quantization under several configurations, such as different bit widths and scale granularities. It requires Python 3.10 or later and PyTorch between versions 1.13 and 2.13, runs on Windows, Linux or macOS, and installs from PyPI. The project explicitly describes itself as a research project rather than an official Xilinx product.

Website: https://xilinx.github.io/brevitas/
