{"id":26896,"library":"diffq-fixed","title":"diffq-fixed","description":"A differentiable quantization framework for PyTorch, fixed for compatibility with Python 3.11 and newer. This library provides differentiable quantization-aware training with custom quantizers and gradient approximations. Version 0.2.4 is current; no regular release cadence.","status":"active","version":"0.2.4","language":"python","source_language":"en","source_url":"https://github.com/JackismyShephard/diffq","tags":["differentiable quantization","pytorch","quantization-aware training"],"install":[{"cmd":"pip install diffq-fixed","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core dependency; diffq builds on PyTorch tensors and autograd","package":"torch","optional":false}],"imports":[{"note":"The package name is 'diffq-fixed' but import uses 'diffq'.","wrong":"from diffq_fixed import DiffQuantizer","symbol":"DiffQuantizer","correct":"from diffq import DiffQuantizer"}],"quickstart":{"code":"import torch\nfrom diffq import DiffQuantizer\n\nmodel = torch.nn.Linear(10, 5)\nquantizer = DiffQuantizer(model, n_bits=8)\noptimizer = torch.optim.SGD(model.parameters(), lr=0.01)\n\nx = torch.randn(4, 10)\ny = model(x)\nloss = y.sum()\nloss.backward()\noptimizer.step()\nprint(\"Training step completed\")","lang":"python","description":"Initialize a DiffQuantizer wrapping a model, run a training step."},"warnings":[{"fix":"Use 'from diffq import DiffQuantizer' instead of 'from diffq_fixed import ...'","message":"Import path uses 'diffq' not 'diffq_fixed' even though the package is installed as 'diffq-fixed'.","severity":"gotcha","affected_versions":"all"},{"fix":"Re-train or re-quantize models using diffq-fixed from scratch, or check the release notes for any conversion tools.","message":"This fork may not be compatible with the original diffq's serialization format (model checkpoints). Loading checkpoints saved with original diffq could fail.","severity":"breaking","affected_versions":"0.2.4"}],"env_vars":null,"search_vec":"'0.2.4':33 '3.11':15 'approxim':31 'awar':24,45 'cadenc':39 'compat':12 'current':35 'custom':27 'differenti':5,21,40 'diffq':2 'diffq-fix':1 'fix':3,10 'framework':7 'gradient':30 'librari':19 'newer':17 'provid':20 'python':14 'pytorch':9,42 'quantiz':6,23,28,41,44 'quantization-awar':22,43 'regular':37 'releas':38 'train':25,46 'version':32","created_at":"2026-05-01T17:43:27.245468+00:00","updated_at":"2026-05-01T17:43:27.245468+00:00","problems":[{"fix":"Change import to: from diffq import DiffQuantizer","cause":"Installed the pip package 'diffq-fixed' but trying to import 'diffq_fixed' instead of 'diffq'.","error":"ModuleNotFoundError: No module named 'diffq'"},{"fix":"Ensure you pass the model to DiffQuantizer constructor: quantizer = DiffQuantizer(model, ...)","cause":"Calling forward on DiffQuantizer before initializing with the model (or calling .to_device()?).","error":"RuntimeError: Quantizer not initialized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/JackismyShephard/diffq","docs":null,"changelog":null,"pypi":"https://pypi.org/project/diffq-fixed/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}