-
Notifications
You must be signed in to change notification settings - Fork 311
Model Export to liteRT #2405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pctablet505
wants to merge
113
commits into
keras-team:master
Choose a base branch
from
pctablet505:export
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Model Export to liteRT #2405
Changes from all commits
Commits
Show all changes
113 commits
Select commit
Hold shift + click to select a range
af584b4
Update gemma3_causal_lm_preprocessor.py
pctablet505 dc4ae8c
Update gemma3_causal_lm_preprocessor.py
pctablet505 07c5c77
Update gemma3_causal_lm_preprocessor_test.py
pctablet505 3fdc7fd
Update reversible_embedding.py
pctablet505 fa57e33
Merge branch 'master' of https://github.com/pctablet505/keras-hub
pctablet505 8da3303
upadated Gemma3InterleaveEmbeddings
pctablet505 adac2c6
Update gemma3_interleave_embeddings.py
pctablet505 bd27ec0
Revert "Update reversible_embedding.py"
pctablet505 f5163e8
Merge branch 'keras-team:master' into master
pctablet505 1904136
Update gemma3_interleave_embeddings.py
pctablet505 552fecb
Merge branch 'keras-team:master' into master
pctablet505 087b9b2
Update backbone.py
pctablet505 de830b1
Update backbone.py
pctablet505 62d2484
Update task.py
pctablet505 3b71125
Revert "Update task.py"
pctablet505 3d453ff
Revert "Update backbone.py"
pctablet505 92b1254
export
pctablet505 e46241d
refactoring
pctablet505 6e970e2
refactor
pctablet505 15ad9f3
Update registry.py
pctablet505 02ca0d9
Refactor export logic and improve error handling
pctablet505 901c233
Merge branch 'keras-team:master' into export
pctablet505 442fdd3
reformat
pctablet505 5446e2a
Add export submodule to keras_hub API
pctablet505 5c31d88
reformat
pctablet505 3290d42
now supporting export for objectDetectors
pctablet505 8b1024f
Add and refine image model exporter configs
pctablet505 8df5a75
Refactor: move keras import to module level
pctablet505 759d223
Remove debug_object_detection.py script
pctablet505 0737c93
Rename LiteRT to Litert and update exporter configs
pctablet505 c733e18
Refactor InputSpec formatting and fix import path
pctablet505 5ab911f
Refactor exporter configs and model building logic
pctablet505 c1e26dd
Refactor export initialization and improve warnings
pctablet505 6fa8379
Improve dtype handling and verbose output in exporters
pctablet505 81c6ed5
Remove get_dummy_inputs methods from exporter configs
pctablet505 d6a8dfd
Rename LitertExporter to LiteRTExporter
pctablet505 663c190
Update registry.py
pctablet505 e0d02ee
Refactor exporter registry to use model classes
pctablet505 6c98400
Remove conditional import for keras
pctablet505 b9e3789
Add comprehensive export test suites for Keras Hub
pctablet505 9f63b2a
Refactor LiteRT exporter model adapters
pctablet505 b4ce293
Merge branch 'keras-team:master' into export
pctablet505 4ebc701
Clarify type annotations in docstrings for export modules
pctablet505 298967e
testing refactor
pctablet505 bc0a8b7
refactor test
pctablet505 ab99186
Fix LiteRT export filepath and mask argument usage
pctablet505 1c06c46
Refactor LiteRTExporter model adapter calls
pctablet505 22587f1
Add warning for private TensorFlow API usage
pctablet505 765d55c
Merge branch 'export' of https://github.com/pctablet505/keras-hub int…
pctablet505 70f712a
Refactor exporter configs and remove TextModelExporterConfig
pctablet505 e47545d
Refactor trackable children filtering logic
pctablet505 0a266b4
Refactor ExporterRegistry model config lookup
pctablet505 21f6b2c
Update litert.py
pctablet505 efa25ae
Refactor tests to remove try/except and improve clarity
pctablet505 ec37ac4
Fix docstring in TextClassifierExporterConfig
pctablet505 911eb96
Update base.py
pctablet505 51b99b1
Create litert_export_design.md
pctablet505 7ef9348
Refactor LiteRT export tests for consistency and efficiency
pctablet505 2295181
Refactor LiteRT export tests to support per-output thresholds
pctablet505 4adeadf
Update litert_models_test.py
pctablet505 00f49ca
Delete litert_export_design.md
pctablet505 5fa0498
Update litert_models_test.py
pctablet505 052669d
Refactor LiteRT export tests to use pytest parametrization
pctablet505 a273e42
Refactor export registry and add direct export to Task
pctablet505 519c3b6
Update litert.py
pctablet505 2dcbf23
Merge branch 'keras-team:master' into export
pctablet505 0136c34
Update task.py
pctablet505 f8bd6fa
Merge branch 'export' of https://github.com/pctablet505/keras-hub int…
pctablet505 14cffe0
Update test_case.py
pctablet505 9267b51
Enable dynamic input shapes for LiteRT export
pctablet505 c622d8d
Improve SignatureDef handling in LiteRT export tests
pctablet505 ca6056b
Refactor LiteRT test utilities for clarity and robustness
pctablet505 d43de36
Refactor TFLite inference to use signature runner
pctablet505 6042562
Add exporter configs for Multimodal models
pctablet505 c7c73f4
Add LiteRT export tests for model test suites
pctablet505 fb3eb45
Refactor and expand exporter configs, update tests
pctablet505 e54f561
Add DepthEstimator export support and improve tests
pctablet505 baf38aa
Delete run_litert_tests.py
pctablet505 9ccee16
Update test_case.py
pctablet505 374f3ab
Add @pytest.mark.large to LiteRT export tests
pctablet505 a46beba
Update model test cases for statistical comparison
pctablet505 92b7ae0
Refactor input handling for export and tests
pctablet505 425078b
Refactor LiteRT export to use Keras Core directly
pctablet505 947efa4
Add @pytest.mark.large to LiteRT export tests
pctablet505 d331a79
Update d_fine_object_detector_test.py
pctablet505 a6695aa
Update retinanet_object_detector_test.py
pctablet505 20cfa4f
Add @pytest.mark.large to saved model tests
pctablet505 4c9a4bb
Remove TensorFlow export compatibility shims
pctablet505 3aa11e9
Merge branch 'master' of https://github.com/pctablet505/keras-hub
pctablet505 01c75cd
Update test configs and refactor export verbose handling
pctablet505 63d529a
Merge branch 'keras-team:master' into master
pctablet505 e79bbe4
Merge upstream/master into export: Sync with latest keras-hub changes
pctablet505 fcada92
Merge branch 'keras-team:master' into master
pctablet505 c71929d
Fix ESM attention for TFLite compatibility
pctablet505 d0f58e1
Fix PARSeq decoder for TFLite compatibility
pctablet505 e3d5511
Add LiteRT export tests to model test suites
pctablet505 a88aa03
Remove export module and clean up API imports
pctablet505 e7012bf
Refactor content construction for backend consistency
pctablet505 433b14e
Skip LiteRT export tests for non-TensorFlow backends
pctablet505 246780b
Skip LiteRT export tests for non-TensorFlow backends
pctablet505 0cdda6a
Add TensorFlow-only LiteRT export test skip to model tests
pctablet505 1a82728
Remove TensorFlow-only LiteRT export test skips
pctablet505 694a52f
Update retinanet_object_detector_test.py
pctablet505 f8d90e7
Update retinanet_object_detector_test.py
pctablet505 a228204
Move ai-edge-litert to requirements-common.txt
pctablet505 3a8e930
Update qwen3_moe_causal_lm_test.py
pctablet505 f5b0777
Replace tf.cast with ops.cast for padding_mask
pctablet505 ccc20c5
Merge remote-tracking branch 'origin/master' into export
pctablet505 edd0610
Merge upstream/master into export
pctablet505 29808dd
Remove trailing blank line from requirements files
pctablet505 0250dbc
Refactor type casting to use ops.cast and rename test method
pctablet505 89e708f
Update test_case.py
pctablet505 5b31fe3
Update retinanet_object_detector_test.py
pctablet505 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,3 +152,30 @@ def test_saved_model(self): | |
| init_kwargs=init_kwargs, | ||
| input_data=self.images, | ||
| ) | ||
|
|
||
| @pytest.mark.large | ||
| def test_litert_export(self): | ||
pctablet505 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| backbone = DFineBackbone(**self.base_backbone_kwargs) | ||
| init_kwargs = { | ||
| "backbone": backbone, | ||
| "num_classes": 4, | ||
| "bounding_box_format": self.bounding_box_format, | ||
| "preprocessor": self.preprocessor, | ||
| } | ||
|
|
||
| # D-Fine ObjectDetector only takes images as input | ||
| input_data = self.images | ||
|
|
||
| self.run_litert_export_test( | ||
| cls=DFineObjectDetector, | ||
| init_kwargs=init_kwargs, | ||
| input_data=input_data, | ||
| comparison_mode="statistical", | ||
| output_thresholds={ | ||
| "intermediate_predicted_corners": {"max": 5.0, "mean": 0.05}, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these seem like high numerical differences. and asserting that a mean avg difference of 0.05 exists across all output might hold if most output values are low (true for a lot of models), so i wonder if these checks would hold even for different inputs |
||
| "intermediate_logits": {"max": 5.0, "mean": 0.1}, | ||
| "enc_topk_logits": {"max": 5.0, "mean": 0.03}, | ||
| "logits": {"max": 2.0, "mean": 0.03}, | ||
| "*": {"max": 1.0, "mean": 0.03}, | ||
| }, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.