neuroquant 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neuroquant/__init__.py +95 -0
- neuroquant/cli.py +3471 -0
- neuroquant/config.py +1050 -0
- neuroquant/data/__init__.py +1 -0
- neuroquant/data/data_loader.py +764 -0
- neuroquant/models/__init__.py +1 -0
- neuroquant/models/model_loader.py +602 -0
- neuroquant/py.typed +0 -0
- neuroquant/quantization/__init__.py +57 -0
- neuroquant/quantization/_default_config.yaml +206 -0
- neuroquant/quantization/adaround.py +1075 -0
- neuroquant/quantization/alpha_search.py +312 -0
- neuroquant/quantization/awq.py +646 -0
- neuroquant/quantization/base.py +289 -0
- neuroquant/quantization/bn_folding.py +194 -0
- neuroquant/quantization/gptq.py +261 -0
- neuroquant/quantization/hessian_clustering.py +731 -0
- neuroquant/quantization/latency_lut.py +368 -0
- neuroquant/quantization/nsga_ii_search.py +1255 -0
- neuroquant/quantization/ptq.py +684 -0
- neuroquant/quantization/qat.py +739 -0
- neuroquant/quantization/smoothquant.py +698 -0
- neuroquant/quantization/smoothquant_gptq.py +142 -0
- neuroquant/quantization/surrogate.py +291 -0
- neuroquant/tracking/__init__.py +1 -0
- neuroquant/tracking/mlflow_logger.py +267 -0
- neuroquant/utils/__init__.py +1 -0
- neuroquant/utils/checkpointing.py +469 -0
- neuroquant/utils/common.py +227 -0
- neuroquant/utils/deployment_export.py +322 -0
- neuroquant/utils/metrics.py +295 -0
- neuroquant/utils/numerics.py +88 -0
- neuroquant/utils/onnx_export.py +522 -0
- neuroquant/visualization/__init__.py +61 -0
- neuroquant/visualization/error_attribution.py +403 -0
- neuroquant/visualization/pareto_analysis.py +1158 -0
- neuroquant/visualization/report.py +452 -0
- neuroquant/visualization/sensitivity.py +244 -0
- neuroquant/visualization/style.py +144 -0
- neuroquant/xai/__init__.py +1 -0
- neuroquant/xai/explainability.py +1299 -0
- neuroquant-2.0.0.dist-info/METADATA +248 -0
- neuroquant-2.0.0.dist-info/RECORD +47 -0
- neuroquant-2.0.0.dist-info/WHEEL +5 -0
- neuroquant-2.0.0.dist-info/entry_points.txt +2 -0
- neuroquant-2.0.0.dist-info/licenses/LICENSE +21 -0
- neuroquant-2.0.0.dist-info/top_level.txt +1 -0
neuroquant/__init__.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NeuroQuant — production-grade neural-network quantization framework.
|
|
3
|
+
|
|
4
|
+
Public API for library users::
|
|
5
|
+
|
|
6
|
+
from neuroquant import (
|
|
7
|
+
# Quantizers (notebook / library use)
|
|
8
|
+
PTQQuantizer, AWQQuantizer, GPTQQuantizer,
|
|
9
|
+
SmoothQuantQuantizer, SmoothQuantGPTQQuantizer,
|
|
10
|
+
QATTrainer, AdaroundOptimizer,
|
|
11
|
+
# Multi-objective search + clustering + surrogate
|
|
12
|
+
NSGAIIClusterSearch, LayerClusterer, AccuracySurrogate,
|
|
13
|
+
# Configuration object (every quantizer accepts ``config=None``
|
|
14
|
+
# and falls back to ``QuantizationConfig()`` defaults)
|
|
15
|
+
QuantizationConfig,
|
|
16
|
+
# Explainability + Pareto visualization
|
|
17
|
+
XAIGenerator, ParetoAnalyzer, ParetoVisualizer,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
The ``neuroquant`` command-line entry point lives in
|
|
21
|
+
:mod:`neuroquant.cli` and is exposed via ``[project.scripts]`` in
|
|
22
|
+
``pyproject.toml``. Library users normally do not need to import it
|
|
23
|
+
directly — instantiate :class:`PTQQuantizer` (etc.) and drive the
|
|
24
|
+
pipeline themselves.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
__version__ = "2.0.0"
|
|
30
|
+
|
|
31
|
+
# Re-export the configuration dataclass first because every other
|
|
32
|
+
# public symbol depends on it (directly or transitively).
|
|
33
|
+
from neuroquant.config import QuantizationConfig
|
|
34
|
+
|
|
35
|
+
# Quantizers and the search / clustering / surrogate trio. The
|
|
36
|
+
# subpackage __init__ already curates these — re-export from there so
|
|
37
|
+
# any future additions land in one place.
|
|
38
|
+
from neuroquant.quantization import (
|
|
39
|
+
BaseQuantizer,
|
|
40
|
+
PTQQuantizer,
|
|
41
|
+
AWQQuantizer,
|
|
42
|
+
GPTQQuantizer,
|
|
43
|
+
SmoothQuantQuantizer,
|
|
44
|
+
SmoothQuantGPTQQuantizer,
|
|
45
|
+
AdaroundOptimizer,
|
|
46
|
+
QATTrainer,
|
|
47
|
+
NSGAIIClusterSearch,
|
|
48
|
+
LayerClusterer,
|
|
49
|
+
AccuracySurrogate,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Visualization surface (Pareto + plot helpers). ``XAIGenerator`` is
|
|
53
|
+
# re-exported from the visualization package via a guarded import so
|
|
54
|
+
# users who skipped the optional ``xai`` extras (shap / captum) don't
|
|
55
|
+
# crash at ``import neuroquant``.
|
|
56
|
+
from neuroquant.visualization import (
|
|
57
|
+
ParetoAnalyzer,
|
|
58
|
+
ParetoVisualizer,
|
|
59
|
+
XAIGenerator,
|
|
60
|
+
compute_layer_errors,
|
|
61
|
+
plot_error_attribution,
|
|
62
|
+
plot_error_comparison,
|
|
63
|
+
plot_sensitivity_heatmap,
|
|
64
|
+
plot_tier_distribution,
|
|
65
|
+
generate_html_report,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
__all__ = [
|
|
69
|
+
"__version__",
|
|
70
|
+
# Configuration
|
|
71
|
+
"QuantizationConfig",
|
|
72
|
+
# Quantizers
|
|
73
|
+
"BaseQuantizer",
|
|
74
|
+
"PTQQuantizer",
|
|
75
|
+
"AWQQuantizer",
|
|
76
|
+
"GPTQQuantizer",
|
|
77
|
+
"SmoothQuantQuantizer",
|
|
78
|
+
"SmoothQuantGPTQQuantizer",
|
|
79
|
+
"AdaroundOptimizer",
|
|
80
|
+
"QATTrainer",
|
|
81
|
+
# Search / clustering / surrogate
|
|
82
|
+
"NSGAIIClusterSearch",
|
|
83
|
+
"LayerClusterer",
|
|
84
|
+
"AccuracySurrogate",
|
|
85
|
+
# Visualization
|
|
86
|
+
"ParetoAnalyzer",
|
|
87
|
+
"ParetoVisualizer",
|
|
88
|
+
"XAIGenerator",
|
|
89
|
+
"compute_layer_errors",
|
|
90
|
+
"plot_error_attribution",
|
|
91
|
+
"plot_error_comparison",
|
|
92
|
+
"plot_sensitivity_heatmap",
|
|
93
|
+
"plot_tier_distribution",
|
|
94
|
+
"generate_html_report",
|
|
95
|
+
]
|