ai-edge-quantizer-nightly 0.0.1.dev20241121__py3-none-any.whl → 0.0.1.dev20241122__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.
@@ -91,6 +91,7 @@ for op_name, materialize_func in zip(
91
91
  _TFLOpName.LOGISTIC, # Sigmoid
92
92
  _TFLOpName.SLICE,
93
93
  _TFLOpName.SUM,
94
+ _TFLOpName.SELECT_V2,
94
95
  ),
95
96
  (
96
97
  naive_min_max_quantize.materialize_input,
@@ -118,6 +119,7 @@ for op_name, materialize_func in zip(
118
119
  naive_min_max_quantize.materialize_softmax_and_logistic,
119
120
  naive_min_max_quantize.materialize_slice,
120
121
  naive_min_max_quantize.materialize_sum,
122
+ naive_min_max_quantize.materialize_select_v2,
121
123
  ),
122
124
  ):
123
125
  register_quantized_op(
@@ -325,6 +325,23 @@ def materialize_slice(
325
325
  )
326
326
 
327
327
 
328
+ def materialize_select_v2(
329
+ op_info: qtyping.OpInfo,
330
+ graph_info: qtyping.GraphInfo,
331
+ tensor_name_to_qsv: dict[str, Any],
332
+ ) -> list[qtyping.TensorTransformationParams]:
333
+ """Materialize tensors in tfl.select_v2."""
334
+ return utils.materialize_standard_op(
335
+ op_info,
336
+ graph_info,
337
+ tensor_name_to_qsv,
338
+ constraint=_OpQuantConstraint.SAME_AS_OUTPUT_SCALE,
339
+ inputs_to_ignore=[
340
+ 0,
341
+ ], # Condition tensor does not need to be quantized.
342
+ )
343
+
344
+
328
345
  def materialize_sum(
329
346
  op_info: qtyping.OpInfo,
330
347
  graph_info: qtyping.GraphInfo,
@@ -166,7 +166,8 @@ DEFAULT_JSON_POLICY = """
166
166
  "OUTPUT",
167
167
  "SLICE",
168
168
  "EMBEDDING_LOOKUP",
169
- "SUM"
169
+ "SUM",
170
+ "SELECT_V2"
170
171
  ],
171
172
  "static_wi8_ai8": [
172
173
  "ADD",
@@ -193,7 +194,8 @@ DEFAULT_JSON_POLICY = """
193
194
  "OUTPUT",
194
195
  "SLICE",
195
196
  "EMBEDDING_LOOKUP",
196
- "SUM"
197
+ "SUM",
198
+ "SELECT_V2"
197
199
  ],
198
200
  "static_wi4_ai8": ["FULLY_CONNECTED", "CONV_2D", "INPUT", "OUTPUT"],
199
201
  "static_wi4_ai16": ["FULLY_CONNECTED", "CONV_2D", "INPUT", "OUTPUT"],
@@ -59,6 +59,7 @@ class TFLOperationName(str, enum.Enum):
59
59
  LOGISTIC = 'LOGISTIC'
60
60
  SLICE = 'SLICE'
61
61
  SUM = 'SUM'
62
+ SELECT_V2 = 'SELECT_V2'
62
63
 
63
64
 
64
65
  class QuantizeMode(enum.Enum):
@@ -61,6 +61,7 @@ TFL_OP_NAME_TO_CODE = immutabledict.immutabledict({
61
61
  _TFLOpName.LOGISTIC: schema_py_generated.BuiltinOperator.LOGISTIC,
62
62
  _TFLOpName.SLICE: schema_py_generated.BuiltinOperator.SLICE,
63
63
  _TFLOpName.SUM: schema_py_generated.BuiltinOperator.SUM,
64
+ _TFLOpName.SELECT_V2: schema_py_generated.BuiltinOperator.SELECT_V2,
64
65
  })
65
66
 
66
67
  TFL_OP_CODE_TO_NAME = immutabledict.immutabledict(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ai-edge-quantizer-nightly
3
- Version: 0.0.1.dev20241121
3
+ Version: 0.0.1.dev20241122
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
@@ -1,18 +1,18 @@
1
1
  ai_edge_quantizer/__init__.py,sha256=4pFSkukSwahYyzwqia0yPRyz8TnFQfGRthVJhYpMWas,793
2
- ai_edge_quantizer/algorithm_manager.py,sha256=87ZbgBOpIECW4DuvExHctuhQQOlX0yH0QXA39UWLq3o,5897
2
+ ai_edge_quantizer/algorithm_manager.py,sha256=9nd4Txfl2z-14rFHmL7vqSfnkAQeagCRKyCIQ7ru0_Y,5981
3
3
  ai_edge_quantizer/algorithm_manager_api.py,sha256=u903TG0s1uIDhJqfeJne3CFl8A93phZrwgV2-hwdcXU,9247
4
4
  ai_edge_quantizer/algorithm_manager_api_test.py,sha256=tL_ozYFTsOPX8qGcti0KTz37nVsCxf0SSG5C45SyT-g,7319
5
5
  ai_edge_quantizer/calibrator.py,sha256=BSu0DPzVhAgFFA0JsHZtawPFlr0YPirRxItuA9SerNg,11007
6
6
  ai_edge_quantizer/calibrator_test.py,sha256=5DGvKWRRjjU3L5wZoN56AyOVljmxOitwhuBUp6GL_bU,11354
7
7
  ai_edge_quantizer/conftest.py,sha256=SxCz-5LlRD_lQm4hQc4c6IGG7DS8d7IyEWY9gnscPN0,794
8
- ai_edge_quantizer/default_policy.py,sha256=w-w0t-MWRZey755hP808DF1EMpbBhpm7zm7_3xCGBmM,9041
8
+ ai_edge_quantizer/default_policy.py,sha256=TQ9yY8jtrSpMsTBsTyKW6TY-voGH_psvwGZoFglAbiA,9079
9
9
  ai_edge_quantizer/model_modifier.py,sha256=Z8EYtrz4zhCFpzd1zVwl2AetVE3BGBf5OvB2DbVQuds,5850
10
10
  ai_edge_quantizer/model_modifier_test.py,sha256=cJd04SLOG-fQZZNZPcisoBLx3cLtWEwGqUBbLb-pif4,4751
11
11
  ai_edge_quantizer/model_validator.py,sha256=QvlG1TewSBo9FMwzDYPFGqR4mOa_Xhn21wi2OFAvbCI,12593
12
12
  ai_edge_quantizer/model_validator_test.py,sha256=ctvVmMHvnmFbkG4o8Jaa6kXXRrGHzhYpNylgLSmOboA,12951
13
13
  ai_edge_quantizer/params_generator.py,sha256=FvBub5yM2q98k7wNLgEyRerf8sVIETvGbrFcXFPUPdA,13523
14
14
  ai_edge_quantizer/params_generator_test.py,sha256=d9JwR-yxNJgg1SW-m8sFFPkIRdhgsDwMpVKsBQFL0gg,37658
15
- ai_edge_quantizer/qtyping.py,sha256=cMemNPoBjDNJ1F84FtV_3QPfifcKIpl17_QSpkU0gM4,14551
15
+ ai_edge_quantizer/qtyping.py,sha256=bue_WfK05QTkQcoyVVWeIxh8LRVGhHMWruXk3cgpFpw,14577
16
16
  ai_edge_quantizer/quantizer.py,sha256=OYfSo06JcoursXbJBRfHQbR2-Pa4sHnZB2n9od9OzEY,13039
17
17
  ai_edge_quantizer/quantizer_test.py,sha256=38oTMJwMmxwPDeqT3eaVbazjtuIUIzMQ3mJNKh_eNQY,20493
18
18
  ai_edge_quantizer/recipe.py,sha256=r5tJiUs-ihZFzeK_jP2sUIUgTqZsL5SWvbUokuIUPDo,2251
@@ -28,7 +28,7 @@ ai_edge_quantizer/algorithms/nonlinear_quantize/__init__.py,sha256=lpq1g2ayg3lCP
28
28
  ai_edge_quantizer/algorithms/nonlinear_quantize/float_casting.py,sha256=Bs9CK7wZAw6jNaZ8xEtbwO2vM34VYXNZSMVWvxJo9nw,9297
29
29
  ai_edge_quantizer/algorithms/nonlinear_quantize/float_casting_test.py,sha256=s64eDDH9bmRWy6Bl1peHnhGewLnFJjvnhYOdjo1zYOA,22625
30
30
  ai_edge_quantizer/algorithms/uniform_quantize/__init__.py,sha256=lpq1g2ayg3lCPLy79t2VicYcnGKw64FfYIj1V7J-4m8,676
31
- ai_edge_quantizer/algorithms/uniform_quantize/naive_min_max_quantize.py,sha256=UPpHZalqgy6jaQVY1c7ThhoeJouk4RcIk_HczoJcwEc,20580
31
+ ai_edge_quantizer/algorithms/uniform_quantize/naive_min_max_quantize.py,sha256=oU4EhsDhWoipR0M28yILGdRcs2duWQBU5RpDyGiAGHk,21065
32
32
  ai_edge_quantizer/algorithms/uniform_quantize/naive_min_max_quantize_test.py,sha256=MfN2JFogBVsPIJ_Fdqf3ot4vn-WLIjcnyL2oBnmrwiI,6739
33
33
  ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor.py,sha256=B-s1KMfb9tqvaDhHJV-M2zRR078z5Mwv-P9h77S3Mis,12229
34
34
  ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor_test.py,sha256=WZ4_bvbG999nOtCIqn7mrMnpRdoJOdiyzxhsL_QiPHA,11395
@@ -50,14 +50,14 @@ ai_edge_quantizer/utils/__init__.py,sha256=lpq1g2ayg3lCPLy79t2VicYcnGKw64FfYIj1V
50
50
  ai_edge_quantizer/utils/calibration_utils.py,sha256=1Fj9MIO6aLZIRgyd4axvZN4S_O64nB_-Miu1WP664js,2536
51
51
  ai_edge_quantizer/utils/calibration_utils_test.py,sha256=Z-AcdTieesWFKyKBb08ZXm4Mgu6cvJ4bg2-MJ7hLD10,2856
52
52
  ai_edge_quantizer/utils/test_utils.py,sha256=95BDAdjE4Zvd6JZ90fG8FE3wKWE-Lu0ZIE3hQ1B6adI,3616
53
- ai_edge_quantizer/utils/tfl_flatbuffer_utils.py,sha256=1seh9naaVsmiI5lao-6stTNmYmYdaOvq4V0RASqKCSU,10053
53
+ ai_edge_quantizer/utils/tfl_flatbuffer_utils.py,sha256=F6_AkCSv35FAhJX2qel8VTARhGOVwaeo7_mqRZygrpA,10126
54
54
  ai_edge_quantizer/utils/tfl_flatbuffer_utils_test.py,sha256=AbyDxoM62k4ojD8gPdkWo--xe5hlX3t0kobQSA80kuk,7740
55
55
  ai_edge_quantizer/utils/tfl_interpreter_utils.py,sha256=GzrsaL3fkOXN5iPRJv7lqhNISY6lnrBVTotWDHzI5m8,10344
56
56
  ai_edge_quantizer/utils/tfl_interpreter_utils_test.py,sha256=Op3JxtOqlrjzmYF18jnnstL1k9xiY9kKJ8S2vklKGkc,11327
57
57
  ai_edge_quantizer/utils/validation_utils.py,sha256=oYw33Sg547AqtGw-choPUJmp9SAKkV46J_ddqSsum2Q,3950
58
58
  ai_edge_quantizer/utils/validation_utils_test.py,sha256=V_qNDikPD4OPB-siOLQCWNVWTAu87h2IgNYt7teFd-o,2934
59
- ai_edge_quantizer_nightly-0.0.1.dev20241121.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
60
- ai_edge_quantizer_nightly-0.0.1.dev20241121.dist-info/METADATA,sha256=AM9SLfWisYlPdwVuC34Y4pnK2SgrkZiXYbm_JAIcGzE,1484
61
- ai_edge_quantizer_nightly-0.0.1.dev20241121.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
62
- ai_edge_quantizer_nightly-0.0.1.dev20241121.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
63
- ai_edge_quantizer_nightly-0.0.1.dev20241121.dist-info/RECORD,,
59
+ ai_edge_quantizer_nightly-0.0.1.dev20241122.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
60
+ ai_edge_quantizer_nightly-0.0.1.dev20241122.dist-info/METADATA,sha256=SPsCOtbr7DB1RDOdpKSMifClBKnsnlrreRe9-iQGZ9s,1484
61
+ ai_edge_quantizer_nightly-0.0.1.dev20241122.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
62
+ ai_edge_quantizer_nightly-0.0.1.dev20241122.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
63
+ ai_edge_quantizer_nightly-0.0.1.dev20241122.dist-info/RECORD,,