ai-edge-torch-nightly 0.4.0.dev20250402__py3-none-any.whl → 0.4.0.dev20250405__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.
- ai_edge_torch/generative/examples/amd_llama_135m/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/deepseek/convert_to_tflite.py +2 -5
- ai_edge_torch/generative/examples/gemma/convert_gemma1_to_tflite.py +3 -2
- ai_edge_torch/generative/examples/gemma/convert_gemma2_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/gemma/gemma2.py +3 -2
- ai_edge_torch/generative/examples/gemma3/convert_gemma3_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/gemma3/decoder.py +3 -2
- ai_edge_torch/generative/examples/gemma3/gemma3.py +3 -2
- ai_edge_torch/generative/examples/llama/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/openelm/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/paligemma/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/paligemma/decoder.py +2 -1
- ai_edge_torch/generative/examples/paligemma/decoder2.py +2 -1
- ai_edge_torch/generative/examples/paligemma/paligemma.py +2 -2
- ai_edge_torch/generative/examples/phi/convert_phi3_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/phi/convert_phi4_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/phi/convert_to_tflite.py +3 -4
- ai_edge_torch/generative/examples/qwen/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/qwen_vl/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/examples/qwen_vl/decoder.py +2 -1
- ai_edge_torch/generative/examples/qwen_vl/qwen_vl.py +2 -2
- ai_edge_torch/generative/examples/smollm/convert_to_tflite.py +2 -2
- ai_edge_torch/generative/examples/smollm/convert_v2_to_tflite.py +2 -4
- ai_edge_torch/generative/examples/test_models/toy_model_with_kv_cache.py +2 -1
- ai_edge_torch/generative/examples/tiny_llama/convert_to_tflite.py +3 -3
- ai_edge_torch/generative/test/test_custom_dus.py +1 -0
- ai_edge_torch/generative/utilities/converter.py +3 -1
- ai_edge_torch/generative/utilities/export_config.py +38 -0
- ai_edge_torch/generative/utilities/model_builder.py +4 -20
- ai_edge_torch/generative/utilities/verifier.py +3 -1
- ai_edge_torch/odml_torch/lowerings/utils.py +47 -2
- ai_edge_torch/version.py +1 -1
- {ai_edge_torch_nightly-0.4.0.dev20250402.dist-info → ai_edge_torch_nightly-0.4.0.dev20250405.dist-info}/METADATA +1 -1
- {ai_edge_torch_nightly-0.4.0.dev20250402.dist-info → ai_edge_torch_nightly-0.4.0.dev20250405.dist-info}/RECORD +37 -36
- {ai_edge_torch_nightly-0.4.0.dev20250402.dist-info → ai_edge_torch_nightly-0.4.0.dev20250405.dist-info}/LICENSE +0 -0
- {ai_edge_torch_nightly-0.4.0.dev20250402.dist-info → ai_edge_torch_nightly-0.4.0.dev20250405.dist-info}/WHEEL +0 -0
- {ai_edge_torch_nightly-0.4.0.dev20250402.dist-info → ai_edge_torch_nightly-0.4.0.dev20250405.dist-info}/top_level.txt +0 -0
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting AMD-Llama-135m model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.amd_llama_135m import amd_llama_135m
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags("amd-llama-135m")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
def main(_):
|
28
28
|
pytorch_model = amd_llama_135m.build_model(
|
@@ -15,16 +15,13 @@
|
|
15
15
|
|
16
16
|
"""Example of converting DeepSeek R1 distilled models to tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
|
-
import pathlib
|
20
|
-
|
21
18
|
from absl import app
|
22
|
-
from absl import flags
|
23
19
|
from ai_edge_torch.generative.examples.deepseek import deepseek
|
24
20
|
from ai_edge_torch.generative.utilities import converter
|
25
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
26
22
|
|
27
23
|
flags = converter.define_conversion_flags("deepseek")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
28
25
|
|
29
26
|
def main(_):
|
30
27
|
pytorch_model = deepseek.build_model(
|
@@ -15,13 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Gemma1 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
19
|
from ai_edge_torch.generative.examples.gemma import gemma1
|
21
20
|
from ai_edge_torch.generative.utilities import converter
|
22
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
23
22
|
|
24
23
|
flags = converter.define_conversion_flags("gemma-2b")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
25
26
|
|
26
27
|
def main(_):
|
27
28
|
pytorch_model = gemma1.build_2b_model(
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Gemma2 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.gemma import gemma2
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags("gemma2-2b")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
def main(_):
|
28
28
|
pytorch_model = gemma2.build_2b_model(
|
@@ -23,6 +23,7 @@ from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
|
23
23
|
import ai_edge_torch.generative.layers.attention_utils as attn_utils
|
24
24
|
import ai_edge_torch.generative.layers.model_config as cfg
|
25
25
|
import ai_edge_torch.generative.layers.rotary_position_embedding as rotary_pos_emb
|
26
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
26
27
|
from ai_edge_torch.generative.utilities import model_builder
|
27
28
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
28
29
|
import torch
|
@@ -151,7 +152,7 @@ class Gemma2(nn.Module):
|
|
151
152
|
input_pos: torch.Tensor,
|
152
153
|
kv_cache: kv_utils.KVCache,
|
153
154
|
mask: Optional[torch.Tensor] = None,
|
154
|
-
export_config: Optional[
|
155
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
155
156
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
156
157
|
_, seq_len = tokens.size()
|
157
158
|
assert self.config.max_seq_len >= seq_len, (
|
@@ -184,7 +185,7 @@ class Gemma2(nn.Module):
|
|
184
185
|
mask: torch.Tensor | List[torch.Tensor],
|
185
186
|
input_pos: torch.Tensor,
|
186
187
|
kv_cache: kv_utils.KVCache,
|
187
|
-
export_config: Optional[
|
188
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
188
189
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
189
190
|
"""Forwards the model with input embeddings."""
|
190
191
|
assert len(self.transformer_blocks) == len(kv_cache.caches), (
|
@@ -15,16 +15,16 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Gemma3 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.gemma3 import gemma3
|
22
20
|
from ai_edge_torch.generative.layers.experimental import kv_cache
|
23
21
|
from ai_edge_torch.generative.utilities import converter
|
24
|
-
from ai_edge_torch.generative.utilities
|
22
|
+
from ai_edge_torch.generative.utilities import export_config
|
25
23
|
import torch
|
26
24
|
|
27
25
|
flags = converter.define_conversion_flags('gemma3-1b')
|
26
|
+
ExportConfig = export_config.ExportConfig
|
27
|
+
|
28
28
|
|
29
29
|
_MODEL_SIZE = flags.DEFINE_string(
|
30
30
|
'model_size',
|
@@ -23,6 +23,7 @@ from ai_edge_torch.generative.layers.experimental import attention
|
|
23
23
|
from ai_edge_torch.generative.layers.experimental import kv_cache as kv_utils
|
24
24
|
import ai_edge_torch.generative.layers.model_config as cfg
|
25
25
|
import ai_edge_torch.generative.layers.rotary_position_embedding as rotary_pos_emb
|
26
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
26
27
|
from ai_edge_torch.generative.utilities import model_builder
|
27
28
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
28
29
|
import torch
|
@@ -244,7 +245,7 @@ class Decoder(nn.Module):
|
|
244
245
|
input_embeds: Optional[torch.Tensor] = None,
|
245
246
|
mask: Optional[torch.Tensor] = None,
|
246
247
|
image_indices: Optional[torch.Tensor] = None,
|
247
|
-
export_config: Optional[
|
248
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
248
249
|
) -> dict[torch.Tensor, kv_utils.KVCacheBase]:
|
249
250
|
|
250
251
|
pixel_mask = None
|
@@ -288,7 +289,7 @@ class Decoder(nn.Module):
|
|
288
289
|
input_pos: torch.Tensor,
|
289
290
|
kv_cache: kv_utils.KVCacheBase,
|
290
291
|
pixel_mask: Optional[torch.Tensor] = None,
|
291
|
-
export_config: Optional[
|
292
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
292
293
|
) -> dict[torch.Tensor, kv_utils.KVCacheBase]:
|
293
294
|
"""Forwards the model with input embeddings."""
|
294
295
|
assert len(self.transformer_blocks) == len(kv_cache.caches), (
|
@@ -24,7 +24,7 @@ from ai_edge_torch.generative.examples.gemma3 import image_encoder
|
|
24
24
|
from ai_edge_torch.generative.layers import builder
|
25
25
|
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
26
26
|
import ai_edge_torch.generative.layers.model_config as cfg
|
27
|
-
from ai_edge_torch.generative.utilities import
|
27
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
28
28
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
29
29
|
import torch
|
30
30
|
from torch import nn
|
@@ -83,7 +83,7 @@ class Gemma3MM(nn.Module):
|
|
83
83
|
image_indices: Optional[torch.Tensor] = None,
|
84
84
|
image_feat_indices: Optional[torch.Tensor] = None,
|
85
85
|
pixel_values: torch.Tensor = None,
|
86
|
-
export_config: Optional[
|
86
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
87
87
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
88
88
|
_, seq_len = tokens.size()
|
89
89
|
assert self.config.decoder_config.max_seq_len >= seq_len, (
|
@@ -150,6 +150,7 @@ class Gemma3MM(nn.Module):
|
|
150
150
|
export_config=export_config,
|
151
151
|
)
|
152
152
|
|
153
|
+
|
153
154
|
def get_fake_model_config(**kwargs) -> Gemma3MMConfig:
|
154
155
|
return Gemma3MMConfig(
|
155
156
|
image_encoder_config=image_encoder.get_fake_image_encoder_config(),
|
@@ -15,15 +15,15 @@
|
|
15
15
|
|
16
16
|
"""Example of converting Llama 3.2 1B model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.llama import llama
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
|
26
24
|
flags = converter.define_conversion_flags('llama')
|
25
|
+
ExportConfig = export_config.ExportConfig
|
26
|
+
|
27
27
|
|
28
28
|
_MODEL_SIZE = flags.DEFINE_enum(
|
29
29
|
'model_size',
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting OpenELM model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.openelm import openelm
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags("openelm")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
def main(_):
|
28
28
|
pytorch_model = openelm.build_model(
|
@@ -15,15 +15,15 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a PaliGemma model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.paligemma import paligemma
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
import torch
|
25
23
|
|
26
24
|
flags = converter.define_conversion_flags('paligemma2-3b-224')
|
25
|
+
ExportConfig = export_config.ExportConfig
|
26
|
+
|
27
27
|
|
28
28
|
_VERSION = flags.DEFINE_enum(
|
29
29
|
'version',
|
@@ -19,6 +19,7 @@ from typing import Optional
|
|
19
19
|
|
20
20
|
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
21
21
|
import ai_edge_torch.generative.layers.model_config as cfg
|
22
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
22
23
|
from ai_edge_torch.generative.utilities import model_builder
|
23
24
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
24
25
|
import torch
|
@@ -54,7 +55,7 @@ class Decoder(model_builder.DecoderOnlyModel):
|
|
54
55
|
kv_cache: kv_utils.KVCache,
|
55
56
|
input_embeds: torch.Tensor = None,
|
56
57
|
mask: Optional[torch.Tensor] = None,
|
57
|
-
export_config: Optional[
|
58
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
58
59
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
59
60
|
if input_embeds is None:
|
60
61
|
return super().forward(
|
@@ -20,6 +20,7 @@ from typing import Optional
|
|
20
20
|
from ai_edge_torch.generative.examples.gemma import gemma2
|
21
21
|
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
22
22
|
import ai_edge_torch.generative.layers.model_config as cfg
|
23
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
23
24
|
from ai_edge_torch.generative.utilities import model_builder
|
24
25
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
25
26
|
import torch
|
@@ -57,7 +58,7 @@ class Decoder2(gemma2.Gemma2):
|
|
57
58
|
kv_cache: kv_utils.KVCache,
|
58
59
|
input_embeds: torch.Tensor = None,
|
59
60
|
mask: Optional[torch.Tensor] = None,
|
60
|
-
export_config: Optional[
|
61
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
61
62
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
62
63
|
if input_embeds is None:
|
63
64
|
return super().forward(tokens, input_pos, kv_cache, mask, export_config)
|
@@ -23,7 +23,7 @@ from ai_edge_torch.generative.examples.paligemma import decoder2
|
|
23
23
|
from ai_edge_torch.generative.examples.paligemma import image_encoder
|
24
24
|
import ai_edge_torch.generative.layers.kv_cache as kv_utils
|
25
25
|
import ai_edge_torch.generative.layers.model_config as cfg
|
26
|
-
from ai_edge_torch.generative.utilities import
|
26
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
27
27
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
28
28
|
import torch
|
29
29
|
from torch import nn
|
@@ -71,7 +71,7 @@ class PaliGemma(nn.Module):
|
|
71
71
|
kv_cache: kv_utils.KVCache,
|
72
72
|
mask: Optional[torch.Tensor] = None,
|
73
73
|
pixel_values: torch.Tensor = None,
|
74
|
-
export_config: Optional[
|
74
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
75
75
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
76
76
|
if pixel_values is None:
|
77
77
|
return self.decoder(
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Phi-3.5 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.phi import phi3
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags("phi3")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
def main(_):
|
28
28
|
pytorch_model = phi3.build_model(
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Phi-4 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.phi import phi4
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags("phi4")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
def main(_):
|
28
28
|
pytorch_model = phi4.build_model(
|
@@ -15,16 +15,15 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Phi-2 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
|
-
import pathlib
|
20
18
|
|
21
19
|
from absl import app
|
22
|
-
from absl import flags
|
23
20
|
from ai_edge_torch.generative.examples.phi import phi2
|
24
21
|
from ai_edge_torch.generative.utilities import converter
|
25
|
-
from ai_edge_torch.generative.utilities
|
22
|
+
from ai_edge_torch.generative.utilities import export_config
|
26
23
|
|
27
24
|
flags = converter.define_conversion_flags("phi2")
|
25
|
+
ExportConfig = export_config.ExportConfig
|
26
|
+
|
28
27
|
|
29
28
|
def main(_):
|
30
29
|
pytorch_model = phi2.build_model(
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting Qwen 2.5 models to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.qwen import qwen
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags('qwen')
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
_MODEL_SIZE = flags.DEFINE_enum(
|
28
28
|
'model_size',
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting a Qwen 2.5 VL model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.qwen_vl import qwen_vl
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags('qwen_vl')
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
_IMAGE_HEIGHT = flags.DEFINE_integer(
|
28
28
|
'image_height',
|
@@ -19,6 +19,7 @@ from typing import Optional, Tuple
|
|
19
19
|
|
20
20
|
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
21
21
|
import ai_edge_torch.generative.layers.model_config as cfg
|
22
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
22
23
|
from ai_edge_torch.generative.utilities import model_builder
|
23
24
|
import torch
|
24
25
|
|
@@ -41,7 +42,7 @@ class Decoder(model_builder.DecoderOnlyModel):
|
|
41
42
|
input_embeds: torch.Tensor = None,
|
42
43
|
rope: Tuple[torch.Tensor, torch.Tensor] = None,
|
43
44
|
mask: Optional[torch.Tensor] = None,
|
44
|
-
export_config: Optional[
|
45
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
45
46
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
46
47
|
if input_embeds is None:
|
47
48
|
_, seq_len = tokens.size()
|
@@ -22,7 +22,7 @@ from ai_edge_torch.generative.examples.qwen_vl import decoder
|
|
22
22
|
from ai_edge_torch.generative.examples.qwen_vl import image_encoder
|
23
23
|
import ai_edge_torch.generative.layers.kv_cache as kv_utils
|
24
24
|
import ai_edge_torch.generative.layers.model_config as cfg
|
25
|
-
from ai_edge_torch.generative.utilities import
|
25
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
26
26
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
27
27
|
import torch
|
28
28
|
from torch import nn
|
@@ -61,7 +61,7 @@ class QwenVL(nn.Module):
|
|
61
61
|
kv_cache: kv_utils.KVCache,
|
62
62
|
mask: Optional[torch.Tensor] = None,
|
63
63
|
pixel_values: torch.Tensor = None,
|
64
|
-
export_config: Optional[
|
64
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
65
65
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
66
66
|
if pixel_values is None:
|
67
67
|
return self.decoder(
|
@@ -20,7 +20,7 @@ from absl import app
|
|
20
20
|
from absl import flags
|
21
21
|
from ai_edge_torch.generative.examples.smollm import smollm
|
22
22
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities import
|
23
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
24
24
|
|
25
25
|
flags = converter.define_conversion_flags('smollm')
|
26
26
|
|
@@ -42,7 +42,7 @@ def main(_):
|
|
42
42
|
prefill_seq_len=flags.FLAGS.prefill_seq_lens,
|
43
43
|
quantize=flags.FLAGS.quantize,
|
44
44
|
lora_ranks=flags.FLAGS.lora_ranks,
|
45
|
-
export_config=
|
45
|
+
export_config=export_cfg.ExportConfig(
|
46
46
|
decode_batch_size=_DECODE_BATCH_SIZE.value
|
47
47
|
),
|
48
48
|
)
|
@@ -15,12 +15,10 @@
|
|
15
15
|
|
16
16
|
"""Example of converting SmolLM2 model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.smollm import smollm
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities import
|
21
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags('smollm2')
|
26
24
|
|
@@ -43,7 +41,7 @@ def main(_):
|
|
43
41
|
prefill_seq_len=flags.FLAGS.prefill_seq_lens,
|
44
42
|
quantize=flags.FLAGS.quantize,
|
45
43
|
lora_ranks=flags.FLAGS.lora_ranks,
|
46
|
-
export_config=
|
44
|
+
export_config=export_cfg.ExportConfig(
|
47
45
|
decode_batch_size=_DECODE_BATCH_SIZE.value
|
48
46
|
),
|
49
47
|
)
|
@@ -22,11 +22,12 @@ from ai_edge_torch.generative.layers import builder
|
|
22
22
|
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
23
23
|
import ai_edge_torch.generative.layers.attention_utils as attn_utils
|
24
24
|
import ai_edge_torch.generative.layers.model_config as cfg
|
25
|
-
from ai_edge_torch.generative.utilities
|
25
|
+
from ai_edge_torch.generative.utilities import export_config
|
26
26
|
import torch
|
27
27
|
from torch import nn
|
28
28
|
|
29
29
|
RoPECache = Tuple[torch.Tensor, torch.Tensor]
|
30
|
+
ExportConfig = export_config.ExportConfig
|
30
31
|
|
31
32
|
|
32
33
|
class ToyModelWithKVCache(torch.nn.Module):
|
@@ -15,14 +15,14 @@
|
|
15
15
|
|
16
16
|
"""Example of converting TinyLlama model to multi-signature tflite model."""
|
17
17
|
|
18
|
-
import os
|
19
18
|
from absl import app
|
20
|
-
from absl import flags
|
21
19
|
from ai_edge_torch.generative.examples.tiny_llama import tiny_llama
|
22
20
|
from ai_edge_torch.generative.utilities import converter
|
23
|
-
from ai_edge_torch.generative.utilities
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
24
22
|
|
25
23
|
flags = converter.define_conversion_flags("tiny_llama")
|
24
|
+
ExportConfig = export_config.ExportConfig
|
25
|
+
|
26
26
|
|
27
27
|
def main(_):
|
28
28
|
pytorch_model = tiny_llama.build_model(
|
@@ -23,9 +23,11 @@ from ai_edge_torch._convert import converter as converter_utils
|
|
23
23
|
from ai_edge_torch.generative.layers import lora as lora_utils
|
24
24
|
import ai_edge_torch.generative.layers.model_config as cfg
|
25
25
|
from ai_edge_torch.generative.quantize import quant_recipes
|
26
|
-
from ai_edge_torch.generative.utilities
|
26
|
+
from ai_edge_torch.generative.utilities import export_config
|
27
27
|
import torch
|
28
28
|
|
29
|
+
ExportConfig = export_config.ExportConfig
|
30
|
+
|
29
31
|
|
30
32
|
class ExportableModule(torch.nn.Module):
|
31
33
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright 2024 The AI Edge Torch Authors.
|
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
|
+
|
16
|
+
"""Config for customizing model export process."""
|
17
|
+
import dataclasses
|
18
|
+
from typing import List, Optional
|
19
|
+
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
20
|
+
import torch
|
21
|
+
|
22
|
+
dataclass = dataclasses.dataclass
|
23
|
+
|
24
|
+
|
25
|
+
@dataclass
|
26
|
+
class ExportConfig:
|
27
|
+
"""Model generating configuration settings."""
|
28
|
+
|
29
|
+
# On prefill signatures, should the model produce logit output?
|
30
|
+
# When False, only decode signatures will produce output.
|
31
|
+
output_logits_on_prefill: bool = False
|
32
|
+
# Attention masks given as inputs to the model.
|
33
|
+
prefill_mask: Optional[torch.Tensor | List[torch.Tensor]] = None
|
34
|
+
decode_mask: Optional[torch.Tensor | List[torch.Tensor]] = None
|
35
|
+
# The KV Cache class for K and V buffers in attention.
|
36
|
+
kvcache_cls: type = kv_utils.KVCache
|
37
|
+
# The batch size of the decode signature.
|
38
|
+
decode_batch_size: int = 1
|
@@ -16,8 +16,7 @@
|
|
16
16
|
"""Utilities to be used for re-authoring transformer models."""
|
17
17
|
|
18
18
|
import copy
|
19
|
-
from
|
20
|
-
from typing import List, Optional, Tuple
|
19
|
+
from typing import Optional, Tuple
|
21
20
|
|
22
21
|
from ai_edge_torch.generative.layers import attention
|
23
22
|
from ai_edge_torch.generative.layers import builder
|
@@ -25,6 +24,7 @@ from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
|
25
24
|
from ai_edge_torch.generative.layers import lora as lora_utils
|
26
25
|
import ai_edge_torch.generative.layers.attention_utils as attn_utils
|
27
26
|
import ai_edge_torch.generative.layers.model_config as cfg
|
27
|
+
from ai_edge_torch.generative.utilities import export_config as export_cfg
|
28
28
|
import ai_edge_torch.generative.utilities.loader as loading_utils
|
29
29
|
import torch
|
30
30
|
from torch import nn
|
@@ -48,22 +48,6 @@ TENSOR_NAMES_WITH_SEPARATE_LM_HEAD = copy.copy(TENSOR_NAMES)
|
|
48
48
|
TENSOR_NAMES_WITH_SEPARATE_LM_HEAD.lm_head = "lm_head"
|
49
49
|
|
50
50
|
|
51
|
-
@dataclass
|
52
|
-
class ExportConfig:
|
53
|
-
"""Model generating configuration settings."""
|
54
|
-
|
55
|
-
# On prefill signatures, should the model produce logit output?
|
56
|
-
# When False, only decode signatures will produce output.
|
57
|
-
output_logits_on_prefill: bool = False
|
58
|
-
# Attention masks given as inputs to the model.
|
59
|
-
prefill_mask: Optional[torch.Tensor | List[torch.Tensor]] = None
|
60
|
-
decode_mask: Optional[torch.Tensor | List[torch.Tensor]] = None
|
61
|
-
# The KV Cache class for K and V buffers in attention.
|
62
|
-
kvcache_cls: type = kv_utils.KVCache
|
63
|
-
# The batch size of the decode signature.
|
64
|
-
decode_batch_size: int = 1
|
65
|
-
|
66
|
-
|
67
51
|
class DecoderOnlyModel(nn.Module):
|
68
52
|
"""A simple decoder-only transformer model built from the Edge Generative API.
|
69
53
|
|
@@ -107,7 +91,7 @@ class DecoderOnlyModel(nn.Module):
|
|
107
91
|
kv_cache: kv_utils.KVCache,
|
108
92
|
mask: Optional[torch.Tensor] = None,
|
109
93
|
lora: Optional[lora_utils.LoRA] = None,
|
110
|
-
export_config: Optional[ExportConfig] = None,
|
94
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
111
95
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
112
96
|
_, seq_len = tokens.size()
|
113
97
|
assert self.config.max_seq_len >= seq_len, (
|
@@ -139,7 +123,7 @@ class DecoderOnlyModel(nn.Module):
|
|
139
123
|
input_pos: torch.Tensor,
|
140
124
|
kv_cache: kv_utils.KVCache,
|
141
125
|
lora: Optional[lora_utils.LoRA] = None,
|
142
|
-
export_config: Optional[ExportConfig] = None,
|
126
|
+
export_config: Optional[export_cfg.ExportConfig] = None,
|
143
127
|
) -> dict[torch.Tensor, kv_utils.KVCache]:
|
144
128
|
"""Forwards the model with input embeddings."""
|
145
129
|
assert len(self.transformer_blocks) == len(kv_cache.caches), (
|
@@ -19,9 +19,11 @@ import logging
|
|
19
19
|
from typing import Any, List, Optional
|
20
20
|
|
21
21
|
from ai_edge_torch.generative.layers import kv_cache as kv_utils
|
22
|
-
from ai_edge_torch.generative.utilities
|
22
|
+
from ai_edge_torch.generative.utilities import export_config
|
23
23
|
import torch
|
24
24
|
|
25
|
+
ExportConfig = export_config.ExportConfig
|
26
|
+
|
25
27
|
|
26
28
|
class ModelWrapper(torch.nn.Module):
|
27
29
|
"""A wrapper for the model to be verified.
|
@@ -14,10 +14,10 @@
|
|
14
14
|
# ==============================================================================
|
15
15
|
"""Utilities for building MLIR lowerings."""
|
16
16
|
|
17
|
+
from collections.abc import Callable
|
17
18
|
import functools
|
18
19
|
import numbers
|
19
|
-
from typing import Any
|
20
|
-
from typing import Optional
|
20
|
+
from typing import Any, Optional, Union
|
21
21
|
from ai_edge_torch.odml_torch import export_utils
|
22
22
|
from jax._src.lib.mlir import ir
|
23
23
|
from jax._src.lib.mlir.dialects import hlo as stablehlo
|
@@ -222,3 +222,48 @@ def convert_int_to_float(t: ir.Value) -> ir.Value:
|
|
222
222
|
return stablehlo.convert(
|
223
223
|
ir.RankedTensorType.get(t.type.shape, ir.F64Type.get()), t
|
224
224
|
)
|
225
|
+
|
226
|
+
|
227
|
+
# IR Helpers
|
228
|
+
IrValues = Union[ir.Value, tuple[ir.Value, ...]]
|
229
|
+
|
230
|
+
|
231
|
+
# Non-canonicalized dtype to IR type mapping.
|
232
|
+
_numpy_dtype_to_ir_type: dict[np.dtype, Callable[[], ir.Type]] = {
|
233
|
+
np.dtype(np.bool_): functools.partial(ir.IntegerType.get_signless, 1),
|
234
|
+
np.dtype(np.int8): functools.partial(ir.IntegerType.get_signless, 8),
|
235
|
+
np.dtype(np.int16): functools.partial(ir.IntegerType.get_signless, 16),
|
236
|
+
np.dtype(np.int32): functools.partial(ir.IntegerType.get_signless, 32),
|
237
|
+
np.dtype(np.int64): functools.partial(ir.IntegerType.get_signless, 64),
|
238
|
+
np.dtype(np.uint8): functools.partial(ir.IntegerType.get_unsigned, 8),
|
239
|
+
np.dtype(np.uint16): functools.partial(ir.IntegerType.get_unsigned, 16),
|
240
|
+
np.dtype(np.uint32): functools.partial(ir.IntegerType.get_unsigned, 32),
|
241
|
+
np.dtype(np.uint64): functools.partial(ir.IntegerType.get_unsigned, 64),
|
242
|
+
np.dtype(np.float16): ir.F16Type.get,
|
243
|
+
np.dtype(np.float32): ir.F32Type.get,
|
244
|
+
np.dtype(np.float64): ir.F64Type.get,
|
245
|
+
np.dtype(np.complex64): lambda: ir.ComplexType.get(ir.F32Type.get()),
|
246
|
+
np.dtype(np.complex128): lambda: ir.ComplexType.get(ir.F64Type.get()),
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
def numpy_dtype_to_ir_type(dtype: np.dtype | np.generic) -> ir.Type:
|
251
|
+
assert isinstance(dtype, (np.dtype, np.generic)), type(dtype)
|
252
|
+
dtype = np.dtype(dtype)
|
253
|
+
try:
|
254
|
+
ir_type_factory = _numpy_dtype_to_ir_type[dtype]
|
255
|
+
except KeyError as err:
|
256
|
+
raise TypeError(
|
257
|
+
f"No numpy_dtype_to_ir_type handler for dtype: {dtype}"
|
258
|
+
) from err
|
259
|
+
return ir_type_factory()
|
260
|
+
|
261
|
+
|
262
|
+
def numpy_array_constant(x: np.ndarray | np.generic) -> IrValues:
|
263
|
+
element_type = numpy_dtype_to_ir_type(x.dtype)
|
264
|
+
shape = x.shape
|
265
|
+
if x.dtype == np.bool_:
|
266
|
+
x = np.packbits(x, bitorder="little") # type: ignore
|
267
|
+
x = np.ascontiguousarray(x)
|
268
|
+
attr = ir.DenseElementsAttr.get(x, type=element_type, shape=shape) # type: ignore
|
269
|
+
return stablehlo.constant(attr)
|
ai_edge_torch/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ai-edge-torch-nightly
|
3
|
-
Version: 0.4.0.
|
3
|
+
Version: 0.4.0.dev20250405
|
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
|
@@ -2,7 +2,7 @@ ai_edge_torch/__init__.py,sha256=8sPR_5uXJA4NEE0nIwNdSl-ADOJEoR8hAgYvBQDY70Y,120
|
|
2
2
|
ai_edge_torch/_config.py,sha256=AiqhbcheF7j_ozIGDLC89k1we95aVgFDa-tR6h7UI0s,2529
|
3
3
|
ai_edge_torch/conftest.py,sha256=r0GTrhMRhlmOGrrkvumHN8hkmyug6WvF60vWq8wRIBI,758
|
4
4
|
ai_edge_torch/model.py,sha256=N-pNpTxzhaFGhWhnSGd70lBzb9VlEhTOq5mddU7bvvI,5542
|
5
|
-
ai_edge_torch/version.py,sha256=
|
5
|
+
ai_edge_torch/version.py,sha256=dHwQF4IL6SQLgcDQtrJ9QSvkuyMetKYrnxGGO9rTHtE,706
|
6
6
|
ai_edge_torch/_convert/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
7
7
|
ai_edge_torch/_convert/conversion.py,sha256=gpXQnifODU-mWxkUZw_3ov1lEYBw1SPVIcqj5k7pTGo,5550
|
8
8
|
ai_edge_torch/_convert/conversion_utils.py,sha256=Sr8qXVcTwc-ZnZmK7yxVrIOOp1S_vNrwzC0zUvLTI2o,2160
|
@@ -50,52 +50,52 @@ ai_edge_torch/generative/custom_ops/dynamic_update_slice.py,sha256=ZGAq2CfWZsfef
|
|
50
50
|
ai_edge_torch/generative/examples/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
51
51
|
ai_edge_torch/generative/examples/amd_llama_135m/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
52
52
|
ai_edge_torch/generative/examples/amd_llama_135m/amd_llama_135m.py,sha256=urNif89PyCXbdXT5spOeDvdM5luJ-a5HaXHM86v4JnU,2766
|
53
|
-
ai_edge_torch/generative/examples/amd_llama_135m/convert_to_tflite.py,sha256=
|
53
|
+
ai_edge_torch/generative/examples/amd_llama_135m/convert_to_tflite.py,sha256=z5MWiZLnsQzhNYMiQbcI9i0ki-dtkbimCptkiTFZxwo,1586
|
54
54
|
ai_edge_torch/generative/examples/amd_llama_135m/verify.py,sha256=o13NkFlBgawBsjdJup05VMUjAPvDRAmig6VyEkX8q6U,2426
|
55
55
|
ai_edge_torch/generative/examples/deepseek/__init__.py,sha256=JaAnrFoXTl3RJX97XspklkTyqOHVyAgRJsZtzNDd10c,671
|
56
|
-
ai_edge_torch/generative/examples/deepseek/convert_to_tflite.py,sha256=
|
56
|
+
ai_edge_torch/generative/examples/deepseek/convert_to_tflite.py,sha256=r6Pb5_LRKvw2QrOMn3PzunrVxPB-LSdyU2H1XORZo9A,1553
|
57
57
|
ai_edge_torch/generative/examples/deepseek/deepseek.py,sha256=AOAJ7ltXwY5IbmcCP2nVHW9FmRwexzfNxnoDlR-sW9c,2885
|
58
58
|
ai_edge_torch/generative/examples/deepseek/verify.py,sha256=iYldze-pvZGvPkkqr6zA7EmitPnH9sXkzjNVx353IcE,2403
|
59
59
|
ai_edge_torch/generative/examples/gemma/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
60
|
-
ai_edge_torch/generative/examples/gemma/convert_gemma1_to_tflite.py,sha256=
|
61
|
-
ai_edge_torch/generative/examples/gemma/convert_gemma2_to_tflite.py,sha256=
|
60
|
+
ai_edge_torch/generative/examples/gemma/convert_gemma1_to_tflite.py,sha256=tSEtGeS-Ndcc_cTm7c4CT4FqRiwrHedEv1oJk4Y_zYU,1552
|
61
|
+
ai_edge_torch/generative/examples/gemma/convert_gemma2_to_tflite.py,sha256=k2BUkf2cciItc3gFAyzWqcWZhlVFrD3TVikTmLXq04c,1553
|
62
62
|
ai_edge_torch/generative/examples/gemma/gemma1.py,sha256=w8oWYibZzvEvCDyp39EYyAWmjgJljhzdYPyFCfAWxZA,3497
|
63
|
-
ai_edge_torch/generative/examples/gemma/gemma2.py,sha256=
|
63
|
+
ai_edge_torch/generative/examples/gemma/gemma2.py,sha256=SyyRae8vWLn0WxduxtahzVRbdSq4T2k5-7t8PfCR_k8,11534
|
64
64
|
ai_edge_torch/generative/examples/gemma/verify_gemma1.py,sha256=ip-Gmk4CI5f0GWSdAIdrectxQWJ0t328KCsA4nfHuGg,1736
|
65
65
|
ai_edge_torch/generative/examples/gemma/verify_gemma2.py,sha256=IoBhEMwH07-tFm5-U6F2hpCsI8xynglhq1x9tIOdaPQ,1322
|
66
66
|
ai_edge_torch/generative/examples/gemma/verify_util.py,sha256=tR8RflXocDZqvuStyw9aFlzuiTllEC8rNnjrxms6_Is,5727
|
67
67
|
ai_edge_torch/generative/examples/gemma3/__init__.py,sha256=JaAnrFoXTl3RJX97XspklkTyqOHVyAgRJsZtzNDd10c,671
|
68
|
-
ai_edge_torch/generative/examples/gemma3/convert_gemma3_to_tflite.py,sha256=
|
69
|
-
ai_edge_torch/generative/examples/gemma3/decoder.py,sha256=
|
70
|
-
ai_edge_torch/generative/examples/gemma3/gemma3.py,sha256=
|
68
|
+
ai_edge_torch/generative/examples/gemma3/convert_gemma3_to_tflite.py,sha256=6Dkxi7Vs8xBaqMif00ATQSr_hTPhYXMdDqHwzOsAzq8,2952
|
69
|
+
ai_edge_torch/generative/examples/gemma3/decoder.py,sha256=__kpzArZ0mLfX7IzpHPmYFuhKTP9uI_9Lrzk_EfFDlE,15701
|
70
|
+
ai_edge_torch/generative/examples/gemma3/gemma3.py,sha256=5PEt0aWJ5wkUBvMoWFOJ-C48ZhG7uCVb8PCKQtZ8Fvw,6485
|
71
71
|
ai_edge_torch/generative/examples/gemma3/image_encoder.py,sha256=uRoLoBWzFtQz5wFZfPCxbkvZsgPAqSkUUsV3977GbYc,5184
|
72
72
|
ai_edge_torch/generative/examples/gemma3/verify_gemma3.py,sha256=v8oNXFICmVOtQxfO7IhZ8GnbvotEkDi9lzYHjoQyOso,2464
|
73
73
|
ai_edge_torch/generative/examples/gemma3/verify_util.py,sha256=u30qiZu3HJCTt5noWqtf9PgGLKQ87ke4Zpa4cpG6-As,8883
|
74
74
|
ai_edge_torch/generative/examples/llama/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
75
|
-
ai_edge_torch/generative/examples/llama/convert_to_tflite.py,sha256=
|
75
|
+
ai_edge_torch/generative/examples/llama/convert_to_tflite.py,sha256=A4uLUdqvU1NKo3seqZlWSS3fqYahnEKqNBQBJO6yXvE,1762
|
76
76
|
ai_edge_torch/generative/examples/llama/llama.py,sha256=UKvMO85_5z1vEY5MVu6QBW_vpQYA8LWHbJI4Yx6BrCc,6592
|
77
77
|
ai_edge_torch/generative/examples/llama/verify.py,sha256=X7oKQi85M789ugBrOlMvzk8eSRR3Kf1Mprfl-U-WIpo,2842
|
78
78
|
ai_edge_torch/generative/examples/moonshine/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
79
79
|
ai_edge_torch/generative/examples/moonshine/convert_moonshine_to_tflite.py,sha256=7m3rYRzThRDYb-7pGnpLr3ACi4PWX07Mg20Q98ArPc4,1714
|
80
80
|
ai_edge_torch/generative/examples/moonshine/moonshine.py,sha256=nZ2b8u4TmsB5sgdClgAuH8E78bcTv9RCnF9666HqP2M,3394
|
81
81
|
ai_edge_torch/generative/examples/openelm/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
82
|
-
ai_edge_torch/generative/examples/openelm/convert_to_tflite.py,sha256=
|
82
|
+
ai_edge_torch/generative/examples/openelm/convert_to_tflite.py,sha256=Hgp31zIQdJsTweRMr0U3d2SKW1h2nWnqWt1FlmuQqiI,1551
|
83
83
|
ai_edge_torch/generative/examples/openelm/openelm.py,sha256=sIJ8Ie1oxFrJM-1jvv2ukiJbQOTIUGuMEZvmwZbt3n0,4556
|
84
84
|
ai_edge_torch/generative/examples/openelm/verify.py,sha256=4W26ZtPF5Cb9mpHYuRM4b2QB_4W76zf4WV36KzexVjs,2446
|
85
85
|
ai_edge_torch/generative/examples/paligemma/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
86
|
-
ai_edge_torch/generative/examples/paligemma/convert_to_tflite.py,sha256=
|
87
|
-
ai_edge_torch/generative/examples/paligemma/decoder.py,sha256=
|
88
|
-
ai_edge_torch/generative/examples/paligemma/decoder2.py,sha256=
|
86
|
+
ai_edge_torch/generative/examples/paligemma/convert_to_tflite.py,sha256=2GLE4empjc8IANssR02ECFUqhdUNJV_OVHCf1UXKL8Y,1956
|
87
|
+
ai_edge_torch/generative/examples/paligemma/decoder.py,sha256=G1dwtWp_v77AI3uyIY-8g6qRP2tRH3CIKjJTeYNqFPU,5511
|
88
|
+
ai_edge_torch/generative/examples/paligemma/decoder2.py,sha256=Z-SKdb0dd8uWT1d-FRwFx5-tJEqpdrQwiIZnFRhOtVo,6060
|
89
89
|
ai_edge_torch/generative/examples/paligemma/image_encoder.py,sha256=SvuR97sjkBtfkerH7Hu1UXB8kCFLpEATNbPfCbNAyfo,5614
|
90
|
-
ai_edge_torch/generative/examples/paligemma/paligemma.py,sha256=
|
90
|
+
ai_edge_torch/generative/examples/paligemma/paligemma.py,sha256=CFIjOmrn4a4Udki7l3im0JR4zTC_NttnsIr9_qWjKTY,6110
|
91
91
|
ai_edge_torch/generative/examples/paligemma/verify.py,sha256=zrCNz_QSQU6BbaFtx-J-MqxXWcNlsAlquaHpKodsyW4,5350
|
92
92
|
ai_edge_torch/generative/examples/paligemma/verify_decoder.py,sha256=al5wMPWri4IRVWrLmCplPi6uoCzwh0vBHMGnCt-XUqo,2690
|
93
93
|
ai_edge_torch/generative/examples/paligemma/verify_decoder2.py,sha256=tm-UfLr0YeBRVcQsWLBOMWI9JUzHmtPEbYK2vpITpqY,2534
|
94
94
|
ai_edge_torch/generative/examples/paligemma/verify_image_encoder.py,sha256=vNm-wTT8BD6zbX6GocfP1QrVoHl0zSvuVxoXN36eeiU,3540
|
95
95
|
ai_edge_torch/generative/examples/phi/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
96
|
-
ai_edge_torch/generative/examples/phi/convert_phi3_to_tflite.py,sha256=
|
97
|
-
ai_edge_torch/generative/examples/phi/convert_phi4_to_tflite.py,sha256=
|
98
|
-
ai_edge_torch/generative/examples/phi/convert_to_tflite.py,sha256=
|
96
|
+
ai_edge_torch/generative/examples/phi/convert_phi3_to_tflite.py,sha256=Y2qaObMJeh9UABkUI7FBm4sCGi2YMQhsj0CSOS2fYek,1540
|
97
|
+
ai_edge_torch/generative/examples/phi/convert_phi4_to_tflite.py,sha256=TuGW_FPMs0pV7ZBe46FfaDrlfte4Dz75vGHmBOCFfww,1538
|
98
|
+
ai_edge_torch/generative/examples/phi/convert_to_tflite.py,sha256=VZe7OQ54dgOGWe74XT2W7zZBm5uJaeIF8ZuNakkL0iA,1539
|
99
99
|
ai_edge_torch/generative/examples/phi/phi2.py,sha256=c6PYCky7yJn6MVIYOCTx8S_CH27kOPmJbRZcI95nbZs,3477
|
100
100
|
ai_edge_torch/generative/examples/phi/phi3.py,sha256=ddo52Inl5ub81q460cEyKhnsC3txellRErut-_qtBbM,6949
|
101
101
|
ai_edge_torch/generative/examples/phi/phi4.py,sha256=OkMwLGe8l2JEAgOFi19AdbNBl1xp1djZBZo8MJP58ho,5732
|
@@ -103,20 +103,20 @@ ai_edge_torch/generative/examples/phi/verify.py,sha256=YPFCdbnfmvq38fbpBNr0kHPfS
|
|
103
103
|
ai_edge_torch/generative/examples/phi/verify_phi3.py,sha256=kVYaBVvddfQng0IyZGxyTJEzhiPO0G4VFJm2WOc2Q94,2360
|
104
104
|
ai_edge_torch/generative/examples/phi/verify_phi4.py,sha256=BoCa5kUBRHtMQ-5ql6yD4pG4xHJMyUiQlpMOWVx-JgY,2356
|
105
105
|
ai_edge_torch/generative/examples/qwen/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
106
|
-
ai_edge_torch/generative/examples/qwen/convert_to_tflite.py,sha256=
|
106
|
+
ai_edge_torch/generative/examples/qwen/convert_to_tflite.py,sha256=om3lXL1RnA87PkfU_cRfP6RnPgXrCmaB-cK98H-nqbA,1802
|
107
107
|
ai_edge_torch/generative/examples/qwen/qwen.py,sha256=Zi_qiQ1JPokXZ95jgSEnQp3F-LKzFCvWvFLKhJjnASo,4199
|
108
108
|
ai_edge_torch/generative/examples/qwen/verify.py,sha256=9_AyEJTeUfvhhID64Rto2bflFPyXMFokdQLsseLUMiI,2775
|
109
109
|
ai_edge_torch/generative/examples/qwen_vl/__init__.py,sha256=JaAnrFoXTl3RJX97XspklkTyqOHVyAgRJsZtzNDd10c,671
|
110
|
-
ai_edge_torch/generative/examples/qwen_vl/convert_to_tflite.py,sha256=
|
111
|
-
ai_edge_torch/generative/examples/qwen_vl/decoder.py,sha256=
|
110
|
+
ai_edge_torch/generative/examples/qwen_vl/convert_to_tflite.py,sha256=OcE2-8lqAukoK5hM1sqdgfXU37kxWQ84racweNAdjyk,1995
|
111
|
+
ai_edge_torch/generative/examples/qwen_vl/decoder.py,sha256=7RFM25tDj_b0FkpSv8RUWir8K8v9p2jMtwZmP4VAUhw,4474
|
112
112
|
ai_edge_torch/generative/examples/qwen_vl/image_encoder.py,sha256=nHzBe_YSPnUe1d5i09v4bePQomVifzJNeUjRfprmxC0,14878
|
113
|
-
ai_edge_torch/generative/examples/qwen_vl/qwen_vl.py,sha256=
|
113
|
+
ai_edge_torch/generative/examples/qwen_vl/qwen_vl.py,sha256=mfLFrT8NPEPh9CqlJYHwh-I2y6ST7hH_vEmbZYartHQ,7764
|
114
114
|
ai_edge_torch/generative/examples/qwen_vl/verify.py,sha256=JUwHoC_zvcC3RC3wZ3e3e6fGmrhbgdoztjK8HGSUG8I,5044
|
115
115
|
ai_edge_torch/generative/examples/qwen_vl/verify_decoder.py,sha256=xPWoOBLh2eK12KEhELLYymfL7xvc0chmYC98c6x37oo,2602
|
116
116
|
ai_edge_torch/generative/examples/qwen_vl/verify_image_encoder.py,sha256=PZ392nDoJG2OmHZ_7Jet3Zu1JkN6QErxKcDc7a-PPds,3126
|
117
117
|
ai_edge_torch/generative/examples/smollm/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
118
|
-
ai_edge_torch/generative/examples/smollm/convert_to_tflite.py,sha256=
|
119
|
-
ai_edge_torch/generative/examples/smollm/convert_v2_to_tflite.py,sha256=
|
118
|
+
ai_edge_torch/generative/examples/smollm/convert_to_tflite.py,sha256=IjV0jriRKlF9aV5yLjtONjACb4_VxNIAGk9w1sr_hmc,1748
|
119
|
+
ai_edge_torch/generative/examples/smollm/convert_v2_to_tflite.py,sha256=Wa_3OWXcM389iySwS5E47uCYZaTj6h-4RTP_Xi2-1aE,1721
|
120
120
|
ai_edge_torch/generative/examples/smollm/smollm.py,sha256=3uUltb6D3Q1aHpndcYTJrsWM_RBwLAraKDniH8ZZous,3779
|
121
121
|
ai_edge_torch/generative/examples/smollm/verify.py,sha256=KpYxVz_lv61YWy6HLfwT68n0owZMvty5Rr3W7ZNWWSw,2702
|
122
122
|
ai_edge_torch/generative/examples/stable_diffusion/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
@@ -141,9 +141,9 @@ ai_edge_torch/generative/examples/t5/t5_attention.py,sha256=l01oYyJo77INzRwN4xqX
|
|
141
141
|
ai_edge_torch/generative/examples/test_models/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
142
142
|
ai_edge_torch/generative/examples/test_models/convert_toy_model.py,sha256=6-WaNHckq_LlXMVTh8x90MGWeWq2bu_T_XQd3w9FnGg,3261
|
143
143
|
ai_edge_torch/generative/examples/test_models/toy_model.py,sha256=Crpj-vOwSViHpblXOrRJmsIn4DrHyuB3XZ8kHifb7LA,5203
|
144
|
-
ai_edge_torch/generative/examples/test_models/toy_model_with_kv_cache.py,sha256
|
144
|
+
ai_edge_torch/generative/examples/test_models/toy_model_with_kv_cache.py,sha256=-z5tkQzGHbo37eAl9sDAJuT1Egxm8xI9CZmYLcmqIfU,4761
|
145
145
|
ai_edge_torch/generative/examples/tiny_llama/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
146
|
-
ai_edge_torch/generative/examples/tiny_llama/convert_to_tflite.py,sha256=
|
146
|
+
ai_edge_torch/generative/examples/tiny_llama/convert_to_tflite.py,sha256=LPxg7mAJ_aAUIx6eE5bxixPA8Ep9Vul0CWJoNcrD5oE,1565
|
147
147
|
ai_edge_torch/generative/examples/tiny_llama/tiny_llama.py,sha256=mhJ18rb9sxrYRzv1YSzhbNs97oUZck99avZDcUO2oV8,2800
|
148
148
|
ai_edge_torch/generative/examples/tiny_llama/verify.py,sha256=LRu6PSw7Lqu6HGbv1tO2i0nUCqe-VkRgboA10VZ7KNg,2431
|
149
149
|
ai_edge_torch/generative/fx_passes/__init__.py,sha256=4rFrppMRKlTwwZeX1ON_cdp4yUqoTOES161IZQkJF6c,1143
|
@@ -176,7 +176,7 @@ ai_edge_torch/generative/quantize/quant_recipe_utils.py,sha256=4fgmP_GgeiFUOkIaC
|
|
176
176
|
ai_edge_torch/generative/quantize/quant_recipes.py,sha256=0Kvr_o7pbMnE8VMe6Ml0FBxkHM6RJ3C14B2I1mjItjc,2030
|
177
177
|
ai_edge_torch/generative/quantize/supported_schemes.py,sha256=FjdycEOvxRgBmQdZVufetPvkDoD7rUowIOSKV9oV5Kk,1418
|
178
178
|
ai_edge_torch/generative/test/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
179
|
-
ai_edge_torch/generative/test/test_custom_dus.py,sha256=
|
179
|
+
ai_edge_torch/generative/test/test_custom_dus.py,sha256=MjIhTvkTko872M35XMciobvICcDWTcIDJ3rociko-wM,3267
|
180
180
|
ai_edge_torch/generative/test/test_kv_cache.py,sha256=MBPS-0bDXB0tQSKHa1XwDQeVIfabRbc8JQA99h9fzlQ,5961
|
181
181
|
ai_edge_torch/generative/test/test_loader.py,sha256=9mQUeeZKOVApOWSWl2cN9c10axZjMKM1-0Zd823CCS4,3449
|
182
182
|
ai_edge_torch/generative/test/test_lora.py,sha256=6QIM6RLTc2HrodGpp_aS3OxM9Rco2KAzEnYgotkg41M,5310
|
@@ -185,14 +185,15 @@ ai_edge_torch/generative/test/test_model_conversion_large.py,sha256=-v2Vj7Qdd3Gy
|
|
185
185
|
ai_edge_torch/generative/test/test_quantize.py,sha256=bEJMhpQ9bIDUZVBXTW888728FcH-i3SyE4JSZZUgU0A,6071
|
186
186
|
ai_edge_torch/generative/test/utils.py,sha256=tF6aCfAGJnc9dmzCnZCEOuKNVimfWOqscv9og0DDLHU,2656
|
187
187
|
ai_edge_torch/generative/utilities/__init__.py,sha256=-_jxnnFnCgnTU4oTm4MnRsvL5lqhomBNdFBbqfmfHPo,720
|
188
|
-
ai_edge_torch/generative/utilities/converter.py,sha256=
|
188
|
+
ai_edge_torch/generative/utilities/converter.py,sha256=ycXDcd3ZE-EdjksDjHi4ru3JpfhtrfOompg_990qvWI,9607
|
189
|
+
ai_edge_torch/generative/utilities/export_config.py,sha256=-UuukWqUUj8RM8lTtMCa_PD6SqCZv97i4BMiJA2zBPg,1491
|
189
190
|
ai_edge_torch/generative/utilities/loader.py,sha256=7p__m2JryWphGlYOuRxdoT4id4_tWJEVOV7y2X4H-Ak,13737
|
190
|
-
ai_edge_torch/generative/utilities/model_builder.py,sha256=
|
191
|
+
ai_edge_torch/generative/utilities/model_builder.py,sha256=ZYX1TxpFdj573du2QCyHJlFjx4q1m12R74fp4Gwl92A,6343
|
191
192
|
ai_edge_torch/generative/utilities/moonshine_loader.py,sha256=_RpFabSqtGH5PHiP3_1f6QfO14qMADUxr_HGRlVDFB0,4891
|
192
193
|
ai_edge_torch/generative/utilities/stable_diffusion_loader.py,sha256=dqPD9qRXEWtU3ombslOC-BE2l_dMwHoCNu7NsIJhsso,36158
|
193
194
|
ai_edge_torch/generative/utilities/t5_loader.py,sha256=tEsfy8-ymzbbjOIc-oesXF3yGyyWtJgFXn2s7VOavt8,16961
|
194
195
|
ai_edge_torch/generative/utilities/transformers_verifier.py,sha256=8sp9m_FMcXn7nqOrochtu2jIANkJKhnhIBUmH0ZTDR4,1549
|
195
|
-
ai_edge_torch/generative/utilities/verifier.py,sha256=
|
196
|
+
ai_edge_torch/generative/utilities/verifier.py,sha256=gsBGv-WgeP73Bmao29CiTIQOC1YZ43IUJcGzytpcZyM,12095
|
196
197
|
ai_edge_torch/hlfb/__init__.py,sha256=sH4um75na-O8tzxN6chFyp6Y4xnexsE7kUQpZySv6dE,735
|
197
198
|
ai_edge_torch/hlfb/mark_pattern/__init__.py,sha256=JsVmYrM_JEuN_smMHXUsRlo3Liapp7UyktbPpPARwDk,5386
|
198
199
|
ai_edge_torch/hlfb/mark_pattern/fx_utils.py,sha256=YCtMgu-4w2BQ5fpnlpWC6IauKPf_tVqc7Ff91OTqlSw,1796
|
@@ -232,7 +233,7 @@ ai_edge_torch/odml_torch/lowerings/_quantized_decomposed.py,sha256=XDZ0zLej_XaQD
|
|
232
233
|
ai_edge_torch/odml_torch/lowerings/_rand.py,sha256=g6SuqDkuC6hD35lyP1-5H7ASDIzPSmKukeNT5naZSv8,4133
|
233
234
|
ai_edge_torch/odml_torch/lowerings/context.py,sha256=jslcCv7r_HtImSRTxJwHAUV_QCu9Jub51lovmoBkmFA,1295
|
234
235
|
ai_edge_torch/odml_torch/lowerings/registry.py,sha256=Tp2h11l5uTifO0aIkuUOWAF_ibEjmd65Xx99w3EXuGE,1924
|
235
|
-
ai_edge_torch/odml_torch/lowerings/utils.py,sha256
|
236
|
+
ai_edge_torch/odml_torch/lowerings/utils.py,sha256=-TzK1igPgR38oZkU1iPh-DZhlKVwuBtGWVC-y81PXzY,8935
|
236
237
|
ai_edge_torch/odml_torch/passes/__init__.py,sha256=AVwIwUTMx7rXacKjGy4kwrtMd3XB2v_ncdc40KOjUqQ,1245
|
237
238
|
ai_edge_torch/quantize/__init__.py,sha256=aB5dXot04bqyUhpsDFvxt9CIi15QAC4euvqOndJ0XLU,714
|
238
239
|
ai_edge_torch/quantize/pt2e_quantizer.py,sha256=CKIEhs9jCcna64qj1jFH9zEbMbRdyeGV_TmSqEBPjes,15741
|
@@ -242,8 +243,8 @@ ai_edge_torch/testing/__init__.py,sha256=_yGgvnBZWb7T3IN3mc4x1sS4vM96HZwM8pwIcPG
|
|
242
243
|
ai_edge_torch/testing/export.py,sha256=dguMa-aEi-WDPnmGBUs2IPdEmt2IVmHOELH19uiJ1uU,3014
|
243
244
|
ai_edge_torch/testing/model_coverage/__init__.py,sha256=5P8J6Zk5YYtDvTBucFvB9NGSRI7Gw_24WnrbhXgycEE,765
|
244
245
|
ai_edge_torch/testing/model_coverage/model_coverage.py,sha256=UPB448aMDUyC0HNYVqio2rcJPnDN0tBQMP08J6vPYew,4718
|
245
|
-
ai_edge_torch_nightly-0.4.0.
|
246
|
-
ai_edge_torch_nightly-0.4.0.
|
247
|
-
ai_edge_torch_nightly-0.4.0.
|
248
|
-
ai_edge_torch_nightly-0.4.0.
|
249
|
-
ai_edge_torch_nightly-0.4.0.
|
246
|
+
ai_edge_torch_nightly-0.4.0.dev20250405.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
247
|
+
ai_edge_torch_nightly-0.4.0.dev20250405.dist-info/METADATA,sha256=er5v3ZpkS5bJW9tI2dxbtPqaRVnaV99gv8vlMuV_AfI,1966
|
248
|
+
ai_edge_torch_nightly-0.4.0.dev20250405.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
249
|
+
ai_edge_torch_nightly-0.4.0.dev20250405.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
|
250
|
+
ai_edge_torch_nightly-0.4.0.dev20250405.dist-info/RECORD,,
|
File without changes
|
File without changes
|