Skip to content

Add new SavedModelToIreeABIPass. - #5367

Merged
stellaraccident merged 1 commit into
iree-org:mainfrom
stellaraccident:smireeabi
Apr 23, 2021
Merged

stellaraccident merged 1 commit into
iree-org:mainfrom
stellaraccident:smireeabi

Conversation

@stellaraccident

Copy link
Copy Markdown
Collaborator

No description provided.

@google-cla google-cla Bot added the cla: yes label Apr 9, 2021
@stellaraccident
stellaraccident force-pushed the smireeabi branch 5 times, most recently from a53073d to 88901fc Compare April 16, 2021 23:30
@stellaraccident stellaraccident changed the title DRAFT: Add new SavedModelToIreeABIPass. Add new SavedModelToIreeABIPass. Apr 16, 2021

@benvanik benvanik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first pass of function_abi.md

Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Resolved
If, however, a `buffer-type` is not fully specified, the compiler may emit a special _result allocator_ function, which will be referenced in the `fbr` attribute. Such a function would have a signature like this:

```c++
tuple<buffer> __allocate_results(tuple<int> dynamic_dims);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tflite bindings do this now - the style used there is (output_index, list<dims>) which makes calling it much easier - the bindings can just pass through the information without having to do any argument munging/reflection/etc, and it's stable to the dimensions changing between static and dynamic (an assertion can check that static dimensions were provided the correct values while dynamic dimensions are within expectations).

See:
https://github.com/google/iree/blob/f02a32f88242479c37a249d1c6bbe7637545ca36/iree/compiler/Bindings/TFLite/Transforms/test/materialize_shape_support.mlir#L84-L112
https://github.com/google/iree/blob/f02a32f88242479c37a249d1c6bbe7637545ca36/bindings/tflite/interpreter.c#L197-L202

having it be per output avoids the need for any kind of packing/striding/etc (you can check rank assertions per output, whether an output is out of bounds, etc).

Comment thread docs/design_docs/function_abi.md Resolved
Comment thread docs/design_docs/function_abi.md Outdated
Such an enhancement would almost certainly necessitate a major version bump in
the ABI and would be logical to implement once the advanced features above are
functional.
Such an enhancement would almost certainly necessitate a major version bump in the ABI and would be logical to implement once the advanced features above are functional.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of the reasons to do it with buffer_view attrs - no need to change the ABI version/recompile apps/models/etc.

@benvanik
benvanik self-requested a review April 21, 2021 15:02
Comment thread docs/design_docs/function_abi.md Resolved
@google-cla

google-cla Bot commented Apr 22, 2021

Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla Bot added cla: no and removed cla: yes labels Apr 22, 2021
@google-cla

google-cla Bot commented Apr 23, 2021

Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla

google-cla Bot commented Apr 23, 2021

Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

* Pass is not yet active in the pipeline.
* Need to implement runtime support for it and will decide on an upgrade strategy then.
* Could stand to add some more test cases, but they are hard to generate, and I will mine some examples once I get it more e2e.
@stellaraccident
stellaraccident merged commit 4d6e2bd into iree-org:main Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants