$npx skillfedfor your agent

diffq

Differentiable quantization framework for PyTorch.

SkipPyPI Artificial IntelligenceReleased May 2023120.6K downloads / monon-commercial licensePlatform wheel

Decision gist · record as of 2026-08-14

platform wheels — diffq-0.2.4-cp310-cp310-macosx_10_9_universal2.whl · diffq-0.2.4-cp310-cp310-macosx_10_9_x86_64.whl · diffq-0.2.4-cp310-cp310-macosx_11_0_arm64.whl
v0.2.4 · released 2023-05-05 · Python >=3.7.0 · 3 runtime deps: Cython, numpy, torch

No. The package is abandoned (last commit 2023-05-05) and licensed under CC-BY-NC 4.0, restricting use to non-commercial purposes only. Unless you are conducting non-commercial research and can tolerate no future updates, use an actively maintained quantization library instead.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.7 or later and PyTorch 1.7.1 ideally.
  • Compiled dependencies (Cython, numpy, torch) must be installed; prebuilt wheels are available for common platforms but may not exist for all architectures.
  • Medium install friction due to compiled dependencies (Cython, numpy, torch).

License · maintenance · safety

non-commercial license (noncommercial) — Licensed under CC-BY-NC 4.0 (noncommercial), which restricts use to non-commercial purposes only. Commercial deployment or integration into proprietary products is not permitted without explicit permission.

last release 2023-05-05 (1197 days) · last repo commit 2023-05-05 · 239 stars · archived

0 known vulnerabilities (OSV.dev, 2026-08-14) · 120,635 downloads/mo, #12,015 on PyPI

Verify before relying

pip install diffq

import torch
from diffq import DiffQuantizer

model = MyModel()
optim = torch.optim.Adam(model.parameters())
quantizer = DiffQuantizer(model)
quantizer.setup_optimizer(optim)

for batch in loader:
    loss = criterion(model(x), y) + 1e-3 * quantizer.model_size()
    optim.zero_grad()
    loss.backward()
    optim.step()

torch.save(quantizer.get_quantized_state(), "model.th")
  • Whether the package remains compatible with PyTorch versions released after 2023-05-05
  • Whether TorchScript export (noted as experimental) is production-ready
  • Whether int8 in-memory support mentioned as 'coming up' was ever implemented
Same gist for agents: .md · .json

What it is and what it does

DiffQ is a PyTorch quantization framework that reduces model size by automatically determining optimal bit-widths for individual weights or weight groups during training. It uses pseudo quantization noise injection to make the quantization process differentiable, allowing the bit allocation itself to be optimized as part of the training loop alongside model weights.

The package integrates with standard PyTorch training pipelines: you attach a DiffQuantizer to your model before creating the optimizer, then add a model-size penalty term to your loss function. During training, the quantizer learns which weights need more bits and which can use fewer, trading off compression against accuracy. At inference, it automatically switches to true quantized weights, and you can export the compressed model to disk or TorchScript format.

Use it for

  • Compress large transformer or CNN models for deployment on memory-constrained devices while maintaining accuracy
  • Automatically determine per-layer or per-group bit allocations during training without manual hyperparameter tuning
  • Export quantized models to TorchScript for optimized inference with reduced memory footprint
  • Research differentiable quantization methods and compare compression-accuracy tradeoffs across architectures
  • Reduce model size for distributed training or inference in bandwidth-limited environments

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Skip

No.

The package is abandoned (last commit 2023-05-05) and licensed under CC-BY-NC 4.0, restricting use to non-commercial purposes only. Unless you are conducting non-commercial research and can tolerate no future updates, use an actively maintained quantization library instead.

Install

diffq on PyPI

Before you install

Medium install friction due to compiled dependencies (Cython, numpy, torch). The package is abandoned as of 2023-05-05 with no recent maintenance, so expect no bug fixes or compatibility updates.

Requires Python 3.7 or later and PyTorch 1.7.1 ideally. Compiled dependencies (Cython, numpy, torch) must be installed; prebuilt wheels are available for common platforms but may not exist for all architectures.

License in practice

Licensed under CC-BY-NC 4.0 (noncommercial), which restricts use to non-commercial purposes only. Commercial deployment or integration into proprietary products is not permitted without explicit permission.

Quickstart

pip install diffq

import torch
from diffq import DiffQuantizer

model = MyModel()
optim = torch.optim.Adam(model.parameters())
quantizer = DiffQuantizer(model)
quantizer.setup_optimizer(optim)

for batch in loader:
    loss = criterion(model(x), y) + 1e-3 * quantizer.model_size()
    optim.zero_grad()
    loss.backward()
    optim.step()

torch.save(quantizer.get_quantized_state(), "model.th")

Verify before relying

  • Whether the package remains compatible with PyTorch versions released after 2023-05-05
  • Whether TorchScript export (noted as experimental) is production-ready
  • Whether int8 in-memory support mentioned as 'coming up' was ever implemented

Package facts

Licensenon-commercial license noncommercial
Python supportSupports the current Python release >=3.7.0
Install frictionMedium. Platform-specific wheel
Runtime dependencies
3 packages
Cythonnumpytorch
MaintenanceAbandoned 1,197 days since the last release
Last repo commit repository archived
First released
Downloads120,635 / month, #12,015 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Topic :: Scientific/Engineering :: Artificial Intelligence

Evidence: diffq-0.2.4-cp310-cp310-macosx_10_9_universal2.whl; diffq-0.2.4-cp310-cp310-macosx_10_9_x86_64.whl; diffq-0.2.4-cp310-cp310-macosx_11_0_arm64.whl; diffq-0.2.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl; diffq-0.2.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl; diffq-0.2.4-cp310-cp310-win32.whl; diffq-0.2.4-cp310-cp310-win_amd64.whl; diffq-0.2.4-cp37-cp37m-macosx_10_9_x86_64.whl; diffq-0.2.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl; diffq-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl; diffq-0.2.4-cp37-cp37m-win32.whl; diffq-0.2.4-cp37-cp37m-win_amd64.whl; diffq-0.2.4-cp38-cp38-macosx_10_9_universal2.whl; diffq-0.2.4-cp38-cp38-macosx_10_9_x86_64.whl; diffq-0.2.4-cp38-cp38-macosx_11_0_arm64.whl; diffq-0.2.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl; diffq-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl; diffq-0.2.4-cp38-cp38-win32.whl; diffq-0.2.4-cp38-cp38-win_amd64.whl; diffq-0.2.4-cp39-cp39-macosx_10_9_universal2.whl

Tags

Capabilities
pytorch model quantizationdifferentiable quantizationmodel compression bitsneural network weight quantizationautomatic bit allocationpseudo quantization noisemodel size optimization
Topics
model-compressionquantizationabandoned

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “differentiable quantization”

  • diffqDiffQ performs differentiable quantization of PyTorch models using…
  • juliusJulius provides differentiable, GPU-accelerated digital signal…
  • tensorflow-graphicsTensorFlow Graphics provides differentiable graphics and geometry…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also optimum-quanto · ai-edge-quantizer · vector-quantize-pytorch · qonnx · aqtp · nvidia-modelopt · model-compression-toolkit · torchao · auto-gptq · qwix