ai-edge-quantizer-nightly 0.3.0.dev20250612__py3-none-any.whl → 0.3.0.dev20250613__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -165,7 +165,7 @@ class Calibrator:
165
165
  )
166
166
  if algorithm_name == algorithm_manager.AlgorithmName.NO_QUANTIZE:
167
167
  continue
168
- if policy.is_conditionally_unquantized(op):
168
+ if policy.is_non_quantizable_composite_op(op):
169
169
  continue
170
170
 
171
171
  # Step2.2: query algorithm_manager to get/call the related
@@ -245,6 +245,7 @@ DEFAULT_JSON_POLICY = """
245
245
  }
246
246
  }
247
247
  """
248
+ QUANTIZABLE_COMPOSITES = ["od" + "ml.npu_call", "od" + "ml.rms_norm"]
248
249
 
249
250
 
250
251
  def _unroll_json_config(
@@ -322,10 +323,10 @@ def _unroll_json_config(
322
323
 
323
324
 
324
325
  # TODO: b/401024954 - Have a better way to specify recipes based on op options.
325
- def is_conditionally_unquantized(
326
+ def is_non_quantizable_composite_op(
326
327
  op: Union[schema.Operator, schema.OperatorT],
327
328
  ) -> bool:
328
- """Checks if the operator is conditionally unquantized.
329
+ """Checks if the operator is a non-quantizable composite op.
329
330
 
330
331
  We may want to quantize an op only when its has certain options.
331
332
  Policies/recipes
@@ -340,10 +341,9 @@ def is_conditionally_unquantized(
340
341
  if opts := flatbuffer_utils.get_options_as(
341
342
  op, schema.StableHLOCompositeOptionsT
342
343
  ):
343
- name: bytes = opts.name
344
- # Non npu_call composites may have a kernel and as such will not be
345
- # quantized.
346
- return ("od" + "ml.npu_call") not in name.decode("utf-8")
344
+ name = opts.name.decode("utf-8")
345
+ if name not in QUANTIZABLE_COMPOSITES:
346
+ return True
347
347
 
348
348
  return False
349
349
 
@@ -109,7 +109,7 @@ class ParamsGenerator:
109
109
  algorithm_name, op_quant_config = (
110
110
  model_recipe_manager.get_quantization_configs(op_key, op_scope)
111
111
  )
112
- if policy.is_conditionally_unquantized(op):
112
+ if policy.is_non_quantizable_composite_op(op):
113
113
  algorithm_name = algorithm_manager.AlgorithmName.NO_QUANTIZE
114
114
 
115
115
  if algorithm_name == algorithm_manager.AlgorithmName.NO_QUANTIZE:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ai-edge-quantizer-nightly
3
- Version: 0.3.0.dev20250612
3
+ Version: 0.3.0.dev20250613
4
4
  Summary: A quantizer for advanced developers to quantize converted AI Edge models.
5
5
  Home-page: https://github.com/google-ai-edge/ai-edge-quantizer
6
6
  Keywords: On-Device ML,AI,Google,TFLite,Quantization,LLMs,GenAI
@@ -2,15 +2,15 @@ ai_edge_quantizer/__init__.py,sha256=4pFSkukSwahYyzwqia0yPRyz8TnFQfGRthVJhYpMWas
2
2
  ai_edge_quantizer/algorithm_manager.py,sha256=lfCazb2b0Q4L3of0cTWkF5lMr3AD6LWW1ekmFoEGB_4,12062
3
3
  ai_edge_quantizer/algorithm_manager_api.py,sha256=u903TG0s1uIDhJqfeJne3CFl8A93phZrwgV2-hwdcXU,9247
4
4
  ai_edge_quantizer/algorithm_manager_api_test.py,sha256=w6bSONvXkX6bzXAGc0-7b6gNDt9oz9ieq97KP8Sg_JU,7666
5
- ai_edge_quantizer/calibrator.py,sha256=-_jX_KkfIepkQAwxxDrZjvPO1JsoSjHXVy1DPc1iFjM,12068
5
+ ai_edge_quantizer/calibrator.py,sha256=Sms7_AIHPH9G5xFaz5Ef3a5gPhxuIWQI8d2LUM8C96I,12071
6
6
  ai_edge_quantizer/calibrator_test.py,sha256=C_oWOaRugPKYX74jF-eRFH-k6nGOdA8I9_uPiocaOuE,11900
7
7
  ai_edge_quantizer/conftest.py,sha256=SxCz-5LlRD_lQm4hQc4c6IGG7DS8d7IyEWY9gnscPN0,794
8
- ai_edge_quantizer/default_policy.py,sha256=nKtghUjTQ8QS9CgLRwQb3iB2eZOyQv0FqyISlcgzSH4,11195
8
+ ai_edge_quantizer/default_policy.py,sha256=9CNd5zIk_BA560kOLkoXD5mapDBWj0yXzSFDedLhzYw,11192
9
9
  ai_edge_quantizer/model_modifier.py,sha256=teGa8I6kGvn6TQY6Xv53YFIc_pQEhNvM9Zb4bvhezyw,7110
10
10
  ai_edge_quantizer/model_modifier_test.py,sha256=cJd04SLOG-fQZZNZPcisoBLx3cLtWEwGqUBbLb-pif4,4751
11
11
  ai_edge_quantizer/model_validator.py,sha256=Hj0_5o-Oa3dSlJ3ryVjRhvsyelHNyek1GrtG9buMczg,13153
12
12
  ai_edge_quantizer/model_validator_test.py,sha256=EeqOP_mrZsnZ3rug756s0ryDDqd2KgIDld5Lm_gDuWY,13020
13
- ai_edge_quantizer/params_generator.py,sha256=j1BV2cGFLlQmUY6aoW5uglYqf77b9ytN8oZ1gh6o0mM,20096
13
+ ai_edge_quantizer/params_generator.py,sha256=gC7G6Ne4Fumc8RSmIAbx96ZBhszZlHqBKSmE9p6RPTo,20099
14
14
  ai_edge_quantizer/params_generator_test.py,sha256=RDYoRZDJfEZRtjlTAU2kZ_4t3JHOqEHxfJX9V4ETAhg,40597
15
15
  ai_edge_quantizer/qtyping.py,sha256=0Dwz6LHQG8LhZMhVAo_h6ieZ_gcfkJl2yJcsGf17YYs,16527
16
16
  ai_edge_quantizer/quantizer.py,sha256=g3DMqFMrMpt9jQttCE0WcdNbMtk0JZnmN5MmCHrNdyM,13202
@@ -70,8 +70,8 @@ ai_edge_quantizer/utils/tfl_interpreter_utils.py,sha256=EtOv6cpKM_F0uv2bWuSXylYm
70
70
  ai_edge_quantizer/utils/tfl_interpreter_utils_test.py,sha256=6fjkM-rycZ95L4yfvlr0TN6RlrhfPzxNUYrZaYO_F0A,12013
71
71
  ai_edge_quantizer/utils/validation_utils.py,sha256=oYw33Sg547AqtGw-choPUJmp9SAKkV46J_ddqSsum2Q,3950
72
72
  ai_edge_quantizer/utils/validation_utils_test.py,sha256=V_qNDikPD4OPB-siOLQCWNVWTAu87h2IgNYt7teFd-o,2934
73
- ai_edge_quantizer_nightly-0.3.0.dev20250612.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
74
- ai_edge_quantizer_nightly-0.3.0.dev20250612.dist-info/METADATA,sha256=C0e46WStdRDjUO05juSVs83Bu_Tm27ZBa9XZoLRmAZo,1528
75
- ai_edge_quantizer_nightly-0.3.0.dev20250612.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
76
- ai_edge_quantizer_nightly-0.3.0.dev20250612.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
77
- ai_edge_quantizer_nightly-0.3.0.dev20250612.dist-info/RECORD,,
73
+ ai_edge_quantizer_nightly-0.3.0.dev20250613.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
74
+ ai_edge_quantizer_nightly-0.3.0.dev20250613.dist-info/METADATA,sha256=YePqVOXDrP8t8VahK71fzW8xL0X14-coPWeR7eq45Jg,1528
75
+ ai_edge_quantizer_nightly-0.3.0.dev20250613.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
76
+ ai_edge_quantizer_nightly-0.3.0.dev20250613.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
77
+ ai_edge_quantizer_nightly-0.3.0.dev20250613.dist-info/RECORD,,