tico 0.2.0.dev260707__tar.gz → 0.2.0.dev260709__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.
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/PKG-INFO +1 -1
- tico-0.2.0.dev260709/tico/_version.py +1 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/vlm_eval_utils.py +1 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/adapters/__init__.py +2 -0
- tico-0.2.0.dev260709/tico/quantization/recipes/adapters/gemma4.py +330 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/adapters/llama.py +2 -2
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/data/llm.py +1 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/cases/qwen3_vl.py +105 -16
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/llm.py +1 -1
- tico-0.2.0.dev260709/tico/quantization/recipes/override_policies.py +688 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/ptq.py +7 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/compare_ppl.py +1 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/debug_quant_outputs.py +1 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/quantize_full_qmodel_with_gptq.py +6 -4
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/quantize_with_gptq.py +1 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_model.py +140 -37
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_text_attention.py +49 -2
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder.py +3 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/utils.py +173 -3
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico.egg-info/PKG-INFO +1 -1
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico.egg-info/SOURCES.txt +2 -1
- tico-0.2.0.dev260707/tico/_version.py +0 -1
- tico-0.2.0.dev260707/tico/quantization/recipes/adapters/gemma4.py +0 -184
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/LICENSE +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/README.md +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/pyproject.toml +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/setup.cfg +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/config/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/config/base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/config/factory.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/config/v1.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/experimental/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/interpreter/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/interpreter/infer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/interpreter/interpreter.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/cast_aten_where_arg_type.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/cast_clamp_mixed_type_args.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/cast_mixed_type_args.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/const_prop_pass.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_conv1d_to_conv2d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_conv3d_to_conv2d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_expand_to_slice_cat.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_gather_to_gather_nd.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_layout_op_to_reshape.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_matmul_to_linear.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_repeat_to_expand_copy.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_sym_size_to_circle_shape.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/convert_to_relu6.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_addmm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_batch_norm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_fake_quantize.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_fake_quantize_tensor_qparams.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_group_norm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_grouped_conv2d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/decompose_slice_scatter.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/eliminate_rank_round_trip_region.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/extract_dtype_kwargs.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/fill_meta_val.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/fuse_leading_unsqueeze_reshape.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/fuse_redundant_reshape_to_mean.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/legalize_causal_mask_value.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/legalize_predefined_layout_operators.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/lower_copy.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/lower_pow2_to_mul.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/lower_to_resize_nearest_neighbor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/lower_to_slice.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/merge_consecutive_cat.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/ops.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_nop.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_redundant_assert_nodes.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_redundant_expand.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_redundant_permute.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_redundant_reshape.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_redundant_slice.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_redundant_to_copy.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/remove_unused_placeholder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/restore_linear.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/passes/segment_index_select.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/pt2_to_circle.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/cle/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/cle/cle.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/cle/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/fpi_gptq/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/fpi_gptq/fpi_gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/fpi_gptq/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/fpi_gptq/util.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/gptq/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/gptq/gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/gptq/quant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/gptq/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/gptq/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/qwen3_vl_gptq/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/qwen3_vl_gptq/gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/qwen3_vl_gptq/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/qwen3_vl_gptq/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/smoothquant/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/smoothquant/observer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/smoothquant/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/smoothquant/smooth_quant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/fuse_norm_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/hadamard_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/qwen3_vl_model_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/qwen3_vl_quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/qwen3_vl_rotation_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/rotation_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/spin_llama.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/algorithm/spinquant/spin_qwen3_vl.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/builders.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/cle.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/fpi_gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/gemma4_builders.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/llama_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/ptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/qwen3_vl_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/qwen3_vl_gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/qwen3_vl_spinquant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/smoothquant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/specs.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/spinquant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/config/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/backend.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/evaluate.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/executor/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/executor/backend_executor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/executor/circle_executor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/executor/triv24_executor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/hellaswag_eval_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/llava_bench_judge_eval_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/lmms_eval_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/lmms_tasks/videomme_mini/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/metric.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/mmlu_eval_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/mmmu_eval_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/optional_deps.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/script/llm_tasks_eval.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/script/mini_vqa_eval.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/examples/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/examples/configs/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/examples/evaluate.py +0 -0
- /tico-0.2.0.dev260707/tico/quantization/examples/inspect.py → /tico-0.2.0.dev260709/tico/quantization/examples/inspector.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/examples/quantize.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/fold_quant_ops.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/insert_quantize_on_dtype_mismatch.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/propagate_qparam_backward.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/propagate_qparam_forward.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/qparam_safe_const_prop.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/quantize_bias.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/passes/remove_weight_dequant_op.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/public_interface.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/quantizer_registry.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/adapters/base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/adapters/qwen3_vl.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/config.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/context.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/data/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/data/vlm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/static_gemma4_runtime.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/static_llama_runtime.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/static_qwen3_vl_runtime.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/tied_embedding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/trace.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/case.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/cases/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/cases/gemma4.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/cases/llama.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/cases/nn.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/registry.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/result.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/runner.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/debug/wrapper_smoke/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/hellaswag.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/llava_bench_judge.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/mmlu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/mmmu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/video_mme.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/evaluation/vlm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/export/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/export/checkpoint.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/export/circle.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/export/llama.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/qparams.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/runner.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/cle.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/smoothquant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/stages/spinquant.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/dtypes.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/evaluate_fk_llama_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_for_causal_lm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_multimodal_embedder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_text_scaled_word_embedding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_vision_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_vision_patch_embedder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/gemma4/quantize_vision_pooler.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/llama/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/llama/quantize_attention_decode.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/llama/quantize_attention_prefill.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_decode.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_prefill.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/llama/quantize_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/nn/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/nn/quantize_conv3d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/nn/quantize_conv3d_special_case.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/nn/quantize_layernorm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/nn/quantize_linear.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/nn/quantize_tied_embedding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/quantize_qwen3_vl_with_gptq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_text_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_text_decoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_text_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_text_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_vision_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_vision_block.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_vision_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_vision_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_embed.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_merger.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/qwen/trace_qwen.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/examples/static_llama_layer_runtime.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/mode.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/affine_base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/ema.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/identity.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/minmax.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/observers/mx.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/qscheme.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/quantizer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/check_missing_qparam.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/introspection.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/metrics.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/reduce_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/utils/version.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrap_helper.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/decoder_export_single_step.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/fairseq/quant_mha.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/export_adapters.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_clippable_linear.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_for_causal_lm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_multimodal_embedder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_rmsnorm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_text_decoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_text_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_text_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_text_scaled_word_embedding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_patch_embedder.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_pooler.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/export_adapters.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/quant_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/quant_decoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/quant_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/quant_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/llama/quant_model_for_causal_lm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/quant_conv3d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/quant_conv3d_decomposed.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/quant_embedding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/quant_layernorm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/quant_linear.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/nn/quant_silu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/ops/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/ops/quant_rmsnorm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/ptq_wrapper.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/quant_elementwise.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/quant_module_base.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/export_adapters.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_decoder_layer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_block.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_mlp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_embed.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_merger.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/wrapq/wrappers/registry.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/circle_graph.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/circle_mapping.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/circle_serializer.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/adapters/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/adapters/llama_rmsnorm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/adapters/onert/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/adapters/onert/llama_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/hashable_opcode.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/node_visitor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_abs.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_add.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_alias_copy.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_any.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_arange_start_step.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_argmax.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_attention.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_avg_pool2d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_bmm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_cat.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_circle_gather_nd.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_circle_shape.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_clamp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_clone.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_constant_pad_nd.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_conv2d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_cos.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_cumsum.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_depthwise_conv2d.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_dequantize_per_channel.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_dequantize_per_tensor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_div.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_elu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_embedding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_eq.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_exp.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_expand.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_full.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_full_like.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_ge.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_gelu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_gt.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_index.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_index_select.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_instance_norm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_le.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_leaky_relu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_linear.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_log.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_log1p.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_logical_and.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_logical_not.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_lt.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_max_dim.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_max_pool2d_with_indices.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_maximum.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_mean.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_minimum.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_mm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_mul.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_ne.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_neg.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_permute.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_pow.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_prelu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_quantize_per_tensor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_reciprocal.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_relu.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_relu6.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_repeat.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_reshape.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_resize_nearest_neighbor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_rmsnorm.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_round.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_rsqrt.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_scalar_tensor.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_select_copy.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_sigmoid.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_sin.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_slice.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_softmax.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_split_with_sizes.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_sqrt.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_squeeze.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_sub.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_sum.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_tanh.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_to_copy.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_transpose_conv.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_unsqueeze.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_view.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/op_where.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/operators/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/pack.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/serialize/quant_param.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/compat/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/compat/torch.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/compat/transformers.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/convert.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/define.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/diff_graph.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/dtype.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/errors.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/graph.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/installed_packages.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/logging.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/model.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/mx/__init__.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/mx/dtypes.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/mx/elemwise_ops.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/mx/formats.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/mx/mx_ops.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/padding.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/passes.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/pytree_utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/record_input.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/register_custom_op.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/serialize.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/signature.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/trace_decorators.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/utils.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/validate_args_kwargs.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/utils/version.py +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico.egg-info/dependency_links.txt +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico.egg-info/entry_points.txt +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico.egg-info/requires.txt +0 -0
- {tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.0.dev260709"
|
{tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/evaluation/vlm_eval_utils.py
RENAMED
|
@@ -273,7 +273,7 @@ DATASETS: dict[str, dict[str, Any]] = {
|
|
|
273
273
|
"wikitext2": {
|
|
274
274
|
"default_split": "test",
|
|
275
275
|
"adapter": get_item_wikitext2,
|
|
276
|
-
"candidates": ["wikitext"],
|
|
276
|
+
"candidates": ["Salesforce/wikitext"],
|
|
277
277
|
"config": "wikitext-2-raw-v1",
|
|
278
278
|
"is_text_only": True,
|
|
279
279
|
},
|
{tico-0.2.0.dev260707 → tico-0.2.0.dev260709}/tico/quantization/recipes/adapters/__init__.py
RENAMED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from tico.quantization.recipes.adapters.base import ModelAdapter
|
|
16
|
+
from tico.quantization.recipes.adapters.gemma4 import Gemma4Adapter
|
|
16
17
|
from tico.quantization.recipes.adapters.llama import LlamaAdapter
|
|
17
18
|
from tico.quantization.recipes.adapters.qwen3_vl import Qwen3VLAdapter
|
|
18
19
|
|
|
@@ -20,6 +21,7 @@ _ADAPTERS = {
|
|
|
20
21
|
"llama": LlamaAdapter(),
|
|
21
22
|
"qwen3_vl": Qwen3VLAdapter(),
|
|
22
23
|
"qwen3-vl": Qwen3VLAdapter(),
|
|
24
|
+
"gemma4": Gemma4Adapter(),
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Copyright (c) 2026 Samsung Electronics Co., Ltd. All Rights Reserved
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from contextlib import contextmanager
|
|
16
|
+
from typing import Any, Iterator, Mapping, Sequence
|
|
17
|
+
|
|
18
|
+
import torch
|
|
19
|
+
import tqdm
|
|
20
|
+
from transformers import AutoProcessor
|
|
21
|
+
|
|
22
|
+
from tico.quantization import convert, prepare
|
|
23
|
+
from tico.quantization.config.gemma4_builders import build_gemma4_e2b_ptq_config
|
|
24
|
+
from tico.quantization.recipes.adapters.base import ModelAdapter
|
|
25
|
+
from tico.quantization.recipes.context import RecipeContext
|
|
26
|
+
from tico.quantization.recipes.data.vlm import build_vlm_calibration_inputs
|
|
27
|
+
from tico.quantization.recipes.evaluation.llava_bench_judge import (
|
|
28
|
+
evaluate_and_print_llava_bench_judge,
|
|
29
|
+
)
|
|
30
|
+
from tico.quantization.recipes.evaluation.vlm import (
|
|
31
|
+
evaluate_llava_bench,
|
|
32
|
+
print_coco_score_results,
|
|
33
|
+
)
|
|
34
|
+
from tico.quantization.recipes.utils import (
|
|
35
|
+
move_to_device,
|
|
36
|
+
quant_spec_from_config,
|
|
37
|
+
torch_dtype_from_name,
|
|
38
|
+
)
|
|
39
|
+
from tico.quantization.wrapq.wrappers.gemma4.utils import assert_gemma4_e2b_no_moe
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Gemma4Adapter(ModelAdapter):
|
|
43
|
+
"""Model adapter for Gemma4 E2B PTQ and static runtime experiments."""
|
|
44
|
+
|
|
45
|
+
family = "gemma4"
|
|
46
|
+
|
|
47
|
+
def load_model(self, ctx: RecipeContext) -> RecipeContext:
|
|
48
|
+
"""Load the Gemma4 E2B model and processor."""
|
|
49
|
+
cfg = ctx.cfg
|
|
50
|
+
model_cfg = cfg.get("model", {})
|
|
51
|
+
runtime_cfg = cfg.get("runtime", {})
|
|
52
|
+
|
|
53
|
+
ctx.device = torch.device(
|
|
54
|
+
runtime_cfg.get("device", "cuda" if torch.cuda.is_available() else "cpu")
|
|
55
|
+
)
|
|
56
|
+
ctx.dtype = torch_dtype_from_name(runtime_cfg.get("dtype", "float32"))
|
|
57
|
+
|
|
58
|
+
name = model_cfg["name_or_path"]
|
|
59
|
+
trust_remote_code = bool(model_cfg.get("trust_remote_code", True))
|
|
60
|
+
hf_token = model_cfg.get("hf_token")
|
|
61
|
+
cache_dir = model_cfg.get("cache_dir")
|
|
62
|
+
device_map = runtime_cfg.get("device_map")
|
|
63
|
+
if device_map is None:
|
|
64
|
+
if ctx.device.type == "cpu":
|
|
65
|
+
device_map = "cpu"
|
|
66
|
+
else:
|
|
67
|
+
# Use specific device index instead of "auto" to avoid
|
|
68
|
+
# multi-GPU model split during PTQ calibration.
|
|
69
|
+
device_map = str(ctx.device)
|
|
70
|
+
|
|
71
|
+
ctx.processor = AutoProcessor.from_pretrained(
|
|
72
|
+
name,
|
|
73
|
+
trust_remote_code=trust_remote_code,
|
|
74
|
+
token=hf_token,
|
|
75
|
+
cache_dir=cache_dir,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
try:
|
|
79
|
+
from transformers import AutoModelForImageTextToText
|
|
80
|
+
|
|
81
|
+
ctx.model = AutoModelForImageTextToText.from_pretrained(
|
|
82
|
+
name,
|
|
83
|
+
dtype=ctx.dtype,
|
|
84
|
+
trust_remote_code=trust_remote_code,
|
|
85
|
+
token=hf_token,
|
|
86
|
+
cache_dir=cache_dir,
|
|
87
|
+
device_map=device_map,
|
|
88
|
+
)
|
|
89
|
+
except Exception:
|
|
90
|
+
from transformers import AutoModelForVision2Seq
|
|
91
|
+
|
|
92
|
+
ctx.model = AutoModelForVision2Seq.from_pretrained(
|
|
93
|
+
name,
|
|
94
|
+
dtype=ctx.dtype,
|
|
95
|
+
trust_remote_code=trust_remote_code,
|
|
96
|
+
token=hf_token,
|
|
97
|
+
cache_dir=cache_dir,
|
|
98
|
+
device_map=device_map,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
ctx.model.eval()
|
|
102
|
+
self._disable_cache(ctx.model)
|
|
103
|
+
assert_gemma4_e2b_no_moe(ctx.model)
|
|
104
|
+
return ctx
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
def _disable_cache(model: Any) -> None:
|
|
108
|
+
"""Disable HF dynamic cache paths during PTQ calibration."""
|
|
109
|
+
if hasattr(model, "config") and hasattr(model.config, "use_cache"):
|
|
110
|
+
model.config.use_cache = False
|
|
111
|
+
text_config = getattr(getattr(model, "config", None), "text_config", None)
|
|
112
|
+
if text_config is not None and hasattr(text_config, "use_cache"):
|
|
113
|
+
text_config.use_cache = False
|
|
114
|
+
|
|
115
|
+
@staticmethod
|
|
116
|
+
def _static_calibration_image_size(
|
|
117
|
+
cfg: Mapping[str, Any],
|
|
118
|
+
) -> tuple[int, int] | None:
|
|
119
|
+
"""Return the configured static image size for calibration samples."""
|
|
120
|
+
model_args = cfg.get("model_args", {})
|
|
121
|
+
if not isinstance(model_args, Mapping):
|
|
122
|
+
return None
|
|
123
|
+
|
|
124
|
+
vision_cfg = model_args.get("vision", {})
|
|
125
|
+
if not isinstance(vision_cfg, Mapping):
|
|
126
|
+
return None
|
|
127
|
+
|
|
128
|
+
height = vision_cfg.get("image_height")
|
|
129
|
+
width = vision_cfg.get("image_width")
|
|
130
|
+
if height is None and width is None:
|
|
131
|
+
return None
|
|
132
|
+
if height is None or width is None:
|
|
133
|
+
raise ValueError(
|
|
134
|
+
"Both model_args.vision.image_height and "
|
|
135
|
+
"model_args.vision.image_width must be set for static Gemma4 "
|
|
136
|
+
"calibration resizing."
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
parsed_height = int(height)
|
|
140
|
+
parsed_width = int(width)
|
|
141
|
+
if parsed_height <= 0 or parsed_width <= 0:
|
|
142
|
+
raise ValueError(
|
|
143
|
+
"Gemma4 static calibration image dimensions must be positive: "
|
|
144
|
+
f"image_height={parsed_height}, image_width={parsed_width}."
|
|
145
|
+
)
|
|
146
|
+
return parsed_height, parsed_width
|
|
147
|
+
|
|
148
|
+
@staticmethod
|
|
149
|
+
@contextmanager
|
|
150
|
+
def _fixed_image_processor_size(
|
|
151
|
+
processor: Any,
|
|
152
|
+
image_size: tuple[int, int] | None,
|
|
153
|
+
) -> Iterator[None]:
|
|
154
|
+
"""Temporarily force processor image resizing for static calibration."""
|
|
155
|
+
if image_size is None:
|
|
156
|
+
yield
|
|
157
|
+
return
|
|
158
|
+
|
|
159
|
+
image_processor = getattr(processor, "image_processor", None)
|
|
160
|
+
if image_processor is None:
|
|
161
|
+
yield
|
|
162
|
+
return
|
|
163
|
+
|
|
164
|
+
height, width = image_size
|
|
165
|
+
updates: dict[str, Any] = {
|
|
166
|
+
"do_resize": True,
|
|
167
|
+
"size": {"height": height, "width": width},
|
|
168
|
+
}
|
|
169
|
+
if hasattr(image_processor, "crop_size"):
|
|
170
|
+
updates["crop_size"] = {"height": height, "width": width}
|
|
171
|
+
|
|
172
|
+
originals: dict[str, tuple[bool, Any]] = {}
|
|
173
|
+
for attr, value in updates.items():
|
|
174
|
+
originals[attr] = (
|
|
175
|
+
hasattr(image_processor, attr),
|
|
176
|
+
getattr(image_processor, attr, None),
|
|
177
|
+
)
|
|
178
|
+
setattr(image_processor, attr, value)
|
|
179
|
+
|
|
180
|
+
try:
|
|
181
|
+
yield
|
|
182
|
+
finally:
|
|
183
|
+
for attr, (had_attr, original) in originals.items():
|
|
184
|
+
if had_attr:
|
|
185
|
+
setattr(image_processor, attr, original)
|
|
186
|
+
elif hasattr(image_processor, attr):
|
|
187
|
+
delattr(image_processor, attr)
|
|
188
|
+
|
|
189
|
+
def build_calibration_inputs(self, ctx: RecipeContext) -> list[dict]:
|
|
190
|
+
"""Build VLM calibration inputs for fixed image-text PTQ."""
|
|
191
|
+
calib = ctx.cfg.get("calibration", {})
|
|
192
|
+
runtime = ctx.cfg.get("runtime", {})
|
|
193
|
+
image_size = self._static_calibration_image_size(ctx.cfg)
|
|
194
|
+
with self._fixed_image_processor_size(ctx.processor, image_size):
|
|
195
|
+
return build_vlm_calibration_inputs(
|
|
196
|
+
processor=ctx.processor,
|
|
197
|
+
dataset=calib.get("dataset", "vqav2"),
|
|
198
|
+
datasets=calib.get("datasets"),
|
|
199
|
+
n_samples=int(calib.get("n_samples", 128)),
|
|
200
|
+
split=calib.get("split", "testdev"),
|
|
201
|
+
max_seq_len=calib.get("seq_len"),
|
|
202
|
+
seed=int(runtime.get("seed", 42)),
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
def forward_calibration(
|
|
206
|
+
self,
|
|
207
|
+
ctx: RecipeContext,
|
|
208
|
+
model: torch.nn.Module,
|
|
209
|
+
calibration_inputs: Sequence[Any],
|
|
210
|
+
*,
|
|
211
|
+
desc: str,
|
|
212
|
+
) -> None:
|
|
213
|
+
"""Run calibration samples through the prepared Gemma4 model."""
|
|
214
|
+
show_progress = bool(ctx.cfg.get("runtime", {}).get("show_progress", True))
|
|
215
|
+
iterator = tqdm.tqdm(calibration_inputs, desc=desc, disable=not show_progress)
|
|
216
|
+
model.eval()
|
|
217
|
+
with torch.no_grad():
|
|
218
|
+
for batch in iterator:
|
|
219
|
+
model(**move_to_device(batch, ctx.device))
|
|
220
|
+
|
|
221
|
+
def calibrate_prepared_model(
|
|
222
|
+
self,
|
|
223
|
+
ctx: RecipeContext,
|
|
224
|
+
prepared_model: torch.nn.Module,
|
|
225
|
+
stage_cfg: Mapping[str, Any],
|
|
226
|
+
) -> None:
|
|
227
|
+
"""Calibrate a prepared PTQ model."""
|
|
228
|
+
self.forward_calibration(
|
|
229
|
+
ctx, prepared_model, ctx.calibration_inputs, desc="Gemma4 PTQ calibration"
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
def build_ptq_config(self, ctx: RecipeContext, stage_cfg: Mapping[str, Any]):
|
|
233
|
+
"""Build the Gemma4 E2B PTQConfig from recipe stage settings."""
|
|
234
|
+
text_config = ctx.model.config.get_text_config()
|
|
235
|
+
vision_config = ctx.model.config.vision_config
|
|
236
|
+
model_args = dict(ctx.cfg.get("model_args", {}))
|
|
237
|
+
|
|
238
|
+
return build_gemma4_e2b_ptq_config(
|
|
239
|
+
num_text_layers=int(text_config.num_hidden_layers),
|
|
240
|
+
num_vision_layers=int(vision_config.num_hidden_layers),
|
|
241
|
+
model_args=model_args,
|
|
242
|
+
activation=quant_spec_from_config(stage_cfg.get("activation", "int16")),
|
|
243
|
+
weight=quant_spec_from_config(stage_cfg.get("weight")),
|
|
244
|
+
linear_weight=quant_spec_from_config(stage_cfg.get("linear_weight")),
|
|
245
|
+
embedding_weight=quant_spec_from_config(stage_cfg.get("embedding_weight")),
|
|
246
|
+
lm_head_weight=quant_spec_from_config(stage_cfg.get("lm_head_weight")),
|
|
247
|
+
vision_patch_embed_weight=quant_spec_from_config(
|
|
248
|
+
stage_cfg.get("vision_patch_embed_weight")
|
|
249
|
+
),
|
|
250
|
+
norm_weight=quant_spec_from_config(stage_cfg.get("norm_weight")),
|
|
251
|
+
strict_wrap=bool(stage_cfg.get("strict_wrap", True)),
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
def apply_ptq(
|
|
255
|
+
self, ctx: RecipeContext, stage_cfg: Mapping[str, Any]
|
|
256
|
+
) -> torch.nn.Module:
|
|
257
|
+
"""Prepare, calibrate, and convert Gemma4 E2B with PTQ."""
|
|
258
|
+
qcfg = self.build_ptq_config(ctx, stage_cfg)
|
|
259
|
+
prepared = prepare(
|
|
260
|
+
ctx.require_model(), qcfg, inplace=bool(stage_cfg.get("inplace", True))
|
|
261
|
+
)
|
|
262
|
+
self.calibrate_prepared_model(ctx, prepared, stage_cfg)
|
|
263
|
+
return convert(prepared, inplace=True)
|
|
264
|
+
|
|
265
|
+
def evaluate(self, ctx: RecipeContext) -> None:
|
|
266
|
+
"""Evaluate Gemma4 E2B via LLaVA-Bench judge and other VLM tasks."""
|
|
267
|
+
eval_cfg = ctx.cfg.get("evaluation", {})
|
|
268
|
+
if not eval_cfg.get("enabled", False):
|
|
269
|
+
return
|
|
270
|
+
|
|
271
|
+
max_seq_len = eval_cfg.get("max_seq_len")
|
|
272
|
+
n_samples = int(eval_cfg.get("n_samples", 50))
|
|
273
|
+
|
|
274
|
+
llava_bench_cfg = eval_cfg.get("llava_bench", False)
|
|
275
|
+
if isinstance(llava_bench_cfg, Mapping):
|
|
276
|
+
if llava_bench_cfg.get("enabled", False):
|
|
277
|
+
mode = str(llava_bench_cfg.get("mode", "judge")).lower()
|
|
278
|
+
if mode in {"judge", "llm_judge"}:
|
|
279
|
+
evaluate_and_print_llava_bench_judge(
|
|
280
|
+
model=ctx.model,
|
|
281
|
+
processor=ctx.processor,
|
|
282
|
+
device=str(ctx.device),
|
|
283
|
+
llava_cfg=llava_bench_cfg,
|
|
284
|
+
model_cfg=ctx.cfg.get("model", {}),
|
|
285
|
+
runtime_cfg=ctx.cfg.get("runtime", {}),
|
|
286
|
+
default_n_samples=n_samples,
|
|
287
|
+
default_max_seq_len=max_seq_len,
|
|
288
|
+
)
|
|
289
|
+
elif mode in {"legacy", "coco", "caption"}:
|
|
290
|
+
llava_results = evaluate_llava_bench(
|
|
291
|
+
model=ctx.model,
|
|
292
|
+
processor=ctx.processor,
|
|
293
|
+
device=str(ctx.device),
|
|
294
|
+
n_samples=int(llava_bench_cfg.get("n_samples", n_samples)),
|
|
295
|
+
max_seq_len=llava_bench_cfg.get("max_seq_len", max_seq_len),
|
|
296
|
+
)
|
|
297
|
+
print_coco_score_results(
|
|
298
|
+
"\n=== LLaVA Bench Legacy COCO-style Evaluation ===",
|
|
299
|
+
llava_results,
|
|
300
|
+
)
|
|
301
|
+
else:
|
|
302
|
+
raise ValueError(
|
|
303
|
+
"evaluation.llava_bench.mode must be one of "
|
|
304
|
+
"{'judge', 'llm_judge', 'legacy', 'coco', 'caption'}, "
|
|
305
|
+
f"got {mode!r}."
|
|
306
|
+
)
|
|
307
|
+
elif llava_bench_cfg:
|
|
308
|
+
print(
|
|
309
|
+
"[WARNING] evaluation.llava_bench=true uses the legacy "
|
|
310
|
+
"COCO-style CIDEr/BLEU path. Prefer the nested judge config: "
|
|
311
|
+
"evaluation.llava_bench.enabled=true, mode=judge."
|
|
312
|
+
)
|
|
313
|
+
llava_results = evaluate_llava_bench(
|
|
314
|
+
model=ctx.model,
|
|
315
|
+
processor=ctx.processor,
|
|
316
|
+
device=str(ctx.device),
|
|
317
|
+
n_samples=n_samples,
|
|
318
|
+
max_seq_len=max_seq_len,
|
|
319
|
+
)
|
|
320
|
+
print_coco_score_results("\n=== Llava Bench Evaluation ===", llava_results)
|
|
321
|
+
|
|
322
|
+
def export(self, ctx: RecipeContext) -> None:
|
|
323
|
+
"""Export Gemma4 E2B artifacts.
|
|
324
|
+
|
|
325
|
+
TODO: Implement Circle export via the static runtime submodule adapters.
|
|
326
|
+
"""
|
|
327
|
+
export_cfg = ctx.cfg.get("export", {})
|
|
328
|
+
if not export_cfg.get("enabled", False):
|
|
329
|
+
return
|
|
330
|
+
raise NotImplementedError("Gemma4 E2B export adapter is not wired yet.")
|
|
@@ -212,7 +212,7 @@ class LlamaAdapter(ModelAdapter):
|
|
|
212
212
|
seq_len=seq_len,
|
|
213
213
|
seed=int(runtime.get("seed", 42)),
|
|
214
214
|
device=ctx.device,
|
|
215
|
-
dataset_name=calib.get("dataset", "wikitext"),
|
|
215
|
+
dataset_name=calib.get("dataset", "Salesforce/wikitext"),
|
|
216
216
|
dataset_config=calib.get("dataset_config", "wikitext-2-raw-v1"),
|
|
217
217
|
split=calib.get("split", "train"),
|
|
218
218
|
)
|
|
@@ -326,7 +326,7 @@ class LlamaAdapter(ModelAdapter):
|
|
|
326
326
|
device=str(ctx.device),
|
|
327
327
|
cache_dir=ctx.cfg.get("model", {}).get("cache_dir"),
|
|
328
328
|
max_seq_len=max_seq_len,
|
|
329
|
-
dataset_name=ppl_cfg.get("dataset", "wikitext"),
|
|
329
|
+
dataset_name=ppl_cfg.get("dataset", "Salesforce/wikitext"),
|
|
330
330
|
dataset_config=ppl_cfg.get("dataset_config", "wikitext-2-raw-v1"),
|
|
331
331
|
split=ppl_cfg.get("split", "test"),
|
|
332
332
|
)
|
|
@@ -27,7 +27,7 @@ def build_wikitext_calibration_inputs(
|
|
|
27
27
|
seq_len: int,
|
|
28
28
|
seed: int,
|
|
29
29
|
device: torch.device | str,
|
|
30
|
-
dataset_name: str = "wikitext",
|
|
30
|
+
dataset_name: str = "Salesforce/wikitext",
|
|
31
31
|
dataset_config: str = "wikitext-2-raw-v1",
|
|
32
32
|
split: str = "train",
|
|
33
33
|
) -> list[torch.Tensor]:
|
|
@@ -464,14 +464,14 @@ class QwenTextMLPCase(QwenBaseCase):
|
|
|
464
464
|
return ForwardInput((torch.randn(2, 8, self.text_cfg.hidden_size),))
|
|
465
465
|
|
|
466
466
|
|
|
467
|
-
class
|
|
468
|
-
"""
|
|
467
|
+
class QwenTextDecoderLayerBaseCase(QwenBaseCase):
|
|
468
|
+
"""Base class for Qwen3-VL text decoder-layer smoke cases."""
|
|
469
469
|
|
|
470
|
-
|
|
471
|
-
description = "Quantize one tiny Qwen3-VL text decoder layer."
|
|
472
|
-
tags = ("qwen3_vl", "text", "decoder_layer")
|
|
470
|
+
tags: tuple[str, ...] = ("qwen3_vl", "text", "decoder_layer")
|
|
473
471
|
max_mean_abs_diff = 3.0
|
|
474
472
|
inplace_convert = True
|
|
473
|
+
seq_len = 8
|
|
474
|
+
export_mode = "prefill"
|
|
475
475
|
|
|
476
476
|
def build(self, cfg: Mapping[str, Any]) -> tuple[torch.nn.Module, torch.nn.Module]:
|
|
477
477
|
"""Build a tiny text decoder layer and reference copy."""
|
|
@@ -484,16 +484,92 @@ class QwenTextDecoderLayerCase(QwenBaseCase):
|
|
|
484
484
|
module = Qwen3VLTextDecoderLayer(self.text_cfg, layer_idx=0).eval()
|
|
485
485
|
return module, clone_module(module)
|
|
486
486
|
|
|
487
|
+
def export_module(
|
|
488
|
+
self, quantized: torch.nn.Module, cfg: Mapping[str, Any]
|
|
489
|
+
) -> torch.nn.Module:
|
|
490
|
+
"""Export the wrapped text decoder layer in the case-specific mode."""
|
|
491
|
+
wrapped = getattr(quantized, "wrapped", quantized)
|
|
492
|
+
return (
|
|
493
|
+
wrapped.as_export_module(self.export_mode).eval()
|
|
494
|
+
if hasattr(wrapped, "as_export_module")
|
|
495
|
+
else quantized
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
class QwenTextDecoderLayerPrefillCase(QwenTextDecoderLayerBaseCase):
|
|
500
|
+
"""Smoke case for the Qwen3-VL text decoder-layer prefill wrapper path."""
|
|
501
|
+
|
|
502
|
+
name = "qwen3_vl_text_decoder_layer_prefill"
|
|
503
|
+
description = "Quantize one tiny Qwen3-VL text decoder layer in prefill mode."
|
|
504
|
+
tags = ("qwen3_vl", "text", "decoder_layer", "prefill")
|
|
505
|
+
export_mode = "prefill"
|
|
506
|
+
|
|
487
507
|
def _sample(self) -> ForwardInput:
|
|
488
|
-
"""Create one synthetic text decoder-layer input."""
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
508
|
+
"""Create one synthetic text decoder-layer prefill input."""
|
|
509
|
+
hidden = torch.randn(1, self.seq_len, self.text_cfg.hidden_size)
|
|
510
|
+
pos = _text_rope(1, self.seq_len, self.text_cfg.head_dim)
|
|
511
|
+
mask = _causal_mask(self.seq_len)
|
|
512
|
+
position_ids = torch.arange(self.seq_len).unsqueeze(0)
|
|
513
|
+
return ForwardInput(
|
|
514
|
+
(),
|
|
515
|
+
{
|
|
516
|
+
"hidden_states": hidden,
|
|
517
|
+
"position_embeddings": pos,
|
|
518
|
+
"attention_mask": mask,
|
|
519
|
+
"position_ids": position_ids,
|
|
520
|
+
},
|
|
494
521
|
)
|
|
495
|
-
|
|
496
|
-
|
|
522
|
+
|
|
523
|
+
def calibration_inputs(
|
|
524
|
+
self, prepared: torch.nn.Module, cfg: Mapping[str, Any]
|
|
525
|
+
) -> list[ForwardInput]:
|
|
526
|
+
"""Create text decoder-layer prefill calibration samples."""
|
|
527
|
+
return [self._sample() for _ in range(5)]
|
|
528
|
+
|
|
529
|
+
def eval_input(
|
|
530
|
+
self, prepared: torch.nn.Module, cfg: Mapping[str, Any]
|
|
531
|
+
) -> ForwardInput:
|
|
532
|
+
"""Create the text decoder-layer prefill evaluation sample."""
|
|
533
|
+
return self._sample()
|
|
534
|
+
|
|
535
|
+
def export_input(
|
|
536
|
+
self, eval_sample: ForwardInput, cfg: Mapping[str, Any]
|
|
537
|
+
) -> ForwardInput:
|
|
538
|
+
"""Create positional prefill inputs expected by the export adapter."""
|
|
539
|
+
hidden = eval_sample.kwargs["hidden_states"]
|
|
540
|
+
mask = eval_sample.kwargs["attention_mask"]
|
|
541
|
+
pos = eval_sample.kwargs["position_embeddings"]
|
|
542
|
+
return ForwardInput((hidden, mask, pos))
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
class QwenTextDecoderLayerDecodeCase(QwenTextDecoderLayerBaseCase):
|
|
546
|
+
"""Smoke case for the Qwen3-VL text decoder-layer decode wrapper path."""
|
|
547
|
+
|
|
548
|
+
name = "qwen3_vl_text_decoder_layer_decode"
|
|
549
|
+
description = "Quantize one tiny Qwen3-VL text decoder layer in static decode mode."
|
|
550
|
+
tags = ("qwen3_vl", "text", "decoder_layer", "decode")
|
|
551
|
+
compare_reference_source = "prepared"
|
|
552
|
+
export_mode = "decode"
|
|
553
|
+
|
|
554
|
+
def after_prepare(self, prepared: torch.nn.Module, cfg: Mapping[str, Any]) -> None:
|
|
555
|
+
"""Force tuple return so hidden states and cache tensors are available."""
|
|
556
|
+
wrapped = getattr(prepared, "wrapped", prepared)
|
|
557
|
+
if hasattr(wrapped, "return_type"):
|
|
558
|
+
wrapped.return_type = "tuple"
|
|
559
|
+
|
|
560
|
+
def _sample(self) -> ForwardInput:
|
|
561
|
+
"""Create one synthetic static decode text decoder-layer input."""
|
|
562
|
+
hidden = torch.randn(1, 1, self.text_cfg.hidden_size)
|
|
563
|
+
pos = _text_rope(1, 1, self.text_cfg.head_dim)
|
|
564
|
+
mask = torch.zeros(1, 1, 1, self.seq_len)
|
|
565
|
+
position_ids = torch.full((1, 1), self.seq_len - 1, dtype=torch.long)
|
|
566
|
+
past_k = torch.randn(
|
|
567
|
+
1,
|
|
568
|
+
self.text_cfg.num_key_value_heads,
|
|
569
|
+
self.seq_len - 1,
|
|
570
|
+
self.text_cfg.head_dim,
|
|
571
|
+
)
|
|
572
|
+
past_v = torch.randn_like(past_k)
|
|
497
573
|
return ForwardInput(
|
|
498
574
|
(),
|
|
499
575
|
{
|
|
@@ -501,21 +577,33 @@ class QwenTextDecoderLayerCase(QwenBaseCase):
|
|
|
501
577
|
"position_embeddings": pos,
|
|
502
578
|
"attention_mask": mask,
|
|
503
579
|
"position_ids": position_ids,
|
|
580
|
+
"past_key_values": (past_k, past_v),
|
|
581
|
+
"use_cache": True,
|
|
504
582
|
},
|
|
505
583
|
)
|
|
506
584
|
|
|
507
585
|
def calibration_inputs(
|
|
508
586
|
self, prepared: torch.nn.Module, cfg: Mapping[str, Any]
|
|
509
587
|
) -> list[ForwardInput]:
|
|
510
|
-
"""Create text decoder-layer calibration samples."""
|
|
588
|
+
"""Create text decoder-layer decode calibration samples."""
|
|
511
589
|
return [self._sample() for _ in range(3)]
|
|
512
590
|
|
|
513
591
|
def eval_input(
|
|
514
592
|
self, prepared: torch.nn.Module, cfg: Mapping[str, Any]
|
|
515
593
|
) -> ForwardInput:
|
|
516
|
-
"""Create the text decoder-layer evaluation sample."""
|
|
594
|
+
"""Create the text decoder-layer decode evaluation sample."""
|
|
517
595
|
return self._sample()
|
|
518
596
|
|
|
597
|
+
def export_input(
|
|
598
|
+
self, eval_sample: ForwardInput, cfg: Mapping[str, Any]
|
|
599
|
+
) -> ForwardInput:
|
|
600
|
+
"""Create positional static decode inputs expected by the export adapter."""
|
|
601
|
+
hidden = eval_sample.kwargs["hidden_states"]
|
|
602
|
+
mask = eval_sample.kwargs["attention_mask"]
|
|
603
|
+
pos = eval_sample.kwargs["position_embeddings"]
|
|
604
|
+
past = eval_sample.kwargs["past_key_values"]
|
|
605
|
+
return ForwardInput((hidden, mask, pos, past))
|
|
606
|
+
|
|
519
607
|
|
|
520
608
|
class QwenTextModelCase(QwenBaseCase):
|
|
521
609
|
"""Smoke case for qwen/quantize_text_model.py."""
|
|
@@ -871,7 +959,8 @@ QWEN3_VL_CASES: tuple[WrapperSmokeCase, ...] = (
|
|
|
871
959
|
QwenTextAttentionPrefillCase(),
|
|
872
960
|
QwenTextAttentionDecodeCase(),
|
|
873
961
|
QwenTextMLPCase(),
|
|
874
|
-
|
|
962
|
+
QwenTextDecoderLayerPrefillCase(),
|
|
963
|
+
QwenTextDecoderLayerDecodeCase(),
|
|
875
964
|
QwenTextModelCase(),
|
|
876
965
|
QwenVisionAttentionCase(),
|
|
877
966
|
QwenVisionMLPCase(),
|