ai-edge-torch-nightly 0.3.0.dev20241106__py3-none-any.whl → 0.3.0.dev20241108__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.
@@ -76,7 +76,7 @@ def run_passes(
76
76
  range_constraints=exported_program.range_constraints,
77
77
  module_call_graph=exported_program.module_call_graph,
78
78
  example_inputs=exported_program.example_inputs,
79
- verifier=exported_program.verifier,
79
+ verifiers=exported_program.verifiers,
80
80
  constants=exported_program.constants,
81
81
  )
82
82
  return exported_program
@@ -59,3 +59,17 @@ def graph_module_flat_inputs(ep: torch.export.ExportedProgram, args, kwargs):
59
59
  ordered_tensor_constants = tuple()
60
60
 
61
61
  return (*param_buffer_values, *flat_args, *ordered_tensor_constants)
62
+
63
+
64
+ # TODO(b/331481564): Replace this with CanonicalizePass + run_decomposition
65
+ def safe_run_decompositions(exported_program, decomp_table=None):
66
+ for node in exported_program.graph.nodes:
67
+ if node.target == torch.ops.aten.view.default:
68
+ # Passes or torch.export may generate aten.view nodes not respecting the
69
+ # tensor memory format. Changes all the aten.view to torch.reshape
70
+ # for retracing. If the input memory format is already contiguous,
71
+ # retracing in run_decomposition below would decompose torch.reshape
72
+ # back to one aten.view.
73
+ node.target = lambda self, size: torch.reshape(self.contiguous(), size)
74
+
75
+ return exported_program.run_decompositions(decomp_table)
@@ -262,13 +262,13 @@ def exported_program_to_mlir(
262
262
  exported_program: torch.export.ExportedProgram,
263
263
  ) -> MlirLowered:
264
264
  """Lower the exported program to MLIR."""
265
- exported_program = exported_program.run_decompositions(
266
- lowerings.decompositions()
265
+ exported_program = _torch_future.safe_run_decompositions(
266
+ exported_program, lowerings.decompositions()
267
267
  )
268
268
 
269
269
  _convert_i64_to_i32(exported_program)
270
- exported_program = exported_program.run_decompositions(
271
- lowerings.decompositions()
270
+ exported_program = _torch_future.safe_run_decompositions(
271
+ exported_program, lowerings.decompositions()
272
272
  )
273
273
 
274
274
  with export_utils.create_ir_context() as context, ir.Location.unknown():
ai_edge_torch/version.py CHANGED
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
  # ==============================================================================
15
15
 
16
- __version__ = "0.3.0.dev20241106"
16
+ __version__ = "0.3.0.dev20241108"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ai-edge-torch-nightly
3
- Version: 0.3.0.dev20241106
3
+ Version: 0.3.0.dev20241108
4
4
  Summary: Supporting PyTorch models with the Google AI Edge TFLite runtime.
5
5
  Home-page: https://github.com/google-ai-edge/ai-edge-torch
6
6
  Keywords: On-Device ML,AI,Google,TFLite,PyTorch,LLMs,GenAI
@@ -29,7 +29,7 @@ Requires-Dist: safetensors
29
29
  Requires-Dist: tabulate
30
30
  Requires-Dist: torch>=2.4.0
31
31
  Requires-Dist: torch-xla>=2.4.0
32
- Requires-Dist: tf-nightly==2.19.0.dev20241001
32
+ Requires-Dist: tf-nightly>=2.19.0.dev20241001
33
33
  Requires-Dist: ai-edge-litert-nightly
34
34
  Requires-Dist: ai-edge-quantizer-nightly
35
35
 
@@ -1,9 +1,9 @@
1
1
  ai_edge_torch/__init__.py,sha256=48qP37uHT90YPs4eIUQxCiWVwqGEX3idCUs6mQKvX1U,1168
2
2
  ai_edge_torch/config.py,sha256=FMWeCH2b7HYILBvaI1iZNnYCO4WAhDOwBZBmIE-xrF0,909
3
3
  ai_edge_torch/conftest.py,sha256=r0GTrhMRhlmOGrrkvumHN8hkmyug6WvF60vWq8wRIBI,758
4
- ai_edge_torch/fx_pass_base.py,sha256=SrYveglaiA_DXPoRBqSXClWM1q7853I5ujRorq_MV0M,4251
4
+ ai_edge_torch/fx_pass_base.py,sha256=518ziQ0TUxqum2qZXqlD8qr65pHPh8ZNLnwFC6zvK3k,4253
5
5
  ai_edge_torch/model.py,sha256=N-pNpTxzhaFGhWhnSGd70lBzb9VlEhTOq5mddU7bvvI,5542
6
- ai_edge_torch/version.py,sha256=sQ3ZJv6ITWXDYt620D2xXSV4hpsToWri5zvksNUd0SI,706
6
+ ai_edge_torch/version.py,sha256=sBOl0mgVPJtokiP8qTbTtY0R_qIaF0KNiALh7P3AJEk,706
7
7
  ai_edge_torch/_convert/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
8
8
  ai_edge_torch/_convert/conversion.py,sha256=HwzfRx_DX5TLtPqwEH1_NOm38_INvHzHl4_mX67KOdQ,5448
9
9
  ai_edge_torch/_convert/conversion_utils.py,sha256=Sr8qXVcTwc-ZnZmK7yxVrIOOp1S_vNrwzC0zUvLTI2o,2160
@@ -155,9 +155,9 @@ ai_edge_torch/lowertools/test_utils.py,sha256=bPgc2iXX16KYtMNvmsRdKfrCY6UJmcfitf
155
155
  ai_edge_torch/lowertools/torch_xla_utils.py,sha256=XGZE0vZG9WSQT-6dFmPlU8W89z8rfXPRGjuZeuhXCIw,9205
156
156
  ai_edge_torch/lowertools/translate_recipe.py,sha256=ymkBpFqAUiupRWqrPOWiVphKcXR1K5vHK0RjgBFtxlE,5652
157
157
  ai_edge_torch/odml_torch/__init__.py,sha256=S8jOzE9nLof-6es3XDiGJRN-9H_XTxsVm9dE7lD3RWo,812
158
- ai_edge_torch/odml_torch/_torch_future.py,sha256=jSYHf1CMTJzMizPMbu2b39hAt0ZTR6gQLq67GMe9KTo,2336
158
+ ai_edge_torch/odml_torch/_torch_future.py,sha256=AJ0klpsbu2ZBTfiZlqSOoaYzBVITt40a1fYN8xKkEPw,3044
159
159
  ai_edge_torch/odml_torch/_torch_library.py,sha256=Lw1gqL2HWNRspdTwNhIkYAHDyafHedHtkXyKKxn-Wss,805
160
- ai_edge_torch/odml_torch/export.py,sha256=q6cvB3RAKL7hlQFNGqsE3u-NqWWPSzj-8M38u8loSpk,11544
160
+ ai_edge_torch/odml_torch/export.py,sha256=4xwrsDeOAgzoB9m7EeNsBj6dC5Ajtn5aKDRQkdHxa-o,11584
161
161
  ai_edge_torch/odml_torch/export_utils.py,sha256=q84U69ZQ82hLXw-xncJ8IW-K71Xux-NWlzZTs7hdZWA,5127
162
162
  ai_edge_torch/odml_torch/tf_integration.py,sha256=lTFJPPEijLPFmn6qq2jbpVTQOo0YaOTK36kK6rCiyIE,5956
163
163
  ai_edge_torch/odml_torch/composite/__init__.py,sha256=71GM_gDZxJyo38ZSoYSwhZX3xKA9rknO93JS9kw9w_c,778
@@ -186,8 +186,8 @@ ai_edge_torch/quantize/quant_config.py,sha256=U0KisSW-uZkoMJcy-ZP9W57p3tsa594fr9
186
186
  ai_edge_torch/testing/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
187
187
  ai_edge_torch/testing/model_coverage/__init__.py,sha256=5P8J6Zk5YYtDvTBucFvB9NGSRI7Gw_24WnrbhXgycEE,765
188
188
  ai_edge_torch/testing/model_coverage/model_coverage.py,sha256=UPB448aMDUyC0HNYVqio2rcJPnDN0tBQMP08J6vPYew,4718
189
- ai_edge_torch_nightly-0.3.0.dev20241106.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
190
- ai_edge_torch_nightly-0.3.0.dev20241106.dist-info/METADATA,sha256=qP9cLptTjaybmmaN6zeEgnSJ2cvIzt2L_B_4X5wXYXs,1897
191
- ai_edge_torch_nightly-0.3.0.dev20241106.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
192
- ai_edge_torch_nightly-0.3.0.dev20241106.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
193
- ai_edge_torch_nightly-0.3.0.dev20241106.dist-info/RECORD,,
189
+ ai_edge_torch_nightly-0.3.0.dev20241108.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
190
+ ai_edge_torch_nightly-0.3.0.dev20241108.dist-info/METADATA,sha256=gp2VN_X4YPdK8axZYIhqafgiJhCwfiN_tOWT-yL3lW0,1897
191
+ ai_edge_torch_nightly-0.3.0.dev20241108.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
192
+ ai_edge_torch_nightly-0.3.0.dev20241108.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
193
+ ai_edge_torch_nightly-0.3.0.dev20241108.dist-info/RECORD,,