How pulp-platform/deepquant works
Project type and purpose
• This is a Python library (“DeepQuant”) for performing true quantization and optimization on neural networks. It hooks into PyTorch via FX tracing, manipulates the computation graph to insert quant/dequant nodes, and can export quantized networks (e.g., to Brevitas).
File structure
• Top‐level:
• .github/workflows – CI pipelines for building, testing, linting.
• Container/Dockerfile – Docker image for environment consistency.
• DeepQuant/ – the library source divided into:
– CustomTracer & CustomForwards (wrap/override PyTorch modules and activations),
– Injects (graph‐injection logic: base classes, transformation executor),
– QuantManipulation (parameter extraction, node division, dequant modification),
– ExportBrevitas (optional exporter to Brevitas),
– Utils (FX interpreter, graph printer).
• Tests/ – pytest unit tests for single layers and full models.
• pyproject.toml, setup.py – build/install configuration.
README for additional insights
• Confirms Python ≥3.11, editable install, pytest markers, library in beta.