Skip to main content

QSPARSE

License: MIT

QSPARSE provides the open source implementation of the quantization and pruning methods proposed in Learning Low-Precision Structured Subnetworks Using Joint Layerwise Channel Pruning and Uniform Quantization. This library was developed to support and demonstrate strong performance and flexibility among various experiments.

Full Precision Joint Quantization 4bit and Channel Pruning 75%
import torch.nn as nn
net = nn.Sequential(
    nn.Conv2d(3, 32, 5),
    nn.ReLU(),
    nn.ConvTranspose2d(32, 3, 5, stride=2)
)
import torch.nn as nn
from qsparse import prune, quantize, convert
net = nn.Sequential(
    quantize(nn.Conv2d(3, 32, 5), bits=4), 
    nn.ReLU(),
    prune(sparsity=0.75, dimensions={1}), 
    quantize(bits=8),  
    quantize(nn.ConvTranspose2d(32, 3, 5, stride=2), bits=4)
)
# Automatic conversion is available via `convert`.
# Please refer to documentation for more details.

Installation

QSPARSE can be installed from PyPI:

pip install qsparse

Usage

Documentation can be accessed from Read the Docs.

Examples of applying QSPARSE to different tasks are provided at examples and mdpi2022.

Citing

If you find this open source release useful, please reference in your paper:

Zhang, X.; Colbert, I.; Das, S. Learning Low-Precision Structured Subnetworks Using Joint Layerwise Channel Pruning and Uniform Quantization. Appl. Sci. 2022, 12, 7829. https://doi.org/10.3390/app12157829

@Article{app12157829,
	AUTHOR = {Zhang, Xinyu and Colbert, Ian and Das, Srinjoy},
	TITLE = {Learning Low-Precision Structured Subnetworks Using Joint Layerwise Channel Pruning and Uniform Quantization},
	JOURNAL = {Applied Sciences},
	VOLUME = {12},
	YEAR = {2022},
	NUMBER = {15},
	ARTICLE-NUMBER = {7829},
	URL = {https://www.mdpi.com/2076-3417/12/15/7829},
	ISSN = {2076-3417}
}

Metadata

Release files for qsparse 2.0.1

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

Source distribution (sdist)

Source distribution for qsparse 2.0.1
File Size Uploaded
qsparse-2.0.1.tar.gz 97.5 kB Details

Release files / qsparse-2.0.1.tar.gz

Download URL qsparse-2.0.1.tar.gz
Size 97.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4c597b525347f7c13fdb97f36d8fd0f4fd18111d86868d2f7f516fc703ce9689
BLAKE2b-256 checksum
How to use checksums
c5bbde1f84ea41a5fe08deddcf672bde073cf3db73a071296058e324c5ab1d18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file

2.0.0

1 release file

1.2.11

1 release file

1.2.10

1 release file

1.2.9

1 release file

1.2.8

1 release file

1.2.7

1 release file

1.2.6

1 release file

1.2.5

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

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