tico 0.2.0.dev260706__tar.gz → 0.2.0.dev260708__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.dev260706 → tico-0.2.0.dev260708}/PKG-INFO +1 -1
- tico-0.2.0.dev260708/tico/_version.py +1 -0
- tico-0.2.0.dev260708/tico/quantization/config/gemma4_builders.py +344 -0
- tico-0.2.0.dev260708/tico/quantization/config/qwen3_vl_attention.py +199 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/vlm_eval_utils.py +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/__init__.py +2 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/gemma4.py +75 -6
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/llama.py +2 -2
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/config.py +104 -18
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/data/llm.py +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/qwen3_vl.py +90 -15
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/llm.py +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/compare_ppl.py +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/debug_quant_outputs.py +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/quantize_full_qmodel_with_gptq.py +6 -4
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/quantize_with_gptq.py +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_model.py +6 -4
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_attention.py +49 -2
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder.py +3 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/utils.py +10 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/export_adapters.py +110 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_attention.py +277 -64
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/PKG-INFO +1 -1
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/SOURCES.txt +2 -1
- tico-0.2.0.dev260706/tico/_version.py +0 -1
- tico-0.2.0.dev260706/tico/quantization/config/gemma4_builders.py +0 -137
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/LICENSE +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/README.md +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/pyproject.toml +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/setup.cfg +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/factory.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/v1.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/experimental/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/interpreter/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/interpreter/infer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/interpreter/interpreter.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/cast_aten_where_arg_type.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/cast_clamp_mixed_type_args.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/cast_mixed_type_args.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/const_prop_pass.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_conv1d_to_conv2d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_conv3d_to_conv2d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_expand_to_slice_cat.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_gather_to_gather_nd.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_layout_op_to_reshape.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_matmul_to_linear.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_repeat_to_expand_copy.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_sym_size_to_circle_shape.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_to_relu6.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_addmm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_batch_norm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_fake_quantize.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_fake_quantize_tensor_qparams.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_group_norm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_grouped_conv2d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_slice_scatter.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/eliminate_rank_round_trip_region.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/extract_dtype_kwargs.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/fill_meta_val.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/fuse_leading_unsqueeze_reshape.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/fuse_redundant_reshape_to_mean.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/legalize_causal_mask_value.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/legalize_predefined_layout_operators.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_copy.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_pow2_to_mul.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_to_resize_nearest_neighbor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_to_slice.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/merge_consecutive_cat.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/ops.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_nop.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_assert_nodes.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_expand.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_permute.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_reshape.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_slice.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_to_copy.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_unused_placeholder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/restore_linear.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/segment_index_select.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/pt2_to_circle.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/cle/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/cle/cle.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/cle/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/fpi_gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/util.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/quant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/observer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/smooth_quant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/fuse_norm_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/hadamard_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/qwen3_vl_model_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/qwen3_vl_quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/qwen3_vl_rotation_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/rotation_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/spin_llama.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/spin_qwen3_vl.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/builders.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/cle.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/fpi_gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/llama_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/ptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/qwen3_vl_gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/qwen3_vl_spinquant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/smoothquant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/specs.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/spinquant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/backend.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/evaluate.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/backend_executor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/circle_executor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/triv24_executor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/hellaswag_eval_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/llava_bench_judge_eval_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/lmms_eval_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/lmms_tasks/videomme_mini/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/metric.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/mmlu_eval_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/mmmu_eval_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/optional_deps.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/script/llm_tasks_eval.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/script/mini_vqa_eval.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/configs/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/evaluate.py +0 -0
- /tico-0.2.0.dev260706/tico/quantization/examples/inspect.py → /tico-0.2.0.dev260708/tico/quantization/examples/inspector.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/quantize.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/fold_quant_ops.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/insert_quantize_on_dtype_mismatch.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/propagate_qparam_backward.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/propagate_qparam_forward.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/qparam_safe_const_prop.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/quantize_bias.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/remove_weight_dequant_op.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/public_interface.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/quantizer_registry.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/qwen3_vl.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/context.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/data/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/data/vlm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/static_gemma4_runtime.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/static_llama_runtime.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/static_qwen3_vl_runtime.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/tied_embedding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/trace.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/case.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/gemma4.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/llama.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/nn.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/registry.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/result.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/runner.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/hellaswag.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/llava_bench_judge.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/mmlu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/mmmu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/video_mme.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/vlm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/checkpoint.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/circle.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/llama.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/qparams.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/runner.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/cle.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/ptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/smoothquant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/spinquant.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/dtypes.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/evaluate_fk_llama_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_for_causal_lm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_multimodal_embedder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_text_scaled_word_embedding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_vision_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_vision_patch_embedder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_vision_pooler.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_attention_decode.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_attention_prefill.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_decode.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_prefill.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_conv3d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_conv3d_special_case.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_layernorm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_linear.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_tied_embedding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/quantize_qwen3_vl_with_gptq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_decoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_block.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_embed.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_merger.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/trace_qwen.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/static_llama_layer_runtime.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/mode.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/affine_base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/ema.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/identity.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/minmax.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/mx.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/qscheme.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/quantizer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/check_missing_qparam.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/introspection.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/metrics.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/reduce_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/version.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrap_helper.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/decoder_export_single_step.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_mha.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/export_adapters.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_clippable_linear.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_for_causal_lm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_multimodal_embedder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_rmsnorm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_decoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_scaled_word_embedding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_patch_embedder.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_pooler.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/export_adapters.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_decoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_model_for_causal_lm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_conv3d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_conv3d_decomposed.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_embedding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_layernorm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_linear.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_silu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/ops/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/ops/quant_rmsnorm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/ptq_wrapper.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/quant_elementwise.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/quant_module_base.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_for_conditional_generation.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_decoder_layer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_block.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_mlp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_embed.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_merger.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/registry.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/circle_graph.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/circle_mapping.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/circle_serializer.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/llama_rmsnorm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/onert/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/onert/llama_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/hashable_opcode.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/node_visitor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_abs.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_add.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_alias_copy.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_any.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_arange_start_step.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_argmax.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_attention.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_avg_pool2d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_bmm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_cat.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_circle_gather_nd.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_circle_shape.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_clamp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_clone.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_constant_pad_nd.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_conv2d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_cos.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_cumsum.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_depthwise_conv2d.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_dequantize_per_channel.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_dequantize_per_tensor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_div.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_elu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_embedding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_eq.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_exp.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_expand.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_full.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_full_like.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_ge.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_gelu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_gt.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_index.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_index_select.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_instance_norm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_le.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_leaky_relu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_linear.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_log.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_log1p.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_logical_and.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_logical_not.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_lt.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_max_dim.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_max_pool2d_with_indices.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_maximum.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_mean.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_minimum.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_mm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_mul.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_ne.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_neg.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_permute.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_pow.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_prelu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_quantize_per_tensor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_reciprocal.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_relu.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_relu6.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_repeat.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_reshape.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_resize_nearest_neighbor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_rmsnorm.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_round.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_rsqrt.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_scalar_tensor.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_select_copy.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sigmoid.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sin.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_slice.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_softmax.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_split_with_sizes.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sqrt.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_squeeze.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sub.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sum.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_tanh.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_to_copy.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_transpose_conv.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_unsqueeze.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_view.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_where.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/pack.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/quant_param.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/compat/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/compat/torch.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/compat/transformers.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/convert.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/define.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/diff_graph.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/dtype.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/errors.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/graph.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/installed_packages.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/logging.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/model.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/__init__.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/dtypes.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/elemwise_ops.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/formats.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/mx_ops.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/padding.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/passes.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/pytree_utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/record_input.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/register_custom_op.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/serialize.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/signature.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/trace_decorators.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/utils.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/validate_args_kwargs.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/version.py +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/dependency_links.txt +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/entry_points.txt +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/requires.txt +0 -0
- {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.0.dev260708"
|
|
@@ -0,0 +1,344 @@
|
|
|
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
|
+
import copy
|
|
16
|
+
from typing import Any, Dict, Mapping, Optional
|
|
17
|
+
|
|
18
|
+
from tico.quantization.config.ptq import PTQConfig
|
|
19
|
+
from tico.quantization.config.specs import affine, QuantSpec
|
|
20
|
+
from tico.quantization.wrapq.dtypes import DType
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _default_activation() -> QuantSpec:
|
|
24
|
+
"""Return the default Gemma4 activation quantization spec."""
|
|
25
|
+
return affine(DType.int(16))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _default_weight() -> QuantSpec:
|
|
29
|
+
"""Return the default Gemma4 weight quantization spec."""
|
|
30
|
+
return affine(DType.int(16))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _weight_override(spec: Optional[QuantSpec]) -> Dict[str, Any]:
|
|
34
|
+
"""Build a weight observer override for a module."""
|
|
35
|
+
if spec is None:
|
|
36
|
+
return {}
|
|
37
|
+
return {"weight": spec.to_kwargs("weight", context="weight", mark_replace=True)}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _set_nested(
|
|
41
|
+
root: Dict[str, Any], path: tuple[str, ...], value: Dict[str, Any]
|
|
42
|
+
) -> None:
|
|
43
|
+
"""Set a nested override dictionary."""
|
|
44
|
+
curr = root
|
|
45
|
+
for key in path[:-1]:
|
|
46
|
+
curr = curr.setdefault(key, {})
|
|
47
|
+
curr[path[-1]] = copy.deepcopy(value)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _linear_tree_override(
|
|
51
|
+
linear_weight: Optional[QuantSpec], names: tuple[str, ...]
|
|
52
|
+
) -> Dict[str, Any]:
|
|
53
|
+
"""Build a tree of linear weight overrides."""
|
|
54
|
+
root: Dict[str, Any] = {}
|
|
55
|
+
override = _weight_override(linear_weight)
|
|
56
|
+
if not override:
|
|
57
|
+
return root
|
|
58
|
+
for name in names:
|
|
59
|
+
_set_nested(root, (name,), override)
|
|
60
|
+
return root
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _deep_merge(base: Mapping[str, Any], overlay: Mapping[str, Any]) -> Dict[str, Any]:
|
|
64
|
+
"""Return ``base`` recursively merged with ``overlay``."""
|
|
65
|
+
out: Dict[str, Any] = copy.deepcopy(dict(base))
|
|
66
|
+
for key, value in overlay.items():
|
|
67
|
+
if isinstance(value, Mapping) and isinstance(out.get(key), Mapping):
|
|
68
|
+
out[key] = _deep_merge(out[key], value)
|
|
69
|
+
else:
|
|
70
|
+
out[key] = copy.deepcopy(value)
|
|
71
|
+
return out
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _gemma4_text_attention_override(
|
|
75
|
+
linear_weight: Optional[QuantSpec],
|
|
76
|
+
norm_weight: Optional[QuantSpec],
|
|
77
|
+
) -> Dict[str, Any]:
|
|
78
|
+
"""Build overrides for Gemma4TextAttention.
|
|
79
|
+
|
|
80
|
+
HF structure:
|
|
81
|
+
q_proj, q_norm, k_proj, k_norm, v_proj, v_norm, o_proj
|
|
82
|
+
|
|
83
|
+
Some modules are absent for shared-KV or attention_k_eq_v variants. Extra
|
|
84
|
+
override keys are harmless because wrappers only consume matching children.
|
|
85
|
+
"""
|
|
86
|
+
result = _linear_tree_override(
|
|
87
|
+
linear_weight,
|
|
88
|
+
("q_proj", "k_proj", "v_proj", "o_proj"),
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
norm_override = _weight_override(norm_weight)
|
|
92
|
+
if norm_override:
|
|
93
|
+
for name in ("q_norm", "k_norm", "v_norm"):
|
|
94
|
+
result[name] = copy.deepcopy(norm_override)
|
|
95
|
+
|
|
96
|
+
return result
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _gemma4_text_layer_override(
|
|
100
|
+
linear_weight: Optional[QuantSpec],
|
|
101
|
+
norm_weight: Optional[QuantSpec],
|
|
102
|
+
) -> Dict[str, Any]:
|
|
103
|
+
"""Build overrides for one Gemma4TextDecoderLayer.
|
|
104
|
+
|
|
105
|
+
Mirrors the dense/no-MoE E2B text layer structure in HF:
|
|
106
|
+
self_attn
|
|
107
|
+
mlp
|
|
108
|
+
input_layernorm
|
|
109
|
+
post_attention_layernorm
|
|
110
|
+
pre_feedforward_layernorm
|
|
111
|
+
post_feedforward_layernorm
|
|
112
|
+
optional PLE modules
|
|
113
|
+
"""
|
|
114
|
+
layer: Dict[str, Any] = {
|
|
115
|
+
"self_attn": _gemma4_text_attention_override(linear_weight, norm_weight),
|
|
116
|
+
"mlp": _linear_tree_override(
|
|
117
|
+
linear_weight,
|
|
118
|
+
("gate_proj", "up_proj", "down_proj"),
|
|
119
|
+
),
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
norm_override = _weight_override(norm_weight)
|
|
123
|
+
if norm_override:
|
|
124
|
+
for name in (
|
|
125
|
+
"input_layernorm",
|
|
126
|
+
"post_attention_layernorm",
|
|
127
|
+
"pre_feedforward_layernorm",
|
|
128
|
+
"post_feedforward_layernorm",
|
|
129
|
+
# Optional PLE norm. Ignored when PLE is disabled.
|
|
130
|
+
"post_per_layer_input_norm",
|
|
131
|
+
):
|
|
132
|
+
layer[name] = copy.deepcopy(norm_override)
|
|
133
|
+
|
|
134
|
+
# Optional PLE linears. Ignored when hidden_size_per_layer_input == 0.
|
|
135
|
+
layer.update(
|
|
136
|
+
_linear_tree_override(
|
|
137
|
+
linear_weight,
|
|
138
|
+
("per_layer_input_gate", "per_layer_projection"),
|
|
139
|
+
)
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
return layer
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _gemma4_text_model_override(
|
|
146
|
+
*,
|
|
147
|
+
num_text_layers: int,
|
|
148
|
+
linear_weight: Optional[QuantSpec],
|
|
149
|
+
embedding_weight: Optional[QuantSpec],
|
|
150
|
+
norm_weight: Optional[QuantSpec],
|
|
151
|
+
) -> Dict[str, Any]:
|
|
152
|
+
"""Build overrides for Gemma4TextModel.
|
|
153
|
+
|
|
154
|
+
This tree is used directly by:
|
|
155
|
+
- Gemma4TextModel
|
|
156
|
+
- Gemma4ForCausalLM.model
|
|
157
|
+
|
|
158
|
+
It is also nested below ``language_model`` for Gemma4Model and
|
|
159
|
+
Gemma4ForConditionalGeneration.model.
|
|
160
|
+
"""
|
|
161
|
+
text: Dict[str, Any] = {
|
|
162
|
+
"embed_tokens": _weight_override(embedding_weight),
|
|
163
|
+
"layers": {},
|
|
164
|
+
"norm": _weight_override(norm_weight),
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
for idx in range(num_text_layers):
|
|
168
|
+
text["layers"][str(idx)] = _gemma4_text_layer_override(
|
|
169
|
+
linear_weight,
|
|
170
|
+
norm_weight,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
# Optional top-level PLE modules in Gemma4TextModel. These are ignored by
|
|
174
|
+
# wrappers when PLE is disabled, but let one builder follow the HF structure.
|
|
175
|
+
embedding_override = _weight_override(embedding_weight)
|
|
176
|
+
if embedding_override:
|
|
177
|
+
text["embed_tokens_per_layer"] = copy.deepcopy(embedding_override)
|
|
178
|
+
|
|
179
|
+
linear_override = _weight_override(linear_weight)
|
|
180
|
+
if linear_override:
|
|
181
|
+
text["per_layer_model_projection"] = copy.deepcopy(linear_override)
|
|
182
|
+
|
|
183
|
+
norm_override = _weight_override(norm_weight)
|
|
184
|
+
if norm_override:
|
|
185
|
+
text["per_layer_projection_norm"] = copy.deepcopy(norm_override)
|
|
186
|
+
|
|
187
|
+
return text
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _gemma4_vision_attention_override(
|
|
191
|
+
linear_weight: Optional[QuantSpec],
|
|
192
|
+
norm_weight: Optional[QuantSpec],
|
|
193
|
+
) -> Dict[str, Any]:
|
|
194
|
+
"""Build overrides for Gemma4VisionAttention."""
|
|
195
|
+
result = _linear_tree_override(
|
|
196
|
+
linear_weight,
|
|
197
|
+
("q_proj", "k_proj", "v_proj", "o_proj"),
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
norm_override = _weight_override(norm_weight)
|
|
201
|
+
if norm_override:
|
|
202
|
+
for name in ("q_norm", "k_norm", "v_norm"):
|
|
203
|
+
result[name] = copy.deepcopy(norm_override)
|
|
204
|
+
|
|
205
|
+
return result
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _gemma4_multimodal_embedder_override(
|
|
209
|
+
*,
|
|
210
|
+
linear_weight: Optional[QuantSpec],
|
|
211
|
+
norm_weight: Optional[QuantSpec],
|
|
212
|
+
) -> Dict[str, Any]:
|
|
213
|
+
"""Build overrides for Gemma4MultimodalEmbedder."""
|
|
214
|
+
result: Dict[str, Any] = {
|
|
215
|
+
"embedding_projection": _weight_override(linear_weight),
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
norm_override = _weight_override(norm_weight)
|
|
219
|
+
if norm_override:
|
|
220
|
+
result["embedding_pre_projection_norm"] = copy.deepcopy(norm_override)
|
|
221
|
+
|
|
222
|
+
return result
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def _gemma4_vision_model_override(
|
|
226
|
+
*,
|
|
227
|
+
num_vision_layers: int,
|
|
228
|
+
linear_weight: Optional[QuantSpec],
|
|
229
|
+
vision_patch_embed_weight: Optional[QuantSpec],
|
|
230
|
+
norm_weight: Optional[QuantSpec],
|
|
231
|
+
) -> Dict[str, Any]:
|
|
232
|
+
"""Build overrides for Gemma4VisionModel."""
|
|
233
|
+
vision: Dict[str, Any] = {
|
|
234
|
+
"patch_embedder": {
|
|
235
|
+
"input_proj": _weight_override(vision_patch_embed_weight or linear_weight)
|
|
236
|
+
},
|
|
237
|
+
"encoder": {"layers": {}},
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
norm_override = _weight_override(norm_weight)
|
|
241
|
+
for idx in range(num_vision_layers):
|
|
242
|
+
layer = {
|
|
243
|
+
"self_attn": _gemma4_vision_attention_override(linear_weight, norm_weight),
|
|
244
|
+
"mlp": _linear_tree_override(
|
|
245
|
+
linear_weight,
|
|
246
|
+
("gate_proj", "up_proj", "down_proj"),
|
|
247
|
+
),
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if norm_override:
|
|
251
|
+
for name in (
|
|
252
|
+
"input_layernorm",
|
|
253
|
+
"post_attention_layernorm",
|
|
254
|
+
"pre_feedforward_layernorm",
|
|
255
|
+
"post_feedforward_layernorm",
|
|
256
|
+
):
|
|
257
|
+
layer[name] = copy.deepcopy(norm_override)
|
|
258
|
+
|
|
259
|
+
vision["encoder"]["layers"][str(idx)] = layer
|
|
260
|
+
return vision
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def build_gemma4_e2b_ptq_config(
|
|
264
|
+
*,
|
|
265
|
+
num_text_layers: int,
|
|
266
|
+
num_vision_layers: int,
|
|
267
|
+
model_args: Optional[Mapping[str, Any]] = None,
|
|
268
|
+
activation: Optional[QuantSpec] = None,
|
|
269
|
+
weight: Optional[QuantSpec] = None,
|
|
270
|
+
linear_weight: Optional[QuantSpec] = None,
|
|
271
|
+
embedding_weight: Optional[QuantSpec] = None,
|
|
272
|
+
lm_head_weight: Optional[QuantSpec] = None,
|
|
273
|
+
vision_patch_embed_weight: Optional[QuantSpec] = None,
|
|
274
|
+
norm_weight: Optional[QuantSpec] = None,
|
|
275
|
+
strict_wrap: bool = True,
|
|
276
|
+
) -> PTQConfig:
|
|
277
|
+
"""Build a PTQConfig for Gemma4 E2B static image-text runtime.
|
|
278
|
+
|
|
279
|
+
The returned config is intentionally conservative. It assigns default
|
|
280
|
+
activation and weight specs globally, then adds explicit weight overrides for
|
|
281
|
+
large module families so GPTQ/PTQ handoff can target predictable names.
|
|
282
|
+
"""
|
|
283
|
+
|
|
284
|
+
activation = activation or _default_activation()
|
|
285
|
+
weight = weight or _default_weight()
|
|
286
|
+
linear_weight = linear_weight or weight
|
|
287
|
+
|
|
288
|
+
text_model_overrides = _gemma4_text_model_override(
|
|
289
|
+
num_text_layers=num_text_layers,
|
|
290
|
+
linear_weight=linear_weight,
|
|
291
|
+
embedding_weight=embedding_weight,
|
|
292
|
+
norm_weight=norm_weight,
|
|
293
|
+
)
|
|
294
|
+
vision_model_overrides = _gemma4_vision_model_override(
|
|
295
|
+
num_vision_layers=num_vision_layers,
|
|
296
|
+
linear_weight=linear_weight,
|
|
297
|
+
vision_patch_embed_weight=vision_patch_embed_weight,
|
|
298
|
+
norm_weight=norm_weight,
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
multimodal_embedder_overrides = _gemma4_multimodal_embedder_override(
|
|
302
|
+
linear_weight=linear_weight,
|
|
303
|
+
norm_weight=norm_weight,
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
# Follow the original Hugging Face structures while keeping one public API:
|
|
307
|
+
#
|
|
308
|
+
# Gemma4TextModel:
|
|
309
|
+
# embed_tokens / layers / norm / ...
|
|
310
|
+
#
|
|
311
|
+
# Gemma4ForCausalLM:
|
|
312
|
+
# model.(embed_tokens / layers / norm / ...)
|
|
313
|
+
#
|
|
314
|
+
# Gemma4Model:
|
|
315
|
+
# language_model.(embed_tokens / layers / norm / ...)
|
|
316
|
+
# vision_tower / embed_vision
|
|
317
|
+
#
|
|
318
|
+
# Gemma4ForConditionalGeneration:
|
|
319
|
+
# model.language_model.(embed_tokens / layers / norm / ...)
|
|
320
|
+
# model.vision_tower / model.embed_vision
|
|
321
|
+
# lm_head
|
|
322
|
+
gemma4_model_overrides: Dict[str, Any] = {
|
|
323
|
+
"language_model": copy.deepcopy(text_model_overrides),
|
|
324
|
+
"vision_tower": copy.deepcopy(vision_model_overrides),
|
|
325
|
+
"embed_vision": copy.deepcopy(multimodal_embedder_overrides),
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
model_like_overrides = _deep_merge(
|
|
329
|
+
text_model_overrides,
|
|
330
|
+
gemma4_model_overrides,
|
|
331
|
+
)
|
|
332
|
+
overrides: Dict[str, Any] = _deep_merge(
|
|
333
|
+
model_like_overrides,
|
|
334
|
+
{"model": model_like_overrides},
|
|
335
|
+
)
|
|
336
|
+
overrides["lm_head"] = _weight_override(lm_head_weight or linear_weight)
|
|
337
|
+
|
|
338
|
+
return PTQConfig(
|
|
339
|
+
activation=activation,
|
|
340
|
+
weight=weight,
|
|
341
|
+
overrides=overrides,
|
|
342
|
+
model_args=dict(model_args or {}),
|
|
343
|
+
strict_wrap=strict_wrap,
|
|
344
|
+
)
|
|
@@ -0,0 +1,199 @@
|
|
|
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 dataclasses import dataclass, fields, replace
|
|
16
|
+
from typing import Any, cast, Literal, Mapping, Optional
|
|
17
|
+
|
|
18
|
+
from tico.quantization.config.ptq import PTQConfig
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
ExecutionProfile = Literal["reference_eval", "npu_export"]
|
|
22
|
+
ScaleFusion = Literal["none", "k_norm"]
|
|
23
|
+
AttentionLayout = Literal["batched", "unrolled"]
|
|
24
|
+
|
|
25
|
+
DEFAULT_EXECUTION_PROFILE: ExecutionProfile = "npu_export"
|
|
26
|
+
SUPPORTED_EXECUTION_PROFILES: tuple[ExecutionProfile, ...] = (
|
|
27
|
+
"reference_eval",
|
|
28
|
+
"npu_export",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class Qwen3VLTextAttentionOptions:
|
|
34
|
+
"""
|
|
35
|
+
Execution options for quantized Qwen3-VL text attention wrappers.
|
|
36
|
+
|
|
37
|
+
These options describe graph-level implementation choices, not quantization
|
|
38
|
+
policy. They are intentionally read from `PTQConfig.model_args` instead of
|
|
39
|
+
`PTQConfig.overrides`.
|
|
40
|
+
|
|
41
|
+
Attributes
|
|
42
|
+
----------
|
|
43
|
+
scale_fusion : ScaleFusion
|
|
44
|
+
Where to apply the attention scale `1 / sqrt(head_dim)`. "none" keeps
|
|
45
|
+
the Hugging Face-style runtime multiply on logits, while "k_norm" folds
|
|
46
|
+
the scale into the copied key normalization weight.
|
|
47
|
+
layout : AttentionLayout
|
|
48
|
+
Attention implementation layout. "batched" is closer to the Hugging
|
|
49
|
+
Face implementation and is useful for reference experiments. "unrolled"
|
|
50
|
+
preserves the NPU-export-friendly per-KV-head loop.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
scale_fusion: ScaleFusion = "k_norm"
|
|
54
|
+
layout: AttentionLayout = "unrolled"
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
_PRESETS: dict[ExecutionProfile, Qwen3VLTextAttentionOptions] = {
|
|
58
|
+
"reference_eval": Qwen3VLTextAttentionOptions(
|
|
59
|
+
scale_fusion="none",
|
|
60
|
+
layout="batched",
|
|
61
|
+
),
|
|
62
|
+
"npu_export": Qwen3VLTextAttentionOptions(
|
|
63
|
+
scale_fusion="k_norm",
|
|
64
|
+
layout="unrolled",
|
|
65
|
+
),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def normalize_execution_profile(
|
|
70
|
+
profile: Any,
|
|
71
|
+
*,
|
|
72
|
+
context: str = "profile",
|
|
73
|
+
) -> ExecutionProfile:
|
|
74
|
+
"""
|
|
75
|
+
Validate and return an execution profile string.
|
|
76
|
+
|
|
77
|
+
Parameters
|
|
78
|
+
----------
|
|
79
|
+
profile : Any
|
|
80
|
+
User-provided profile value.
|
|
81
|
+
context : str
|
|
82
|
+
Human-readable location used in error messages.
|
|
83
|
+
|
|
84
|
+
Returns
|
|
85
|
+
-------
|
|
86
|
+
ExecutionProfile
|
|
87
|
+
Validated profile value.
|
|
88
|
+
|
|
89
|
+
Raises
|
|
90
|
+
------
|
|
91
|
+
TypeError
|
|
92
|
+
If the profile value is not a string.
|
|
93
|
+
ValueError
|
|
94
|
+
If the profile string is not supported.
|
|
95
|
+
"""
|
|
96
|
+
if not isinstance(profile, str):
|
|
97
|
+
raise TypeError(f"{context} must be a string, got {type(profile).__name__}.")
|
|
98
|
+
if profile not in SUPPORTED_EXECUTION_PROFILES:
|
|
99
|
+
raise ValueError(
|
|
100
|
+
f"Unsupported execution profile at {context}: {profile!r}. "
|
|
101
|
+
f"Supported profiles: {list(SUPPORTED_EXECUTION_PROFILES)}."
|
|
102
|
+
)
|
|
103
|
+
return cast(ExecutionProfile, profile)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def get_qwen3_vl_text_attention_options(
|
|
107
|
+
qcfg: Optional[PTQConfig],
|
|
108
|
+
) -> Qwen3VLTextAttentionOptions:
|
|
109
|
+
"""
|
|
110
|
+
Resolve Qwen3-VL text attention implementation options from a PTQConfig.
|
|
111
|
+
|
|
112
|
+
The root-level `model_args["profile"]` selects the default execution
|
|
113
|
+
profile for profile-aware wrappers. The text attention wrapper may override
|
|
114
|
+
that default through `model_args["attention"]`.
|
|
115
|
+
|
|
116
|
+
Supported examples are::
|
|
117
|
+
|
|
118
|
+
PTQConfig(..., model_args={"profile": "reference_eval"})
|
|
119
|
+
|
|
120
|
+
and::
|
|
121
|
+
|
|
122
|
+
PTQConfig(
|
|
123
|
+
...,
|
|
124
|
+
model_args={
|
|
125
|
+
"profile": "npu_export",
|
|
126
|
+
"attention": {
|
|
127
|
+
"layout": "batched",
|
|
128
|
+
"scale_fusion": "none",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
`model_args["attention"]` may also be a plain profile string, for example
|
|
134
|
+
"reference_eval". When no option is provided, the default profile is
|
|
135
|
+
"npu_export" to preserve the existing export-oriented graph.
|
|
136
|
+
|
|
137
|
+
Parameters
|
|
138
|
+
----------
|
|
139
|
+
qcfg : Optional[PTQConfig]
|
|
140
|
+
PTQ configuration associated with the wrapper.
|
|
141
|
+
|
|
142
|
+
Returns
|
|
143
|
+
-------
|
|
144
|
+
Qwen3VLTextAttentionOptions
|
|
145
|
+
Validated execution options.
|
|
146
|
+
"""
|
|
147
|
+
if qcfg is None:
|
|
148
|
+
return _PRESETS[DEFAULT_EXECUTION_PROFILE]
|
|
149
|
+
|
|
150
|
+
root_profile = normalize_execution_profile(
|
|
151
|
+
qcfg.get_model_arg("profile", DEFAULT_EXECUTION_PROFILE),
|
|
152
|
+
context="PTQConfig.model_args['profile']",
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
raw_attention = qcfg.get_model_arg("attention", {})
|
|
156
|
+
if raw_attention is None:
|
|
157
|
+
raw_attention = {}
|
|
158
|
+
if isinstance(raw_attention, str):
|
|
159
|
+
raw_attention = {"profile": raw_attention}
|
|
160
|
+
if not isinstance(raw_attention, Mapping):
|
|
161
|
+
raise TypeError(
|
|
162
|
+
"PTQConfig.model_args['attention'] must be a mapping, a string, or None."
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
raw = dict(raw_attention)
|
|
166
|
+
profile = normalize_execution_profile(
|
|
167
|
+
raw.pop("profile", root_profile),
|
|
168
|
+
context="PTQConfig.model_args['attention']['profile']",
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
valid_keys = {field.name for field in fields(Qwen3VLTextAttentionOptions)}
|
|
172
|
+
unknown_keys = sorted(set(raw) - valid_keys)
|
|
173
|
+
if unknown_keys:
|
|
174
|
+
raise ValueError(f"Unknown Qwen3-VL text attention option(s): {unknown_keys}.")
|
|
175
|
+
|
|
176
|
+
options = replace(_PRESETS[profile], **raw)
|
|
177
|
+
_validate_qwen3_vl_text_attention_options(options)
|
|
178
|
+
return options
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def is_npu_export_text_attention_options(
|
|
182
|
+
options: Qwen3VLTextAttentionOptions,
|
|
183
|
+
) -> bool:
|
|
184
|
+
"""
|
|
185
|
+
Return whether the options match the NPU-export-friendly attention graph.
|
|
186
|
+
"""
|
|
187
|
+
return options.scale_fusion == "k_norm" and options.layout == "unrolled"
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _validate_qwen3_vl_text_attention_options(
|
|
191
|
+
options: Qwen3VLTextAttentionOptions,
|
|
192
|
+
) -> None:
|
|
193
|
+
"""
|
|
194
|
+
Validate a fully resolved Qwen3VLTextAttentionOptions instance.
|
|
195
|
+
"""
|
|
196
|
+
if options.scale_fusion not in ("none", "k_norm"):
|
|
197
|
+
raise ValueError(f"Unsupported scale_fusion: {options.scale_fusion!r}.")
|
|
198
|
+
if options.layout not in ("batched", "unrolled"):
|
|
199
|
+
raise ValueError(f"Unsupported attention layout: {options.layout!r}.")
|
{tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/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.dev260706 → tico-0.2.0.dev260708}/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
|
|
|
@@ -23,6 +23,13 @@ from tico.quantization.config.gemma4_builders import build_gemma4_e2b_ptq_config
|
|
|
23
23
|
from tico.quantization.recipes.adapters.base import ModelAdapter
|
|
24
24
|
from tico.quantization.recipes.context import RecipeContext
|
|
25
25
|
from tico.quantization.recipes.data.vlm import build_vlm_calibration_inputs
|
|
26
|
+
from tico.quantization.recipes.evaluation.llava_bench_judge import (
|
|
27
|
+
evaluate_and_print_llava_bench_judge,
|
|
28
|
+
)
|
|
29
|
+
from tico.quantization.recipes.evaluation.vlm import (
|
|
30
|
+
evaluate_llava_bench,
|
|
31
|
+
print_coco_score_results,
|
|
32
|
+
)
|
|
26
33
|
from tico.quantization.recipes.utils import (
|
|
27
34
|
move_to_device,
|
|
28
35
|
quant_spec_from_config,
|
|
@@ -53,7 +60,12 @@ class Gemma4Adapter(ModelAdapter):
|
|
|
53
60
|
cache_dir = model_cfg.get("cache_dir")
|
|
54
61
|
device_map = runtime_cfg.get("device_map")
|
|
55
62
|
if device_map is None:
|
|
56
|
-
|
|
63
|
+
if ctx.device.type == "cpu":
|
|
64
|
+
device_map = "cpu"
|
|
65
|
+
else:
|
|
66
|
+
# Use specific device index instead of "auto" to avoid
|
|
67
|
+
# multi-GPU model split during PTQ calibration.
|
|
68
|
+
device_map = str(ctx.device)
|
|
57
69
|
|
|
58
70
|
ctx.processor = AutoProcessor.from_pretrained(
|
|
59
71
|
name,
|
|
@@ -174,11 +186,68 @@ class Gemma4Adapter(ModelAdapter):
|
|
|
174
186
|
return convert(prepared, inplace=True)
|
|
175
187
|
|
|
176
188
|
def evaluate(self, ctx: RecipeContext) -> None:
|
|
177
|
-
"""Evaluate Gemma4 E2B.
|
|
189
|
+
"""Evaluate Gemma4 E2B via LLaVA-Bench judge and other VLM tasks."""
|
|
190
|
+
eval_cfg = ctx.cfg.get("evaluation", {})
|
|
191
|
+
if not eval_cfg.get("enabled", False):
|
|
192
|
+
return
|
|
193
|
+
|
|
194
|
+
max_seq_len = eval_cfg.get("max_seq_len")
|
|
195
|
+
n_samples = int(eval_cfg.get("n_samples", 50))
|
|
196
|
+
|
|
197
|
+
llava_bench_cfg = eval_cfg.get("llava_bench", False)
|
|
198
|
+
if isinstance(llava_bench_cfg, Mapping):
|
|
199
|
+
if llava_bench_cfg.get("enabled", False):
|
|
200
|
+
mode = str(llava_bench_cfg.get("mode", "judge")).lower()
|
|
201
|
+
if mode in {"judge", "llm_judge"}:
|
|
202
|
+
evaluate_and_print_llava_bench_judge(
|
|
203
|
+
model=ctx.model,
|
|
204
|
+
processor=ctx.processor,
|
|
205
|
+
device=str(ctx.device),
|
|
206
|
+
llava_cfg=llava_bench_cfg,
|
|
207
|
+
model_cfg=ctx.cfg.get("model", {}),
|
|
208
|
+
runtime_cfg=ctx.cfg.get("runtime", {}),
|
|
209
|
+
default_n_samples=n_samples,
|
|
210
|
+
default_max_seq_len=max_seq_len,
|
|
211
|
+
)
|
|
212
|
+
elif mode in {"legacy", "coco", "caption"}:
|
|
213
|
+
llava_results = evaluate_llava_bench(
|
|
214
|
+
model=ctx.model,
|
|
215
|
+
processor=ctx.processor,
|
|
216
|
+
device=str(ctx.device),
|
|
217
|
+
n_samples=int(llava_bench_cfg.get("n_samples", n_samples)),
|
|
218
|
+
max_seq_len=llava_bench_cfg.get("max_seq_len", max_seq_len),
|
|
219
|
+
)
|
|
220
|
+
print_coco_score_results(
|
|
221
|
+
"\n=== LLaVA Bench Legacy COCO-style Evaluation ===",
|
|
222
|
+
llava_results,
|
|
223
|
+
)
|
|
224
|
+
else:
|
|
225
|
+
raise ValueError(
|
|
226
|
+
"evaluation.llava_bench.mode must be one of "
|
|
227
|
+
"{'judge', 'llm_judge', 'legacy', 'coco', 'caption'}, "
|
|
228
|
+
f"got {mode!r}."
|
|
229
|
+
)
|
|
230
|
+
elif llava_bench_cfg:
|
|
231
|
+
print(
|
|
232
|
+
"[WARNING] evaluation.llava_bench=true uses the legacy "
|
|
233
|
+
"COCO-style CIDEr/BLEU path. Prefer the nested judge config: "
|
|
234
|
+
"evaluation.llava_bench.enabled=true, mode=judge."
|
|
235
|
+
)
|
|
236
|
+
llava_results = evaluate_llava_bench(
|
|
237
|
+
model=ctx.model,
|
|
238
|
+
processor=ctx.processor,
|
|
239
|
+
device=str(ctx.device),
|
|
240
|
+
n_samples=n_samples,
|
|
241
|
+
max_seq_len=max_seq_len,
|
|
242
|
+
)
|
|
243
|
+
print_coco_score_results("\n=== Llava Bench Evaluation ===", llava_results)
|
|
244
|
+
|
|
245
|
+
def export(self, ctx: RecipeContext) -> None:
|
|
246
|
+
"""Export Gemma4 E2B artifacts.
|
|
178
247
|
|
|
179
|
-
TODO:
|
|
180
|
-
wired into the shared evaluation entry point.
|
|
248
|
+
TODO: Implement Circle export via the static runtime submodule adapters.
|
|
181
249
|
"""
|
|
182
|
-
|
|
250
|
+
export_cfg = ctx.cfg.get("export", {})
|
|
251
|
+
if not export_cfg.get("enabled", False):
|
|
183
252
|
return
|
|
184
|
-
raise NotImplementedError("Gemma4 E2B
|
|
253
|
+
raise NotImplementedError("Gemma4 E2B export adapter is not wired yet.")
|