ai-edge-torch-nightly 0.3.0.dev20241031__py3-none-any.whl → 0.3.0.dev20241102__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -76,9 +76,7 @@ def build_norm(dim: int, config: cfg.NormalizationConfig):
76
76
  zero_centered_gamma=config.zero_centered,
77
77
  )
78
78
  elif config.type == cfg.NormalizationType.LAYER_NORM:
79
- return normalization.LayerNorm(
80
- dim, config.epsilon, config.enable_hlfb
81
- )
79
+ return normalization.LayerNorm(dim, config.epsilon, config.enable_hlfb)
82
80
  elif config.type == cfg.NormalizationType.GROUP_NORM:
83
81
  return normalization.GroupNorm(
84
82
  config.group_num, dim, config.epsilon, config.enable_hlfb
@@ -19,9 +19,14 @@ from dataclasses import dataclass
19
19
  import gc
20
20
  import itertools
21
21
  import logging
22
+ import os
22
23
  import tempfile
23
24
  from typing import Any, Dict, Optional, Tuple, Union
24
25
 
26
+ if "PJRT_DEVICE" not in os.environ:
27
+ # https://github.com/google-ai-edge/ai-edge-torch/issues/326
28
+ os.environ["PJRT_DEVICE"] = "CPU"
29
+
25
30
  from ai_edge_torch import model
26
31
  from ai_edge_torch._convert import conversion_utils
27
32
  from ai_edge_torch._convert import signature as signature_module
@@ -204,6 +204,13 @@ def _aten_div(mod, x, y, *, rounding_mode=None, out=None) -> ir.Value:
204
204
  return stablehlo.divide(x, y)
205
205
 
206
206
 
207
+ # https://pytorch.org/docs/stable/generated/torch.floor.html
208
+ # https://openxla.org/stablehlo/spec#floor
209
+ @lower(torch.ops.aten.floor)
210
+ def _aten_floor(lctx, x: ir.Value, *, out=None) -> ir.Value:
211
+ return stablehlo.floor(x)
212
+
213
+
207
214
  # Schema:
208
215
  # - aten::slice_scatter(Tensor self, Tensor src, int dim=0, SymInt?
209
216
  # start=None, SymInt? end=None, SymInt step=1) -> Tensor
@@ -129,7 +129,6 @@ lower_by_torch_xla2(torch.ops.aten.expand_copy)
129
129
  lower_by_torch_xla2(torch.ops.aten.expm1)
130
130
  lower_by_torch_xla2(torch.ops.aten.fill)
131
131
  lower_by_torch_xla2(torch.ops.aten.flip)
132
- lower_by_torch_xla2(torch.ops.aten.floor)
133
132
  lower_by_torch_xla2(torch.ops.aten.fmod)
134
133
  lower_by_torch_xla2(torch.ops.aten.full)
135
134
  lower_by_torch_xla2(torch.ops.aten.full_like)
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.dev20241031"
16
+ __version__ = "0.3.0.dev20241102"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ai-edge-torch-nightly
3
- Version: 0.3.0.dev20241031
3
+ Version: 0.3.0.dev20241102
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
@@ -3,7 +3,7 @@ ai_edge_torch/config.py,sha256=FMWeCH2b7HYILBvaI1iZNnYCO4WAhDOwBZBmIE-xrF0,909
3
3
  ai_edge_torch/conftest.py,sha256=r0GTrhMRhlmOGrrkvumHN8hkmyug6WvF60vWq8wRIBI,758
4
4
  ai_edge_torch/fx_pass_base.py,sha256=SrYveglaiA_DXPoRBqSXClWM1q7853I5ujRorq_MV0M,4251
5
5
  ai_edge_torch/model.py,sha256=N-pNpTxzhaFGhWhnSGd70lBzb9VlEhTOq5mddU7bvvI,5542
6
- ai_edge_torch/version.py,sha256=wnBFhJxu9TS9mfew7Brr-kozSDNAKm1pPh1pPVMySy4,706
6
+ ai_edge_torch/version.py,sha256=MTVXztgRjBv5i7qeMXt1S7fhLA0NzLfcODyncYnMThI,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
@@ -107,7 +107,7 @@ ai_edge_torch/generative/fx_passes/remove_sdpa_zero_mask_pass.py,sha256=hhxSQvkD
107
107
  ai_edge_torch/generative/layers/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
108
108
  ai_edge_torch/generative/layers/attention.py,sha256=Z0Y_G8IG0LmvLX2u9D8__Fkr22szB-az6wMNnZpzhkA,13233
109
109
  ai_edge_torch/generative/layers/attention_utils.py,sha256=zBVwlBUTs-nStIKCZG0ks5ra7tsqc9ShfakFJKH5rds,7344
110
- ai_edge_torch/generative/layers/builder.py,sha256=XyZS1RrnMbvypeLMfwU7h1Y4x5r4WGgOx2YGJF0OUNQ,5064
110
+ ai_edge_torch/generative/layers/builder.py,sha256=Z5LyzCEThgnYZeyViakaE3yJVzTGHtw13acHsAQR15U,5050
111
111
  ai_edge_torch/generative/layers/feed_forward.py,sha256=hdICat-8gW7-vxDAevJQ8NQ-mynllPiqLdXQMF6JMnc,4189
112
112
  ai_edge_torch/generative/layers/kv_cache.py,sha256=2El7kZYnQRCRcVc63xgiAdBh9oVOksDu35p9XggvaGE,6148
113
113
  ai_edge_torch/generative/layers/model_config.py,sha256=DdsdhTP5tZAtyWim-qW2m8HDBsYbs7boqSDb83vwgmE,6998
@@ -152,7 +152,7 @@ ai_edge_torch/lowertools/_shim.py,sha256=ilL7x1ebUBj1clg7bagrX4y_nVSHiGrvDrOVfuT
152
152
  ai_edge_torch/lowertools/common_utils.py,sha256=Z7p-ivOHtddktpnHrlDm_dSoTxJOdEjFXIGQbzjgwQo,4504
153
153
  ai_edge_torch/lowertools/odml_torch_utils.py,sha256=K5dZ_fFDL3GWKo0IoY4OC_GX5MY-guY-MqteolyV9hg,8098
154
154
  ai_edge_torch/lowertools/test_utils.py,sha256=bPgc2iXX16KYtMNvmsRdKfrCY6UJmcfitfCOvHoD7Oc,1930
155
- ai_edge_torch/lowertools/torch_xla_utils.py,sha256=S7RWzauts-15xP6VYuM3aAd9cyAGHstYD2A4dlv3d30,9059
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
158
  ai_edge_torch/odml_torch/_torch_future.py,sha256=jSYHf1CMTJzMizPMbu2b39hAt0ZTR6gQLq67GMe9KTo,2336
@@ -170,10 +170,10 @@ ai_edge_torch/odml_torch/jax_bridge/__init__.py,sha256=Jco5zvejxuyl9xHQxZICAKbkg
170
170
  ai_edge_torch/odml_torch/jax_bridge/_wrap.py,sha256=drN3L0uTsSjkluKgt6Ngq7b5HLReE_7iAitHpZ9PKqE,5428
171
171
  ai_edge_torch/odml_torch/jax_bridge/utils.py,sha256=T8isGc896VrHZ6c_L5pYmLpolQ7ibcOlgWfPuVFPzIg,2264
172
172
  ai_edge_torch/odml_torch/lowerings/__init__.py,sha256=dE_qzh-OnCNjWzqs1-PHs5PNlRF726qMQKM3tkwAzEs,959
173
- ai_edge_torch/odml_torch/lowerings/_basic.py,sha256=VvB050UCjB17h6-UNtsaqzVF13MGI01fPFkdmmghTj4,8790
173
+ ai_edge_torch/odml_torch/lowerings/_basic.py,sha256=z_hPJX9n97d6obcsS9OHXpKqbmw6QqACXgnq5ML6Rhs,9014
174
174
  ai_edge_torch/odml_torch/lowerings/_batch_norm.py,sha256=PaLI0BB6pdBW1VyfW8VTOT_Be-ZcqYdNOsyfzKfq8Cg,2064
175
175
  ai_edge_torch/odml_torch/lowerings/_convolution.py,sha256=v1VdKmL8YLJv3PR9VgyNghO83A25PpTzY2ZUAJqlq3Q,6847
176
- ai_edge_torch/odml_torch/lowerings/_jax_lowerings.py,sha256=UI_2bbtbkZLBVVcYBXvA6JT1Fg2W_E_OSKYHT-D9xXI,10854
176
+ ai_edge_torch/odml_torch/lowerings/_jax_lowerings.py,sha256=1JeX3j7Rt3KE7Z2eYRrhtcYgO3EKnRyZFKAUWXw-bsU,10812
177
177
  ai_edge_torch/odml_torch/lowerings/_layer_norm.py,sha256=1ePJs7oIdUkVdMddFsXMc53qTkEKqGz0ZhQQoNzBa10,2862
178
178
  ai_edge_torch/odml_torch/lowerings/context.py,sha256=jslcCv7r_HtImSRTxJwHAUV_QCu9Jub51lovmoBkmFA,1295
179
179
  ai_edge_torch/odml_torch/lowerings/registry.py,sha256=gqx3n1Mx8pnGQz3nkIF1T_8bkRabXLJBvUoJJn5kOUY,2911
@@ -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.dev20241031.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
190
- ai_edge_torch_nightly-0.3.0.dev20241031.dist-info/METADATA,sha256=7hq2x8xpfpPLE3bkpOz7ELzQC0Qcei1zWxo7tiFPOd4,1897
191
- ai_edge_torch_nightly-0.3.0.dev20241031.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
192
- ai_edge_torch_nightly-0.3.0.dev20241031.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
193
- ai_edge_torch_nightly-0.3.0.dev20241031.dist-info/RECORD,,
189
+ ai_edge_torch_nightly-0.3.0.dev20241102.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
190
+ ai_edge_torch_nightly-0.3.0.dev20241102.dist-info/METADATA,sha256=UTAgAa38boIpHQbWijPnUkyZ-NtTHG3X6kFczbw9bc0,1897
191
+ ai_edge_torch_nightly-0.3.0.dev20241102.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
192
+ ai_edge_torch_nightly-0.3.0.dev20241102.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
193
+ ai_edge_torch_nightly-0.3.0.dev20241102.dist-info/RECORD,,