tico 0.4.0.dev261027__tar.gz → 0.4.0.dev261028__tar.gz
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.
Potentially problematic release.
This version of tico might be problematic. Click here for more details.
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/PKG-INFO +2 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/README.md +1 -1
- tico-0.4.0.dev261028/tico/_version.py +1 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/discrete_refinement.py +24 -33
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/global_refinement.py +8 -23
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/joint.py +30 -24
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/rounding.py +4 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/multistart.py +17 -35
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/observer.py +22 -14
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/evaluate.py +3 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/export.py +3 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/insert_quantize_on_dtype_mismatch.py +47 -6
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/public_interface.py +20 -9
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/cpu_static_cache.py +3 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/cpu_validation.py +6 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/export_regression.py +30 -25
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/cases/gemma4.py +2 -4
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/cases/qwen3_vl.py +5 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/circle.py +6 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/gemma4.py +10 -11
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/gemma4_assistant.py +12 -7
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/qwen3_vl.py +10 -7
- tico-0.4.0.dev261028/tico/quantization/wrapq/lifecycle.py +384 -0
- tico-0.4.0.dev261028/tico/quantization/wrapq/observers/affine_base.py +592 -0
- tico-0.4.0.dev261028/tico/quantization/wrapq/observers/base.py +444 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/observers/ema.py +3 -0
- tico-0.4.0.dev261028/tico/quantization/wrapq/observers/identity.py +66 -0
- tico-0.4.0.dev261028/tico/quantization/wrapq/observers/mx.py +105 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/observers/percentile.py +34 -9
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/quantizer.py +6 -15
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/check_missing_qparam.py +4 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/introspection.py +19 -8
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/static_export.py +89 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder_layer.py +8 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/quant_mha.py +17 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/export_adapters.py +96 -4
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/ple_embedding_host.py +18 -9
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_for_causal_lm.py +2 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_for_conditional_generation.py +2 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_model.py +36 -4
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_rmsnorm.py +3 -4
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_text_attention.py +101 -215
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_text_model.py +25 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_text_scaled_word_embedding.py +13 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder.py +3 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_model.py +5 -6
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_patch_embedder.py +4 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_pooler.py +41 -22
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/vision_split_export.py +33 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/quant_for_causal_lm.py +32 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/export_adapters.py +17 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/quant_attention.py +16 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/quant_decoder_layer.py +3 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/quant_model.py +17 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/quant_model_for_causal_lm.py +8 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_conv2d.py +2 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_conv3d.py +2 -10
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_conv3d_decomposed.py +46 -18
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_conv_transpose2d.py +2 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_embedding.py +9 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_layernorm.py +8 -9
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_linear.py +13 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_prelu.py +2 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/ops/quant_rmsnorm.py +2 -3
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/ptq_wrapper.py +12 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/quant_module_base.py +185 -38
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/export_adapters.py +37 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_model.py +11 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_attention.py +16 -51
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_decoder_layer.py +2 -1
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_model.py +21 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_attention.py +0 -4
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_model.py +19 -18
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico.egg-info/PKG-INFO +2 -2
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico.egg-info/SOURCES.txt +1 -0
- tico-0.4.0.dev261027/tico/_version.py +0 -1
- tico-0.4.0.dev261027/tico/quantization/wrapq/observers/affine_base.py +0 -199
- tico-0.4.0.dev261027/tico/quantization/wrapq/observers/base.py +0 -113
- tico-0.4.0.dev261027/tico/quantization/wrapq/observers/identity.py +0 -75
- tico-0.4.0.dev261027/tico/quantization/wrapq/observers/mx.py +0 -62
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/LICENSE +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/pyproject.toml +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/setup.cfg +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/_buffer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/_object.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/_schema.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/analysis/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/analysis/effects.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/analysis/purity.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/analysis/structural_hash.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/analysis/tensor_contract.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/builder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/cli/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/cli/__main__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/cli/main.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/document.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/errors.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/export.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/graph.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/inspect/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/inspect/printer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/inspect/summary.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/io.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/mutation.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/operations/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/operations/extract.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/cleanup/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/cleanup/compact_indices.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/cleanup/dead_code_elimination.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/cleanup/graph_inputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/manager.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/_pattern_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/canonicalize/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/canonicalize/equivalent_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/compatibility/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/compatibility/custom_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/compatibility/fc_gelu_fc.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/cse.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/constant_subgraph.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/evaluators/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/evaluators/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/evaluators/elementwise.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/evaluators/heavy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/evaluators/indexing.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/evaluators/shape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fold/profiles.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fuse/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fuse/activation.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fuse/composite.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fuse/linear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fuse/requantize.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/fuse/spatial.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/legalize/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/legalize/dynamic_fully_connected.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/policy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/_layout_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/arithmetic.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/identity_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/reductions.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/transpose_region.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/transpose_region_rules.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/optimization/simplify/views.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/presets.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/rules.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/passes/worklist.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/rewrite.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/errors.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/executor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/elementwise.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/nn.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/quantize.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/reduction.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/kernels/shape_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/program.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/runtime/quantization.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/selector.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/session.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/value/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/value/codec.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/value/dtype.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/value/tensor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/circle/verify.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/config/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/config/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/config/factory.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/config/v1.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/experimental/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/interpreter/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/interpreter/backends.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/interpreter/infer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/interpreter/interpreter.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/ops/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/ops/concat.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/ops/resize_bilinear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/ops/same_padding_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/cast_aten_where_arg_type.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/cast_clamp_mixed_type_args.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/cast_mixed_type_args.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/const_prop_pass.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_conv1d_to_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_conv3d_to_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_expand_to_slice_cat.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_gather_to_gather_nd.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_layout_op_to_reshape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_matmul_to_linear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_repeat_to_expand_copy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_sym_size_to_circle_shape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/convert_to_relu6.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_addmm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_batch_norm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_fake_quantize.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_fake_quantize_tensor_qparams.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_group_norm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_grouped_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/decompose_slice_scatter.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/eliminate_rank_round_trip_region.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/extract_dtype_kwargs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/fill_meta_val.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/fuse_leading_unsqueeze_reshape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/fuse_redundant_reshape_to_mean.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/legalize_causal_mask_value.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/legalize_predefined_layout_operators.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/lower_copy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/lower_multi_index_to_gather_nd.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/lower_pow2_to_mul.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/lower_to_resize_nearest_neighbor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/lower_to_slice.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/merge_consecutive_cat.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_empty_cat_inputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_nop.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_redundant_assert_nodes.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_redundant_expand.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_redundant_permute.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_redundant_reshape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_redundant_slice.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_redundant_to_copy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/remove_unused_placeholder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/restore_linear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/passes/segment_index_select.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/pt2_to_circle.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/joint_runner.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/runner.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/screened_refinement.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/cache.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/qdrop.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/runner.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/block_reconstruction/selection.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/cle/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/cle/cle.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/cle/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/fpi_gptq/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/fpi_gptq/fpi_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/fpi_gptq/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/fpi_gptq/util.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gemma4_gptq/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gemma4_gptq/gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gemma4_gptq/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gemma4_gptq/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gptq/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gptq/gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gptq/quant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gptq/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/gptq/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/qwen3_vl_gptq/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/qwen3_vl_gptq/gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/qwen3_vl_gptq/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/qwen3_vl_gptq/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/smoothquant/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/smoothquant/observer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/smoothquant/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/smoothquant/smooth_quant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/fuse_norm_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/hadamard_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/qwen3_vl_model_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/qwen3_vl_quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/qwen3_vl_rotation_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/rotation_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/spin_llama.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/spinquant/spin_qwen3_vl.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/universal_gptq/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/ablation.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/clipping.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/inputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/metrics.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/output_quantization.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/outputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/profile.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/report.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/selector.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/analysis/sensitivity.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/builders.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/cle.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/fpi_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/gemma4_assistant_builders.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/gemma4_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/gemma4_builders.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/gemma4_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/llama_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/ptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/qwen3_vl_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/qwen3_vl_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/qwen3_vl_spinquant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/smoothquant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/specs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/spinquant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/config/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/backend.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/evaluate.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/executor/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/executor/backend_executor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/executor/circle_executor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/executor/triv24_executor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/hellaswag_eval_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/llava_bench_judge_eval_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/lmms_eval_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/lmms_gemma4.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/lmms_tasks/videomme_mini/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/metric.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/mmlu_eval_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/mmmu_eval_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/optional_deps.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/script/llm_tasks_eval.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/script/mini_vqa_eval.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/vlm_eval_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/evaluation/vlm_generation_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/compare_side_by_side.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/configs/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/generate.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/inspector.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/examples/quantize.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/concat_qparam.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/fold_quant_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/legalize_quantized_clamp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/mx_qparam.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/propagate_qparam_backward.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/propagate_qparam_forward.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/qparam_safe_const_prop.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/quantize_bias.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/passes/remove_weight_dequant_op.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/quant_stub.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/quantizer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/quantizer_registry.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/adapters/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/adapters/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/adapters/gemma4.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/adapters/gemma4_assistant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/adapters/llama.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/adapters/qwen3_vl.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/config.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/context.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/data/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/data/dataset_config.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/data/dataset_usage.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/data/llm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/data/vlm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/cpu_fixtures.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/static_gemma4_assistant_runtime.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/static_gemma4_runtime.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/static_llama_runtime.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/static_qwen3_vl_runtime.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/tied_embedding.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/token_mask.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/trace.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/verify_llama_rope.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/case.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/cases/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/cases/gemma4_assistant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/cases/llama.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/cases/nn.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/registry.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/result.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/runner.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/debug/wrapper_smoke/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/eager.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/hellaswag.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/llava_bench.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/llava_bench_judge.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/llm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/mmlu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/mmmu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/selection.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/video_mme.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/evaluation/vlm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/checkpoint.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/llama.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/export/llama_bundle.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/extensions.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/override_policies.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/qparams.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/runner.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/runtime/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/runtime/llama.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/sequence_length.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/base.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/cle.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/ptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/smoothquant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/stages/spinquant.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/recipes/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/control.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/dtypes.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/compare_ppl.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/debug_quant_outputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/evaluate_fk_llama_model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_for_causal_lm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_for_conditional_generation.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_multimodal_embedder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_text_scaled_word_embedding.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_vision_model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_vision_patch_embedder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/gemma4/quantize_vision_pooler.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/llama/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/llama/quantize_attention_decode.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/llama/quantize_attention_prefill.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_decode.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_prefill.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/llama/quantize_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/nn/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/nn/quantize_conv3d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/nn/quantize_conv3d_special_case.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/nn/quantize_layernorm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/nn/quantize_linear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/nn/quantize_tied_embedding.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/quantize_full_qmodel_with_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/quantize_qwen3_vl_with_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/quantize_with_gptq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_for_conditional_generation.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_text_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_text_decoder_layer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_text_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_text_model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_vision_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_vision_block.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_vision_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_vision_model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_embed.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_merger.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/qwen/trace_qwen.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/examples/static_llama_layer_runtime.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/mode.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/observers/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/observers/minmax.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/qscheme.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/linear_folding.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/metrics.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/reduce_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/utils/version.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrap_helper.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/decoder_export_single_step.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder_layer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/embedding_scale_fusion.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_clippable_linear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_multimodal_embedder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_text_decoder_layer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_text_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder_layer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/rope.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/static_vision_profile.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/export_adapters.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/quant_backbone.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/quant_masked_embedder.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/sparse_head.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/static_inputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/gemma4_assistant/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/position.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/quant_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/llama/static_inputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_maxpool2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/nn/quant_silu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/ops/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/ops/quant_concat.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/ops/quant_resize_bilinear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/ops/quant_same_padding_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/quant_elementwise.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/quant_stub.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_for_conditional_generation.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_block.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_mlp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_embed.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_merger.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/static_inputs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/qwen_vl/vision_profile.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/wrapq/wrappers/registry.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/circle_binary.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/circle_graph.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/circle_mapping.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/circle_serializer.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/adapters/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/adapters/llama_rmsnorm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/adapters/onert/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/adapters/onert/llama_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/hashable_opcode.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/node_visitor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_abs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_add.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_alias_copy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_any.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_arange_start_step.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_argmax.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_attention.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_avg_pool2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_bitwise_and.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_bmm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_cat.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_circle_gather_nd.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_circle_shape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_clamp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_clone.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_constant_pad_nd.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_cos.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_cumsum.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_depthwise_conv2d.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_dequantize_per_channel.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_dequantize_per_tensor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_div.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_elu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_embedding.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_eq.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_exp.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_expand.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_full.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_full_like.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_ge.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_gelu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_gt.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_index.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_index_select.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_instance_norm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_le.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_leaky_relu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_linear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_log.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_log1p.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_logical_and.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_logical_not.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_lt.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_max_dim.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_max_pool2d_with_indices.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_maximum.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_mean.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_minimum.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_mm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_mul.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_ne.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_neg.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_permute.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_pow.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_prelu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_quantize_per_tensor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_reciprocal.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_relu.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_relu6.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_repeat.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_reshape.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_resize_bilinear.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_resize_nearest_neighbor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_rmsnorm.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_round.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_rsqrt.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_scalar_tensor.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_select_copy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_sigmoid.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_sin.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_slice.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_softmax.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_split_with_sizes.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_sqrt.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_squeeze.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_sub.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_sum.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_tanh.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_to_copy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_transpose_conv.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_unsqueeze.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_view.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/op_where.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/operators/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/pack.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/serialize/quant_param.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/compat/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/compat/torch.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/compat/torch_version_policy.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/compat/transformers.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/convert.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/define.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/diff_graph.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/dtype.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/errors.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/graph.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/installed_packages.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/logging.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/model.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/mx/__init__.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/mx/dtypes.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/mx/elemwise_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/mx/formats.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/mx/mx_ops.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/padding.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/passes.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/pytree_utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/record_input.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/register_custom_op.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/serialize.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/signature.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/trace_decorators.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/utils.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/validate_args_kwargs.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/utils/version.py +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico.egg-info/dependency_links.txt +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico.egg-info/entry_points.txt +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico.egg-info/requires.txt +0 -0
- {tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tico
|
|
3
|
-
Version: 0.4.0.
|
|
3
|
+
Version: 0.4.0.dev261028
|
|
4
4
|
Summary: Convert Exported Torch Module To Circle
|
|
5
5
|
License: This file provides full text of licenses used in this project
|
|
6
6
|
|
|
@@ -382,7 +382,7 @@ prepared_model = prepare(model.eval(), GPTQConfig())
|
|
|
382
382
|
for d in dataset: # calibration
|
|
383
383
|
prepared_model(d)
|
|
384
384
|
|
|
385
|
-
quantized_model = convert(prepared_model
|
|
385
|
+
quantized_model = convert(prepared_model)
|
|
386
386
|
```
|
|
387
387
|
|
|
388
388
|
- [Quantization overview](./tico/quantization/README.md) — API, architecture, and how to add a new algorithm
|
|
@@ -126,7 +126,7 @@ prepared_model = prepare(model.eval(), GPTQConfig())
|
|
|
126
126
|
for d in dataset: # calibration
|
|
127
127
|
prepared_model(d)
|
|
128
128
|
|
|
129
|
-
quantized_model = convert(prepared_model
|
|
129
|
+
quantized_model = convert(prepared_model)
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
- [Quantization overview](./tico/quantization/README.md) — API, architecture, and how to add a new algorithm
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.0.dev261028"
|
|
@@ -54,7 +54,7 @@ from tico.quantization.wrapq.control import (
|
|
|
54
54
|
SiteRole,
|
|
55
55
|
)
|
|
56
56
|
from tico.quantization.wrapq.observers.affine_base import AffineObserverBase
|
|
57
|
-
from tico.quantization.wrapq.observers.base import ObserverBase
|
|
57
|
+
from tico.quantization.wrapq.observers.base import FrozenObserverState, ObserverBase
|
|
58
58
|
|
|
59
59
|
MetricsEvaluator = Callable[[], OutputMetrics]
|
|
60
60
|
ProgressCallback = Callable[["DiscreteCodeRoundResult"], None]
|
|
@@ -470,7 +470,9 @@ class FixedScaleCodeObserver(ObserverBase):
|
|
|
470
470
|
raise ValueError("Discrete Conv refinement expects channel_axis=0.")
|
|
471
471
|
self.enabled = bool(original.enabled)
|
|
472
472
|
self.fake_quant_enabled = bool(original.fake_quant_enabled)
|
|
473
|
-
|
|
473
|
+
initial_state = original.require_frozen()
|
|
474
|
+
scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
475
|
+
assert scale is not None and zero_point is not None
|
|
474
476
|
source = reference_weight.detach().to(
|
|
475
477
|
device=checkpoint_effective_weight.device,
|
|
476
478
|
dtype=checkpoint_effective_weight.dtype,
|
|
@@ -532,6 +534,19 @@ class FixedScaleCodeObserver(ObserverBase):
|
|
|
532
534
|
def compute_qparams(self):
|
|
533
535
|
return self._fixed_scale, self._fixed_zero_point
|
|
534
536
|
|
|
537
|
+
def derive_candidate(self):
|
|
538
|
+
raise RuntimeError(
|
|
539
|
+
"Finalize discrete refinement into its original observer before freezing or export."
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
def get_extra_state(self):
|
|
543
|
+
raise RuntimeError(
|
|
544
|
+
"Finalize discrete refinement before saving deployment state; use its optimization snapshot APIs for checkpoints."
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
def validate_loaded_state(self) -> None:
|
|
548
|
+
self.derive_candidate()
|
|
549
|
+
|
|
535
550
|
def fake_quant(self, x: torch.Tensor) -> torch.Tensor:
|
|
536
551
|
if not self.fake_quant_enabled:
|
|
537
552
|
return x
|
|
@@ -611,11 +626,7 @@ class _DiscreteBinding:
|
|
|
611
626
|
weight_module: nn.Conv2d
|
|
612
627
|
original_observer: AffineObserverBase
|
|
613
628
|
entry_weight: torch.Tensor
|
|
614
|
-
|
|
615
|
-
entry_zero_point: torch.Tensor
|
|
616
|
-
entry_qparams_locked: bool
|
|
617
|
-
entry_enabled: bool
|
|
618
|
-
entry_fake_quant_enabled: bool
|
|
629
|
+
entry_state: FrozenObserverState
|
|
619
630
|
proxy: FixedScaleCodeObserver
|
|
620
631
|
|
|
621
632
|
|
|
@@ -906,16 +917,7 @@ class DiscreteCodeWeightSet:
|
|
|
906
917
|
binding.proxy.effective_weight.detach()
|
|
907
918
|
)
|
|
908
919
|
for binding in self.bindings:
|
|
909
|
-
|
|
910
|
-
binding.original_observer.load_qparams(
|
|
911
|
-
binding.entry_scale.to(device=device),
|
|
912
|
-
binding.entry_zero_point.to(device=device),
|
|
913
|
-
lock=True,
|
|
914
|
-
)
|
|
915
|
-
binding.original_observer.enabled = binding.entry_enabled
|
|
916
|
-
binding.original_observer.fake_quant_enabled = (
|
|
917
|
-
binding.entry_fake_quant_enabled
|
|
918
|
-
)
|
|
920
|
+
binding.original_observer.install_candidate(binding.entry_state)
|
|
919
921
|
self._restore_observers()
|
|
920
922
|
except Exception:
|
|
921
923
|
self._restore_entry_state()
|
|
@@ -993,16 +995,7 @@ class DiscreteCodeWeightSet:
|
|
|
993
995
|
for binding in self.bindings:
|
|
994
996
|
binding.weight_module.weight.copy_(binding.entry_weight)
|
|
995
997
|
for binding in self.bindings:
|
|
996
|
-
|
|
997
|
-
binding.original_observer.load_qparams(
|
|
998
|
-
binding.entry_scale.to(device=device),
|
|
999
|
-
binding.entry_zero_point.to(device=device),
|
|
1000
|
-
lock=binding.entry_qparams_locked,
|
|
1001
|
-
)
|
|
1002
|
-
binding.original_observer.enabled = binding.entry_enabled
|
|
1003
|
-
binding.original_observer.fake_quant_enabled = (
|
|
1004
|
-
binding.entry_fake_quant_enabled
|
|
1005
|
-
)
|
|
998
|
+
binding.original_observer.install_candidate(binding.entry_state)
|
|
1006
999
|
self._restore_observers()
|
|
1007
1000
|
|
|
1008
1001
|
def _restore_observers(self) -> None:
|
|
@@ -1451,7 +1444,9 @@ def _build_binding(
|
|
|
1451
1444
|
f"FP source shape mismatch at {site.path!r}: "
|
|
1452
1445
|
f"{tuple(source.shape)} != {tuple(weight_module.weight.shape)}."
|
|
1453
1446
|
)
|
|
1454
|
-
|
|
1447
|
+
initial_state = site.observer.require_frozen()
|
|
1448
|
+
scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
1449
|
+
assert scale is not None and zero_point is not None
|
|
1455
1450
|
entry_weight = weight_module.weight.detach().clone()
|
|
1456
1451
|
with torch.no_grad():
|
|
1457
1452
|
checkpoint_effective_weight = site.observer.fake_quant(entry_weight)
|
|
@@ -1471,11 +1466,7 @@ def _build_binding(
|
|
|
1471
1466
|
weight_module=weight_module,
|
|
1472
1467
|
original_observer=site.observer,
|
|
1473
1468
|
entry_weight=entry_weight,
|
|
1474
|
-
|
|
1475
|
-
entry_zero_point=zero_point.detach().clone(),
|
|
1476
|
-
entry_qparams_locked=bool(site.observer._qparams_locked),
|
|
1477
|
-
entry_enabled=bool(site.observer.enabled),
|
|
1478
|
-
entry_fake_quant_enabled=bool(site.observer.fake_quant_enabled),
|
|
1469
|
+
entry_state=initial_state,
|
|
1479
1470
|
proxy=proxy,
|
|
1480
1471
|
)
|
|
1481
1472
|
|
|
@@ -45,7 +45,7 @@ from tico.quantization.wrapq.control import (
|
|
|
45
45
|
SiteRole,
|
|
46
46
|
)
|
|
47
47
|
from tico.quantization.wrapq.observers.affine_base import AffineObserverBase
|
|
48
|
-
from tico.quantization.wrapq.observers.base import ObserverBase
|
|
48
|
+
from tico.quantization.wrapq.observers.base import FrozenObserverState, ObserverBase
|
|
49
49
|
|
|
50
50
|
MetricsEvaluator = Callable[[], OutputMetrics]
|
|
51
51
|
ProgressCallback = Callable[["GlobalWeightRefinementCheckpoint"], None]
|
|
@@ -543,11 +543,7 @@ class _GlobalBinding:
|
|
|
543
543
|
weight_module: nn.Conv2d
|
|
544
544
|
original_observer: AffineObserverBase
|
|
545
545
|
entry_weight: torch.Tensor
|
|
546
|
-
|
|
547
|
-
entry_zero_point: torch.Tensor
|
|
548
|
-
entry_qparams_locked: bool
|
|
549
|
-
entry_enabled: bool
|
|
550
|
-
entry_fake_quant_enabled: bool
|
|
546
|
+
entry_state: FrozenObserverState
|
|
551
547
|
proxy: CheckpointInitializedScaleAdaRoundQuantizer
|
|
552
548
|
|
|
553
549
|
|
|
@@ -877,7 +873,7 @@ class GlobalAdaRoundWeightSet:
|
|
|
877
873
|
lock=True,
|
|
878
874
|
)
|
|
879
875
|
binding.original_observer.fake_quant_enabled = (
|
|
880
|
-
binding.
|
|
876
|
+
binding.entry_state.fake_quant_enabled
|
|
881
877
|
)
|
|
882
878
|
self._restore_observers()
|
|
883
879
|
except Exception:
|
|
@@ -897,16 +893,7 @@ class GlobalAdaRoundWeightSet:
|
|
|
897
893
|
for binding in self.bindings:
|
|
898
894
|
binding.weight_module.weight.copy_(binding.entry_weight)
|
|
899
895
|
for binding in self.bindings:
|
|
900
|
-
|
|
901
|
-
binding.original_observer.load_qparams(
|
|
902
|
-
binding.entry_scale.to(device=device),
|
|
903
|
-
binding.entry_zero_point.to(device=device),
|
|
904
|
-
lock=binding.entry_qparams_locked,
|
|
905
|
-
)
|
|
906
|
-
binding.original_observer.enabled = binding.entry_enabled
|
|
907
|
-
binding.original_observer.fake_quant_enabled = (
|
|
908
|
-
binding.entry_fake_quant_enabled
|
|
909
|
-
)
|
|
896
|
+
binding.original_observer.install_candidate(binding.entry_state)
|
|
910
897
|
self._restore_observers()
|
|
911
898
|
|
|
912
899
|
def _restore_observers(self) -> None:
|
|
@@ -1702,7 +1689,9 @@ def _build_binding(
|
|
|
1702
1689
|
f"FP source shape mismatch at {site.path!r}: "
|
|
1703
1690
|
f"{tuple(source.shape)} != {tuple(weight_module.weight.shape)}."
|
|
1704
1691
|
)
|
|
1705
|
-
|
|
1692
|
+
initial_state = site.observer.require_frozen()
|
|
1693
|
+
scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
1694
|
+
assert scale is not None and zero_point is not None
|
|
1706
1695
|
entry_weight = weight_module.weight.detach().clone()
|
|
1707
1696
|
with torch.no_grad():
|
|
1708
1697
|
checkpoint_effective_weight = site.observer.fake_quant(entry_weight)
|
|
@@ -1738,11 +1727,7 @@ def _build_binding(
|
|
|
1738
1727
|
weight_module=weight_module,
|
|
1739
1728
|
original_observer=site.observer,
|
|
1740
1729
|
entry_weight=entry_weight,
|
|
1741
|
-
|
|
1742
|
-
entry_zero_point=zero_point.detach().clone(),
|
|
1743
|
-
entry_qparams_locked=bool(site.observer._qparams_locked),
|
|
1744
|
-
entry_enabled=bool(site.observer.enabled),
|
|
1745
|
-
entry_fake_quant_enabled=bool(site.observer.fake_quant_enabled),
|
|
1730
|
+
entry_state=initial_state,
|
|
1746
1731
|
proxy=proxy,
|
|
1747
1732
|
)
|
|
1748
1733
|
|
|
@@ -30,7 +30,7 @@ from tico.quantization.wrapq.control import (
|
|
|
30
30
|
SiteRole,
|
|
31
31
|
)
|
|
32
32
|
from tico.quantization.wrapq.observers.affine_base import AffineObserverBase
|
|
33
|
-
from tico.quantization.wrapq.observers.base import ObserverBase
|
|
33
|
+
from tico.quantization.wrapq.observers.base import FrozenObserverState, ObserverBase
|
|
34
34
|
|
|
35
35
|
_SUPPORTED_FAMILIES = frozenset({"regular_conv", "depthwise_conv"})
|
|
36
36
|
|
|
@@ -168,9 +168,12 @@ class LearnableScaleAdaRoundWeightQuantizer(AffineObserverBase):
|
|
|
168
168
|
qscheme=original.qscheme,
|
|
169
169
|
channel_axis=original.channel_axis,
|
|
170
170
|
)
|
|
171
|
-
|
|
171
|
+
initial_state = original.require_frozen()
|
|
172
|
+
initial_scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
173
|
+
assert initial_scale is not None and zero_point is not None
|
|
172
174
|
initial_scale = initial_scale.detach().clone()
|
|
173
175
|
zero_point = zero_point.detach().clone().to(torch.int)
|
|
176
|
+
self.observe_shape(weight.shape)
|
|
174
177
|
self.load_qparams(initial_scale, zero_point, lock=True)
|
|
175
178
|
self.min_val = original.min_val.detach().clone()
|
|
176
179
|
self.max_val = original.max_val.detach().clone()
|
|
@@ -264,6 +267,24 @@ class LearnableScaleAdaRoundWeightQuantizer(AffineObserverBase):
|
|
|
264
267
|
"""Return the current learned scale and fixed calibrated zero-point."""
|
|
265
268
|
return self.learned_scale(), self._fixed_zero_point
|
|
266
269
|
|
|
270
|
+
@property
|
|
271
|
+
def frozen_state(self):
|
|
272
|
+
# The optimizer's mutable scale is not a committed deployment grid.
|
|
273
|
+
return None
|
|
274
|
+
|
|
275
|
+
def derive_candidate(self):
|
|
276
|
+
raise RuntimeError(
|
|
277
|
+
"Finalize learned AdaRound qparams into the original observer before freezing or export."
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
def get_extra_state(self):
|
|
281
|
+
raise RuntimeError(
|
|
282
|
+
"Finalize learned AdaRound qparams before saving deployment state; use the owning optimizer's state_snapshot for optimization checkpoints."
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
def validate_loaded_state(self) -> None:
|
|
286
|
+
self.derive_candidate()
|
|
287
|
+
|
|
267
288
|
def soft_rounding(self) -> torch.Tensor:
|
|
268
289
|
stretched = torch.sigmoid(self.alpha) * (self.zeta - self.gamma)
|
|
269
290
|
return (stretched + self.gamma).clamp(0.0, 1.0)
|
|
@@ -390,11 +411,7 @@ class _JointBinding:
|
|
|
390
411
|
weight_module: nn.Conv2d
|
|
391
412
|
original_observer: AffineObserverBase
|
|
392
413
|
original_weight: torch.Tensor
|
|
393
|
-
|
|
394
|
-
original_zero_point: torch.Tensor
|
|
395
|
-
original_qparams_locked: bool
|
|
396
|
-
original_enabled: bool
|
|
397
|
-
original_fake_quant_enabled: bool
|
|
414
|
+
original_state: FrozenObserverState
|
|
398
415
|
proxy: LearnableScaleAdaRoundWeightQuantizer
|
|
399
416
|
|
|
400
417
|
|
|
@@ -566,7 +583,7 @@ class JointAdaRoundWeightSet:
|
|
|
566
583
|
lock=True,
|
|
567
584
|
)
|
|
568
585
|
binding.original_observer.fake_quant_enabled = (
|
|
569
|
-
binding.
|
|
586
|
+
binding.original_state.fake_quant_enabled
|
|
570
587
|
)
|
|
571
588
|
self._restore_observers()
|
|
572
589
|
except Exception:
|
|
@@ -586,16 +603,7 @@ class JointAdaRoundWeightSet:
|
|
|
586
603
|
for binding in self.bindings:
|
|
587
604
|
binding.weight_module.weight.copy_(binding.original_weight)
|
|
588
605
|
for binding in self.bindings:
|
|
589
|
-
|
|
590
|
-
binding.original_observer.load_qparams(
|
|
591
|
-
binding.original_scale.to(device=device),
|
|
592
|
-
binding.original_zero_point.to(device=device),
|
|
593
|
-
lock=binding.original_qparams_locked,
|
|
594
|
-
)
|
|
595
|
-
binding.original_observer.enabled = binding.original_enabled
|
|
596
|
-
binding.original_observer.fake_quant_enabled = (
|
|
597
|
-
binding.original_fake_quant_enabled
|
|
598
|
-
)
|
|
606
|
+
binding.original_observer.install_candidate(binding.original_state)
|
|
599
607
|
self._restore_observers()
|
|
600
608
|
|
|
601
609
|
def _restore_observers(self) -> None:
|
|
@@ -691,7 +699,9 @@ def _build_binding(
|
|
|
691
699
|
raise RuntimeError(
|
|
692
700
|
f"No registered observer attribute aliases site {site.path!r}."
|
|
693
701
|
)
|
|
694
|
-
|
|
702
|
+
initial_state = site.observer.require_frozen()
|
|
703
|
+
original_scale, original_zero_point = initial_state.scale, initial_state.zero_point
|
|
704
|
+
assert original_scale is not None and original_zero_point is not None
|
|
695
705
|
proxy = LearnableScaleAdaRoundWeightQuantizer(
|
|
696
706
|
site.observer,
|
|
697
707
|
weight_module.weight,
|
|
@@ -707,11 +717,7 @@ def _build_binding(
|
|
|
707
717
|
weight_module=weight_module,
|
|
708
718
|
original_observer=site.observer,
|
|
709
719
|
original_weight=weight_module.weight.detach().clone(),
|
|
710
|
-
|
|
711
|
-
original_zero_point=original_zero_point.detach().clone(),
|
|
712
|
-
original_qparams_locked=bool(getattr(site.observer, "_qparams_locked", False)),
|
|
713
|
-
original_enabled=bool(site.observer.enabled),
|
|
714
|
-
original_fake_quant_enabled=bool(site.observer.fake_quant_enabled),
|
|
720
|
+
original_state=initial_state,
|
|
715
721
|
proxy=proxy,
|
|
716
722
|
)
|
|
717
723
|
|
{tico-0.4.0.dev261027 → tico-0.4.0.dev261028}/tico/quantization/algorithm/adaround/rounding.py
RENAMED
|
@@ -117,7 +117,10 @@ class AdaRoundWeightQuantizer(AffineObserverBase):
|
|
|
117
117
|
qscheme=original.qscheme,
|
|
118
118
|
channel_axis=original.channel_axis,
|
|
119
119
|
)
|
|
120
|
-
|
|
120
|
+
initial_state = original.require_frozen()
|
|
121
|
+
scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
122
|
+
assert scale is not None and zero_point is not None
|
|
123
|
+
self.observe_shape(weight.shape)
|
|
121
124
|
self.load_qparams(scale, zero_point, lock=True)
|
|
122
125
|
self.min_val = original.min_val.detach().clone()
|
|
123
126
|
self.max_val = original.max_val.detach().clone()
|
|
@@ -41,6 +41,7 @@ from tico.quantization.algorithm.block_reconstruction.selection import (
|
|
|
41
41
|
)
|
|
42
42
|
from tico.quantization.wrapq.control import iter_quantization_sites
|
|
43
43
|
from tico.quantization.wrapq.observers.affine_base import AffineObserverBase
|
|
44
|
+
from tico.quantization.wrapq.observers.base import FrozenObserverState
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
@dataclass(frozen=True)
|
|
@@ -96,13 +97,7 @@ def build_qdrop_candidates(
|
|
|
96
97
|
@dataclass(frozen=True)
|
|
97
98
|
class _AffineQParamSiteState:
|
|
98
99
|
site_path: str
|
|
99
|
-
|
|
100
|
-
maximum: torch.Tensor
|
|
101
|
-
scale: torch.Tensor
|
|
102
|
-
zero_point: torch.Tensor
|
|
103
|
-
qparams_locked: bool
|
|
104
|
-
enabled: bool
|
|
105
|
-
fake_quant_enabled: bool
|
|
100
|
+
frozen: FrozenObserverState
|
|
106
101
|
|
|
107
102
|
|
|
108
103
|
@dataclass(frozen=True)
|
|
@@ -134,23 +129,17 @@ class AffineQParamSnapshot:
|
|
|
134
129
|
observer = sites[path].observer
|
|
135
130
|
if not isinstance(observer, AffineObserverBase):
|
|
136
131
|
raise TypeError(f"Quantization site {path!r} is not affine.")
|
|
137
|
-
|
|
132
|
+
frozen = observer.require_frozen()
|
|
138
133
|
states.append(
|
|
139
134
|
_AffineQParamSiteState(
|
|
140
135
|
site_path=path,
|
|
141
|
-
|
|
142
|
-
maximum=observer.max_val.detach().cpu().clone(),
|
|
143
|
-
scale=scale.detach().cpu().clone(),
|
|
144
|
-
zero_point=zero_point.detach().cpu().clone(),
|
|
145
|
-
qparams_locked=bool(getattr(observer, "_qparams_locked", True)),
|
|
146
|
-
enabled=bool(observer.enabled),
|
|
147
|
-
fake_quant_enabled=bool(observer.fake_quant_enabled),
|
|
136
|
+
frozen=frozen,
|
|
148
137
|
)
|
|
149
138
|
)
|
|
150
139
|
return cls(tuple(states))
|
|
151
140
|
|
|
152
141
|
def restore(self, model: nn.Module) -> None:
|
|
153
|
-
"""Restore
|
|
142
|
+
"""Restore frozen grids, provenance, locks, and runtime policy."""
|
|
154
143
|
sites = {site.path: site for site in iter_quantization_sites(model)}
|
|
155
144
|
for state in self.sites:
|
|
156
145
|
site = sites.get(state.site_path)
|
|
@@ -159,29 +148,22 @@ class AffineQParamSnapshot:
|
|
|
159
148
|
observer = site.observer
|
|
160
149
|
if not isinstance(observer, AffineObserverBase):
|
|
161
150
|
raise TypeError(f"Quantization site {state.site_path!r} is not affine.")
|
|
162
|
-
|
|
163
|
-
observer.min_val.copy_(state.minimum.to(device=device))
|
|
164
|
-
observer.max_val.copy_(state.maximum.to(device=device))
|
|
165
|
-
observer.load_qparams(
|
|
166
|
-
state.scale.to(device=device),
|
|
167
|
-
state.zero_point.to(device=device),
|
|
168
|
-
lock=state.qparams_locked,
|
|
169
|
-
)
|
|
170
|
-
observer.enabled = state.enabled
|
|
171
|
-
observer.fake_quant_enabled = state.fake_quant_enabled
|
|
151
|
+
observer.install_candidate(state.frozen)
|
|
172
152
|
|
|
173
153
|
def to_dict(self) -> dict[str, dict[str, float | int | bool]]:
|
|
174
154
|
"""Return scalar qparams for audit-friendly reports."""
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
"
|
|
181
|
-
"
|
|
155
|
+
result: dict[str, dict[str, float | int | bool]] = {}
|
|
156
|
+
for state in self.sites:
|
|
157
|
+
frozen = state.frozen
|
|
158
|
+
assert frozen.scale is not None and frozen.zero_point is not None
|
|
159
|
+
result[state.site_path] = {
|
|
160
|
+
"scale": float(frozen.scale.reshape(-1)[0].item()),
|
|
161
|
+
"zero_point": int(frozen.zero_point.reshape(-1)[0].item()),
|
|
162
|
+
"qparams_locked": frozen.locked,
|
|
163
|
+
"enabled": False,
|
|
164
|
+
"fake_quant_enabled": frozen.fake_quant_enabled,
|
|
182
165
|
}
|
|
183
|
-
|
|
184
|
-
}
|
|
166
|
+
return result
|
|
185
167
|
|
|
186
168
|
|
|
187
169
|
@dataclass(frozen=True)
|
|
@@ -72,7 +72,9 @@ class LearnableAffineObserver(ObserverBase):
|
|
|
72
72
|
if minimum_scale <= 0.0 or not math.isfinite(minimum_scale):
|
|
73
73
|
raise ValueError("minimum_scale must be finite and positive.")
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
initial_state = original.require_frozen()
|
|
76
|
+
scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
77
|
+
assert scale is not None and zero_point is not None
|
|
76
78
|
if scale.numel() != 1 or zero_point.numel() != 1:
|
|
77
79
|
raise ValueError("Learnable affine qparams must be scalar values.")
|
|
78
80
|
scale_value = scale.detach().to(dtype=torch.float32).reshape(())
|
|
@@ -143,6 +145,19 @@ class LearnableAffineObserver(ObserverBase):
|
|
|
143
145
|
zero_point = torch.round(self.projected_zero_point).to(dtype=torch.int)
|
|
144
146
|
return self.scale, zero_point
|
|
145
147
|
|
|
148
|
+
def derive_candidate(self):
|
|
149
|
+
raise RuntimeError(
|
|
150
|
+
"Finalize block reconstruction into its original observers before freezing or export."
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
def get_extra_state(self):
|
|
154
|
+
raise RuntimeError(
|
|
155
|
+
"Finalize block reconstruction before saving deployment state; use state_snapshot for optimization checkpoints."
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
def validate_loaded_state(self) -> None:
|
|
159
|
+
self.derive_candidate()
|
|
160
|
+
|
|
146
161
|
def fake_quant(self, x: torch.Tensor) -> torch.Tensor:
|
|
147
162
|
"""Apply affine fake quantization with straight-through rounding."""
|
|
148
163
|
if not self.fake_quant_enabled:
|
|
@@ -389,7 +404,9 @@ def _validate_tied_observers(
|
|
|
389
404
|
observers: tuple[AffineObserverBase, ...],
|
|
390
405
|
) -> None:
|
|
391
406
|
representative = observers[0]
|
|
392
|
-
|
|
407
|
+
initial_state = representative.require_frozen()
|
|
408
|
+
reference_scale, reference_zp = initial_state.scale, initial_state.zero_point
|
|
409
|
+
assert reference_scale is not None and reference_zp is not None
|
|
393
410
|
for observer in observers[1:]:
|
|
394
411
|
if observer.dtype != representative.dtype:
|
|
395
412
|
raise ValueError(f"Tied group {group.name!r} mixes activation dtypes.")
|
|
@@ -399,7 +416,9 @@ def _validate_tied_observers(
|
|
|
399
416
|
raise ValueError(
|
|
400
417
|
f"Tied group {group.name!r} contains per-channel activation qparams."
|
|
401
418
|
)
|
|
402
|
-
|
|
419
|
+
initial_state = observer.require_frozen()
|
|
420
|
+
scale, zero_point = initial_state.scale, initial_state.zero_point
|
|
421
|
+
assert scale is not None and zero_point is not None
|
|
403
422
|
if not torch.allclose(scale, reference_scale, rtol=1.0e-6, atol=1.0e-8):
|
|
404
423
|
raise ValueError(
|
|
405
424
|
f"Tied group {group.name!r} starts from inconsistent scales."
|
|
@@ -424,17 +443,6 @@ def _store_qparams(
|
|
|
424
443
|
device=observer.min_val.device,
|
|
425
444
|
dtype=torch.int,
|
|
426
445
|
)
|
|
427
|
-
qmin, qmax = observer.dtype.qmin, observer.dtype.qmax
|
|
428
|
-
if observer.qscheme.is_symmetric():
|
|
429
|
-
observer.min_val.copy_((-qmax * stored_scale).to(observer.min_val))
|
|
430
|
-
observer.max_val.copy_((qmax * stored_scale).to(observer.max_val))
|
|
431
|
-
else:
|
|
432
|
-
observer.min_val.copy_(
|
|
433
|
-
((qmin - stored_zero_point) * stored_scale).to(observer.min_val)
|
|
434
|
-
)
|
|
435
|
-
observer.max_val.copy_(
|
|
436
|
-
((qmax - stored_zero_point) * stored_scale).to(observer.max_val)
|
|
437
|
-
)
|
|
438
446
|
observer.load_qparams(stored_scale, stored_zero_point, lock=True)
|
|
439
447
|
|
|
440
448
|
|
|
@@ -27,6 +27,8 @@ from tico.quantization.recipes.evaluation.selection import (
|
|
|
27
27
|
from tico.quantization.recipes.extensions import load_recipe_extensions
|
|
28
28
|
from tico.quantization.recipes.utils import set_seed
|
|
29
29
|
|
|
30
|
+
from tico.quantization.wrapq.lifecycle import validate_frozen_model
|
|
31
|
+
|
|
30
32
|
|
|
31
33
|
def parse_args() -> argparse.Namespace:
|
|
32
34
|
parser = argparse.ArgumentParser(
|
|
@@ -101,6 +103,7 @@ def main() -> None:
|
|
|
101
103
|
map_location=ctx.device,
|
|
102
104
|
weights_only=False,
|
|
103
105
|
)
|
|
106
|
+
validate_frozen_model(checkpoint)
|
|
104
107
|
if hasattr(checkpoint, "to"):
|
|
105
108
|
checkpoint = checkpoint.to(ctx.device)
|
|
106
109
|
ctx.model = checkpoint.eval()
|
|
@@ -23,6 +23,8 @@ from tico.quantization.recipes.context import RecipeContext
|
|
|
23
23
|
from tico.quantization.recipes.extensions import load_recipe_extensions
|
|
24
24
|
from tico.quantization.recipes.utils import set_seed, torch_dtype_from_name
|
|
25
25
|
|
|
26
|
+
from tico.quantization.wrapq.lifecycle import validate_frozen_model
|
|
27
|
+
|
|
26
28
|
_EXPORT_SOURCES = ("model", "checkpoint")
|
|
27
29
|
|
|
28
30
|
|
|
@@ -150,6 +152,7 @@ def main() -> None:
|
|
|
150
152
|
map_location=device,
|
|
151
153
|
weights_only=False,
|
|
152
154
|
)
|
|
155
|
+
validate_frozen_model(checkpoint)
|
|
153
156
|
if hasattr(checkpoint, "to"):
|
|
154
157
|
checkpoint = checkpoint.to(device)
|
|
155
158
|
ctx.model = checkpoint.eval()
|
|
@@ -30,7 +30,7 @@ from tico.utils.errors import NotYetSupportedError
|
|
|
30
30
|
from tico.utils.graph import create_node
|
|
31
31
|
from tico.utils.passes import PassBase, PassResult
|
|
32
32
|
from tico.utils.trace_decorators import trace_graph_diff_on_pass
|
|
33
|
-
from tico.utils.utils import quant_min_max
|
|
33
|
+
from tico.utils.utils import quant_min_max
|
|
34
34
|
from tico.utils.validate_args_kwargs import (
|
|
35
35
|
AddTensorArgs,
|
|
36
36
|
BmmArgs,
|
|
@@ -98,8 +98,9 @@ def _u8_to_i16(qparam: QuantParam) -> QuantParam:
|
|
|
98
98
|
def _insert_quantize_op_before(node, inp):
|
|
99
99
|
graph = node.graph
|
|
100
100
|
qparam: QuantParam = node.meta[QPARAM_KEY]
|
|
101
|
-
assert qparam.scale is not None
|
|
102
|
-
assert qparam.zero_point is not None
|
|
101
|
+
assert qparam.scale is not None and len(qparam.scale) == 1
|
|
102
|
+
assert qparam.zero_point is not None and len(qparam.zero_point) == 1
|
|
103
|
+
assert qparam.quantized_dimension is None
|
|
103
104
|
scale = qparam.scale[0]
|
|
104
105
|
zerop = qparam.zero_point[0]
|
|
105
106
|
min_, max_ = quant_min_max(qparam.dtype)
|
|
@@ -114,7 +115,10 @@ def _insert_quantize_op_before(node, inp):
|
|
|
114
115
|
origin=node,
|
|
115
116
|
)
|
|
116
117
|
quantize.meta[QPARAM_KEY] = copy.deepcopy(qparam)
|
|
117
|
-
|
|
118
|
+
# Folded quantized edges may already have integer value metadata, but
|
|
119
|
+
# PyTorch's quantize_per_tensor meta kernel accepts only float32 input.
|
|
120
|
+
# Circle requantization needs just the source shape and destination dtype.
|
|
121
|
+
quantize.meta["val"] = torch.empty_like(inp.meta["val"], dtype=dtype)
|
|
118
122
|
|
|
119
123
|
node.replace_input_with(inp, quantize)
|
|
120
124
|
|
|
@@ -250,10 +254,47 @@ def _cat_handler(node, logger):
|
|
|
250
254
|
|
|
251
255
|
assert len(tensors) > 0
|
|
252
256
|
in_dtype = qparam_dtype(tensors[0])
|
|
253
|
-
if in_dtype
|
|
257
|
+
if any(qparam_dtype(x) != in_dtype for x in tensors):
|
|
258
|
+
destination = node.meta[QPARAM_KEY]
|
|
259
|
+
qparams = [x.meta[QPARAM_KEY] for x in tensors] + [destination]
|
|
260
|
+
# Preserve the existing treatment of incompletely annotated concats.
|
|
261
|
+
if any(
|
|
262
|
+
not qparam.dtype or qparam.scale is None or qparam.zero_point is None
|
|
263
|
+
for qparam in qparams
|
|
264
|
+
):
|
|
265
|
+
return
|
|
266
|
+
|
|
267
|
+
if any(
|
|
268
|
+
qparam.dtype not in ("uint8", "int16")
|
|
269
|
+
or qparam.quantized_dimension is not None
|
|
270
|
+
or len(qparam.scale) != 1
|
|
271
|
+
or len(qparam.zero_point) != 1
|
|
272
|
+
for qparam in qparams
|
|
273
|
+
):
|
|
274
|
+
raise NotYetSupportedError(
|
|
275
|
+
f"Unsupported mixed-dtype concat {node.name}: "
|
|
276
|
+
f"inputs={[qparam_dtype(x) for x in tensors]}, "
|
|
277
|
+
f"output={destination.dtype}. "
|
|
278
|
+
"Only per-tensor affine uint8/int16 qparams are supported."
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
# Normalize to the intended output grid, including same-dtype operands
|
|
282
|
+
# with different qparams. Convert only this consumer's connections:
|
|
283
|
+
# producers may be graph inputs, graph outputs, or shared with other ops.
|
|
284
|
+
for inp in dict.fromkeys(tensors):
|
|
285
|
+
source = inp.meta[QPARAM_KEY]
|
|
286
|
+
if (
|
|
287
|
+
source.dtype != destination.dtype
|
|
288
|
+
or source.scale != destination.scale
|
|
289
|
+
or source.zero_point != destination.zero_point
|
|
290
|
+
):
|
|
291
|
+
_insert_quantize_op_before(node, inp)
|
|
292
|
+
logger.debug(
|
|
293
|
+
f"quantize_per_tensor.default is inserted before {node.name}."
|
|
294
|
+
)
|
|
254
295
|
return
|
|
255
296
|
|
|
256
|
-
if
|
|
297
|
+
if in_dtype == qparam_dtype(node):
|
|
257
298
|
return
|
|
258
299
|
|
|
259
300
|
if in_dtype == "int16" and qparam_dtype(node) == "uint8":
|
|
@@ -63,18 +63,26 @@ def prepare(
|
|
|
63
63
|
|
|
64
64
|
def convert(model, inplace: Optional[bool] = True):
|
|
65
65
|
"""
|
|
66
|
-
Convert
|
|
66
|
+
Convert a model returned by prepare() using its attached quantizer.
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
Retrieves the ``tico_quantizer`` installed by prepare(), reusing its existing
|
|
69
|
+
configuration and collected calibration state. PTQ wrappers retain their
|
|
70
|
+
resolved quantization policies. This function does not accept ``quant_config``
|
|
71
|
+
or select or instantiate a new quantizer.
|
|
72
|
+
|
|
73
|
+
The converted result loses its quantizer handle only after conversion succeeds.
|
|
74
|
+
On failure, the original prepared model retains its handle for retry; arbitrary
|
|
75
|
+
in-place mutations made by the algorithm are not rolled back by this API.
|
|
70
76
|
|
|
71
77
|
Parameters:
|
|
72
|
-
model: The
|
|
73
|
-
inplace (bool, optional):
|
|
74
|
-
|
|
78
|
+
model: The model returned by prepare(), calibrated as required by its algorithm.
|
|
79
|
+
inplace (bool, optional): Defaults to True, converting the model in place.
|
|
80
|
+
For algorithms supporting False, converts a copy and retains the original
|
|
81
|
+
prepared model's quantizer handle. GPTQ supports only inplace=True.
|
|
75
82
|
|
|
76
83
|
Returns:
|
|
77
|
-
The
|
|
84
|
+
The converted model without a quantizer handle. With supported inplace=False
|
|
85
|
+
conversion, this is a copy; the original prepared model retains its handle.
|
|
78
86
|
"""
|
|
79
87
|
# Get quantizer first before calling deepcopy that does not copy attributes properly.
|
|
80
88
|
if hasattr(model, QUANTIZER_ATTRIBUTE_NAME):
|
|
@@ -89,10 +97,13 @@ def convert(model, inplace: Optional[bool] = True):
|
|
|
89
97
|
"GPTQ quantization only supports `in-place=True`. Please set 'inplace=True' to proceed."
|
|
90
98
|
)
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
# The result copy must not duplicate quantizer-owned calibration caches.
|
|
101
|
+
# Sharing this metadata during the copy also preserves the original handle.
|
|
102
|
+
model = model if inplace else copy.deepcopy(model, memo={id(quantizer): quantizer})
|
|
94
103
|
|
|
95
104
|
assert isinstance(quantizer, BaseQuantizer)
|
|
96
105
|
model = quantizer.convert(model)
|
|
106
|
+
if hasattr(model, QUANTIZER_ATTRIBUTE_NAME):
|
|
107
|
+
delattr(model, QUANTIZER_ATTRIBUTE_NAME)
|
|
97
108
|
|
|
98
109
|
return model
|