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.
Files changed (451) hide show
  1. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/PKG-INFO +1 -1
  2. tico-0.2.0.dev260708/tico/_version.py +1 -0
  3. tico-0.2.0.dev260708/tico/quantization/config/gemma4_builders.py +344 -0
  4. tico-0.2.0.dev260708/tico/quantization/config/qwen3_vl_attention.py +199 -0
  5. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/vlm_eval_utils.py +1 -1
  6. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/__init__.py +2 -0
  7. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/gemma4.py +75 -6
  8. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/llama.py +2 -2
  9. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/config.py +104 -18
  10. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/data/llm.py +1 -1
  11. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/qwen3_vl.py +90 -15
  12. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/llm.py +1 -1
  13. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/compare_ppl.py +1 -1
  14. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/debug_quant_outputs.py +1 -1
  15. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/quantize_full_qmodel_with_gptq.py +6 -4
  16. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/quantize_with_gptq.py +1 -1
  17. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_model.py +6 -4
  18. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_attention.py +49 -2
  19. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder.py +3 -1
  20. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/utils.py +10 -1
  21. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/export_adapters.py +110 -0
  22. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_attention.py +277 -64
  23. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/PKG-INFO +1 -1
  24. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/SOURCES.txt +2 -1
  25. tico-0.2.0.dev260706/tico/_version.py +0 -1
  26. tico-0.2.0.dev260706/tico/quantization/config/gemma4_builders.py +0 -137
  27. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/LICENSE +0 -0
  28. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/README.md +0 -0
  29. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/pyproject.toml +0 -0
  30. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/setup.cfg +0 -0
  31. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/__init__.py +0 -0
  32. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/__init__.py +0 -0
  33. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/base.py +0 -0
  34. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/factory.py +0 -0
  35. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/config/v1.py +0 -0
  36. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/experimental/__init__.py +0 -0
  37. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/interpreter/__init__.py +0 -0
  38. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/interpreter/infer.py +0 -0
  39. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/interpreter/interpreter.py +0 -0
  40. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/__init__.py +0 -0
  41. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/cast_aten_where_arg_type.py +0 -0
  42. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/cast_clamp_mixed_type_args.py +0 -0
  43. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/cast_mixed_type_args.py +0 -0
  44. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/const_prop_pass.py +0 -0
  45. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_conv1d_to_conv2d.py +0 -0
  46. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_conv3d_to_conv2d.py +0 -0
  47. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_expand_to_slice_cat.py +0 -0
  48. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_gather_to_gather_nd.py +0 -0
  49. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_layout_op_to_reshape.py +0 -0
  50. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_matmul_to_linear.py +0 -0
  51. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_repeat_to_expand_copy.py +0 -0
  52. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_sym_size_to_circle_shape.py +0 -0
  53. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/convert_to_relu6.py +0 -0
  54. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_addmm.py +0 -0
  55. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_batch_norm.py +0 -0
  56. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_fake_quantize.py +0 -0
  57. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_fake_quantize_tensor_qparams.py +0 -0
  58. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_group_norm.py +0 -0
  59. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_grouped_conv2d.py +0 -0
  60. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/decompose_slice_scatter.py +0 -0
  61. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/eliminate_rank_round_trip_region.py +0 -0
  62. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/extract_dtype_kwargs.py +0 -0
  63. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/fill_meta_val.py +0 -0
  64. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/fuse_leading_unsqueeze_reshape.py +0 -0
  65. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/fuse_redundant_reshape_to_mean.py +0 -0
  66. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/legalize_causal_mask_value.py +0 -0
  67. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/legalize_predefined_layout_operators.py +0 -0
  68. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_copy.py +0 -0
  69. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_pow2_to_mul.py +0 -0
  70. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_to_resize_nearest_neighbor.py +0 -0
  71. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/lower_to_slice.py +0 -0
  72. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/merge_consecutive_cat.py +0 -0
  73. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/ops.py +0 -0
  74. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_nop.py +0 -0
  75. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_assert_nodes.py +0 -0
  76. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_expand.py +0 -0
  77. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_permute.py +0 -0
  78. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_reshape.py +0 -0
  79. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_slice.py +0 -0
  80. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_redundant_to_copy.py +0 -0
  81. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/remove_unused_placeholder.py +0 -0
  82. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/restore_linear.py +0 -0
  83. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/passes/segment_index_select.py +0 -0
  84. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/pt2_to_circle.py +0 -0
  85. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/__init__.py +0 -0
  86. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/__init__.py +0 -0
  87. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/cle/__init__.py +0 -0
  88. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/cle/cle.py +0 -0
  89. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/cle/quantizer.py +0 -0
  90. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/__init__.py +0 -0
  91. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/fpi_gptq.py +0 -0
  92. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/quantizer.py +0 -0
  93. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/fpi_gptq/util.py +0 -0
  94. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/__init__.py +0 -0
  95. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/gptq.py +0 -0
  96. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/quant.py +0 -0
  97. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/quantizer.py +0 -0
  98. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/gptq/utils.py +0 -0
  99. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/__init__.py +0 -0
  100. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/gptq.py +0 -0
  101. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/quantizer.py +0 -0
  102. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/qwen3_vl_gptq/utils.py +0 -0
  103. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/__init__.py +0 -0
  104. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/observer.py +0 -0
  105. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/quantizer.py +0 -0
  106. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/smoothquant/smooth_quant.py +0 -0
  107. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/__init__.py +0 -0
  108. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/fuse_norm_utils.py +0 -0
  109. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/hadamard_utils.py +0 -0
  110. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/quantizer.py +0 -0
  111. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/qwen3_vl_model_utils.py +0 -0
  112. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/qwen3_vl_quantizer.py +0 -0
  113. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/qwen3_vl_rotation_utils.py +0 -0
  114. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/rotation_utils.py +0 -0
  115. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/spin_llama.py +0 -0
  116. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/algorithm/spinquant/spin_qwen3_vl.py +0 -0
  117. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/__init__.py +0 -0
  118. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/base.py +0 -0
  119. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/builders.py +0 -0
  120. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/cle.py +0 -0
  121. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/fpi_gptq.py +0 -0
  122. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/gptq.py +0 -0
  123. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/llama_attention.py +0 -0
  124. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/ptq.py +0 -0
  125. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/qwen3_vl_gptq.py +0 -0
  126. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/qwen3_vl_spinquant.py +0 -0
  127. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/smoothquant.py +0 -0
  128. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/specs.py +0 -0
  129. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/spinquant.py +0 -0
  130. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/config/utils.py +0 -0
  131. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/__init__.py +0 -0
  132. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/backend.py +0 -0
  133. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/evaluate.py +0 -0
  134. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/__init__.py +0 -0
  135. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/backend_executor.py +0 -0
  136. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/circle_executor.py +0 -0
  137. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/executor/triv24_executor.py +0 -0
  138. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/hellaswag_eval_utils.py +0 -0
  139. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/llava_bench_judge_eval_utils.py +0 -0
  140. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/lmms_eval_utils.py +0 -0
  141. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/lmms_tasks/videomme_mini/utils.py +0 -0
  142. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/metric.py +0 -0
  143. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/mmlu_eval_utils.py +0 -0
  144. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/mmmu_eval_utils.py +0 -0
  145. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/optional_deps.py +0 -0
  146. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/script/llm_tasks_eval.py +0 -0
  147. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/script/mini_vqa_eval.py +0 -0
  148. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/evaluation/utils.py +0 -0
  149. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/__init__.py +0 -0
  150. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/configs/__init__.py +0 -0
  151. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/evaluate.py +0 -0
  152. /tico-0.2.0.dev260706/tico/quantization/examples/inspect.py → /tico-0.2.0.dev260708/tico/quantization/examples/inspector.py +0 -0
  153. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/examples/quantize.py +0 -0
  154. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/__init__.py +0 -0
  155. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/fold_quant_ops.py +0 -0
  156. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/insert_quantize_on_dtype_mismatch.py +0 -0
  157. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/propagate_qparam_backward.py +0 -0
  158. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/propagate_qparam_forward.py +0 -0
  159. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/qparam_safe_const_prop.py +0 -0
  160. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/quantize_bias.py +0 -0
  161. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/passes/remove_weight_dequant_op.py +0 -0
  162. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/public_interface.py +0 -0
  163. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/quantizer.py +0 -0
  164. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/quantizer_registry.py +0 -0
  165. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/__init__.py +0 -0
  166. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/base.py +0 -0
  167. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/adapters/qwen3_vl.py +0 -0
  168. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/context.py +0 -0
  169. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/data/__init__.py +0 -0
  170. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/data/vlm.py +0 -0
  171. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/__init__.py +0 -0
  172. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/static_gemma4_runtime.py +0 -0
  173. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/static_llama_runtime.py +0 -0
  174. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/static_qwen3_vl_runtime.py +0 -0
  175. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/tied_embedding.py +0 -0
  176. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/trace.py +0 -0
  177. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/__init__.py +0 -0
  178. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/case.py +0 -0
  179. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/__init__.py +0 -0
  180. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/gemma4.py +0 -0
  181. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/llama.py +0 -0
  182. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/cases/nn.py +0 -0
  183. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/registry.py +0 -0
  184. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/result.py +0 -0
  185. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/runner.py +0 -0
  186. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/debug/wrapper_smoke/utils.py +0 -0
  187. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/__init__.py +0 -0
  188. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/hellaswag.py +0 -0
  189. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/llava_bench_judge.py +0 -0
  190. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/mmlu.py +0 -0
  191. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/mmmu.py +0 -0
  192. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/video_mme.py +0 -0
  193. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/evaluation/vlm.py +0 -0
  194. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/__init__.py +0 -0
  195. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/checkpoint.py +0 -0
  196. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/circle.py +0 -0
  197. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/export/llama.py +0 -0
  198. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/qparams.py +0 -0
  199. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/runner.py +0 -0
  200. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/__init__.py +0 -0
  201. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/base.py +0 -0
  202. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/cle.py +0 -0
  203. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/gptq.py +0 -0
  204. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/ptq.py +0 -0
  205. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/smoothquant.py +0 -0
  206. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/stages/spinquant.py +0 -0
  207. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/recipes/utils.py +0 -0
  208. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/__init__.py +0 -0
  209. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/dtypes.py +0 -0
  210. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/__init__.py +0 -0
  211. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/evaluate_fk_llama_model.py +0 -0
  212. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/__init__.py +0 -0
  213. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_for_causal_lm.py +0 -0
  214. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_for_conditional_generation.py +0 -0
  215. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_model.py +0 -0
  216. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_multimodal_embedder.py +0 -0
  217. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_text_scaled_word_embedding.py +0 -0
  218. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_vision_model.py +0 -0
  219. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_vision_patch_embedder.py +0 -0
  220. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/gemma4/quantize_vision_pooler.py +0 -0
  221. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/__init__.py +0 -0
  222. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_attention_decode.py +0 -0
  223. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_attention_prefill.py +0 -0
  224. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_decode.py +0 -0
  225. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_decoder_layer_prefill.py +0 -0
  226. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/llama/quantize_mlp.py +0 -0
  227. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/__init__.py +0 -0
  228. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_conv3d.py +0 -0
  229. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_conv3d_special_case.py +0 -0
  230. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_layernorm.py +0 -0
  231. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_linear.py +0 -0
  232. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/nn/quantize_tied_embedding.py +0 -0
  233. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/quantize_qwen3_vl_with_gptq.py +0 -0
  234. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/__init__.py +0 -0
  235. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_for_conditional_generation.py +0 -0
  236. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_model.py +0 -0
  237. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_attention.py +0 -0
  238. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_decoder_layer.py +0 -0
  239. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_mlp.py +0 -0
  240. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_text_model.py +0 -0
  241. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_attention.py +0 -0
  242. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_block.py +0 -0
  243. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_mlp.py +0 -0
  244. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_model.py +0 -0
  245. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_embed.py +0 -0
  246. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/quantize_vision_patch_merger.py +0 -0
  247. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/qwen/trace_qwen.py +0 -0
  248. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/examples/static_llama_layer_runtime.py +0 -0
  249. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/mode.py +0 -0
  250. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/__init__.py +0 -0
  251. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/affine_base.py +0 -0
  252. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/base.py +0 -0
  253. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/ema.py +0 -0
  254. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/identity.py +0 -0
  255. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/minmax.py +0 -0
  256. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/observers/mx.py +0 -0
  257. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/qscheme.py +0 -0
  258. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/quantizer.py +0 -0
  259. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/__init__.py +0 -0
  260. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/check_missing_qparam.py +0 -0
  261. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/introspection.py +0 -0
  262. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/metrics.py +0 -0
  263. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/reduce_utils.py +0 -0
  264. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/utils.py +0 -0
  265. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/utils/version.py +0 -0
  266. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrap_helper.py +0 -0
  267. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/__init__.py +0 -0
  268. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/__init__.py +0 -0
  269. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/decoder_export_single_step.py +0 -0
  270. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder.py +0 -0
  271. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_decoder_layer.py +0 -0
  272. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder.py +0 -0
  273. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_encoder_layer.py +0 -0
  274. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/fairseq/quant_mha.py +0 -0
  275. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/__init__.py +0 -0
  276. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/export_adapters.py +0 -0
  277. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_clippable_linear.py +0 -0
  278. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_for_causal_lm.py +0 -0
  279. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_for_conditional_generation.py +0 -0
  280. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_multimodal_embedder.py +0 -0
  281. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_rmsnorm.py +0 -0
  282. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_decoder_layer.py +0 -0
  283. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_mlp.py +0 -0
  284. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_model.py +0 -0
  285. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_text_scaled_word_embedding.py +0 -0
  286. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_attention.py +0 -0
  287. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_encoder_layer.py +0 -0
  288. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_mlp.py +0 -0
  289. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_model.py +0 -0
  290. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_patch_embedder.py +0 -0
  291. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/gemma4/quant_vision_pooler.py +0 -0
  292. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/__init__.py +0 -0
  293. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/export_adapters.py +0 -0
  294. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_attention.py +0 -0
  295. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_decoder_layer.py +0 -0
  296. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_mlp.py +0 -0
  297. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_model.py +0 -0
  298. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/llama/quant_model_for_causal_lm.py +0 -0
  299. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/__init__.py +0 -0
  300. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_conv3d.py +0 -0
  301. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_conv3d_decomposed.py +0 -0
  302. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_embedding.py +0 -0
  303. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_layernorm.py +0 -0
  304. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_linear.py +0 -0
  305. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/nn/quant_silu.py +0 -0
  306. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/ops/__init__.py +0 -0
  307. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/ops/quant_rmsnorm.py +0 -0
  308. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/ptq_wrapper.py +0 -0
  309. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/quant_elementwise.py +0 -0
  310. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/quant_module_base.py +0 -0
  311. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_for_conditional_generation.py +0 -0
  312. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_model.py +0 -0
  313. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_decoder_layer.py +0 -0
  314. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_mlp.py +0 -0
  315. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_text_model.py +0 -0
  316. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_attention.py +0 -0
  317. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_block.py +0 -0
  318. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_mlp.py +0 -0
  319. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_model.py +0 -0
  320. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_embed.py +0 -0
  321. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/qwen_vl/quant_vision_patch_merger.py +0 -0
  322. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/quantization/wrapq/wrappers/registry.py +0 -0
  323. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/__init__.py +0 -0
  324. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/circle_graph.py +0 -0
  325. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/circle_mapping.py +0 -0
  326. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/circle_serializer.py +0 -0
  327. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/__init__.py +0 -0
  328. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/__init__.py +0 -0
  329. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/llama_rmsnorm.py +0 -0
  330. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/onert/__init__.py +0 -0
  331. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/adapters/onert/llama_attention.py +0 -0
  332. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/hashable_opcode.py +0 -0
  333. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/node_visitor.py +0 -0
  334. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_abs.py +0 -0
  335. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_add.py +0 -0
  336. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_alias_copy.py +0 -0
  337. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_any.py +0 -0
  338. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_arange_start_step.py +0 -0
  339. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_argmax.py +0 -0
  340. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_attention.py +0 -0
  341. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_avg_pool2d.py +0 -0
  342. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_bmm.py +0 -0
  343. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_cat.py +0 -0
  344. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_circle_gather_nd.py +0 -0
  345. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_circle_shape.py +0 -0
  346. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_clamp.py +0 -0
  347. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_clone.py +0 -0
  348. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_constant_pad_nd.py +0 -0
  349. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_conv2d.py +0 -0
  350. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_cos.py +0 -0
  351. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_cumsum.py +0 -0
  352. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_depthwise_conv2d.py +0 -0
  353. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_dequantize_per_channel.py +0 -0
  354. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_dequantize_per_tensor.py +0 -0
  355. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_div.py +0 -0
  356. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_elu.py +0 -0
  357. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_embedding.py +0 -0
  358. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_eq.py +0 -0
  359. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_exp.py +0 -0
  360. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_expand.py +0 -0
  361. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_full.py +0 -0
  362. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_full_like.py +0 -0
  363. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_ge.py +0 -0
  364. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_gelu.py +0 -0
  365. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_gt.py +0 -0
  366. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_index.py +0 -0
  367. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_index_select.py +0 -0
  368. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_instance_norm.py +0 -0
  369. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_le.py +0 -0
  370. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_leaky_relu.py +0 -0
  371. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_linear.py +0 -0
  372. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_log.py +0 -0
  373. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_log1p.py +0 -0
  374. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_logical_and.py +0 -0
  375. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_logical_not.py +0 -0
  376. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_lt.py +0 -0
  377. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_max_dim.py +0 -0
  378. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_max_pool2d_with_indices.py +0 -0
  379. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_maximum.py +0 -0
  380. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_mean.py +0 -0
  381. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_minimum.py +0 -0
  382. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_mm.py +0 -0
  383. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_mul.py +0 -0
  384. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_ne.py +0 -0
  385. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_neg.py +0 -0
  386. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_permute.py +0 -0
  387. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_pow.py +0 -0
  388. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_prelu.py +0 -0
  389. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_quantize_per_tensor.py +0 -0
  390. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_reciprocal.py +0 -0
  391. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_relu.py +0 -0
  392. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_relu6.py +0 -0
  393. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_repeat.py +0 -0
  394. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_reshape.py +0 -0
  395. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_resize_nearest_neighbor.py +0 -0
  396. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_rmsnorm.py +0 -0
  397. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_round.py +0 -0
  398. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_rsqrt.py +0 -0
  399. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_scalar_tensor.py +0 -0
  400. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_select_copy.py +0 -0
  401. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sigmoid.py +0 -0
  402. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sin.py +0 -0
  403. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_slice.py +0 -0
  404. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_softmax.py +0 -0
  405. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_split_with_sizes.py +0 -0
  406. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sqrt.py +0 -0
  407. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_squeeze.py +0 -0
  408. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sub.py +0 -0
  409. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_sum.py +0 -0
  410. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_tanh.py +0 -0
  411. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_to_copy.py +0 -0
  412. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_transpose_conv.py +0 -0
  413. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_unsqueeze.py +0 -0
  414. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_view.py +0 -0
  415. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/op_where.py +0 -0
  416. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/operators/utils.py +0 -0
  417. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/pack.py +0 -0
  418. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/serialize/quant_param.py +0 -0
  419. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/__init__.py +0 -0
  420. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/compat/__init__.py +0 -0
  421. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/compat/torch.py +0 -0
  422. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/compat/transformers.py +0 -0
  423. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/convert.py +0 -0
  424. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/define.py +0 -0
  425. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/diff_graph.py +0 -0
  426. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/dtype.py +0 -0
  427. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/errors.py +0 -0
  428. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/graph.py +0 -0
  429. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/installed_packages.py +0 -0
  430. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/logging.py +0 -0
  431. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/model.py +0 -0
  432. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/__init__.py +0 -0
  433. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/dtypes.py +0 -0
  434. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/elemwise_ops.py +0 -0
  435. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/formats.py +0 -0
  436. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/mx/mx_ops.py +0 -0
  437. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/padding.py +0 -0
  438. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/passes.py +0 -0
  439. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/pytree_utils.py +0 -0
  440. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/record_input.py +0 -0
  441. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/register_custom_op.py +0 -0
  442. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/serialize.py +0 -0
  443. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/signature.py +0 -0
  444. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/trace_decorators.py +0 -0
  445. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/utils.py +0 -0
  446. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/validate_args_kwargs.py +0 -0
  447. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico/utils/version.py +0 -0
  448. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/dependency_links.txt +0 -0
  449. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/entry_points.txt +0 -0
  450. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/requires.txt +0 -0
  451. {tico-0.2.0.dev260706 → tico-0.2.0.dev260708}/tico.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tico
3
- Version: 0.2.0.dev260706
3
+ Version: 0.2.0.dev260708
4
4
  Summary: Convert Exported Torch Module To Circle
5
5
  License: This file provides full text of licenses used in this project
6
6
 
@@ -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}.")
@@ -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
  },
@@ -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
- device_map = "auto" if ctx.device.type != "cpu" else "cpu"
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: Reuse the Qwen3-VL LLaVA-Bench judge evaluator once the adapter is
180
- wired into the shared evaluation entry point.
248
+ TODO: Implement Circle export via the static runtime submodule adapters.
181
249
  """
182
- if not ctx.cfg.get("evaluation", {}).get("enabled", False):
250
+ export_cfg = ctx.cfg.get("export", {})
251
+ if not export_cfg.get("enabled", False):
183
252
  return
184
- raise NotImplementedError("Gemma4 E2B evaluation adapter is not wired yet.")
253
+ raise NotImplementedError("Gemma4 E2B export adapter is not wired yet.")