Skip to content

Adds -iree-tf-strip-*-metadata passes that remove tf attributes. - #3969

Merged
ScottTodd merged 2 commits into
mainfrom
benvanik-3810
Dec 2, 2020
Merged

ScottTodd merged 2 commits into
mainfrom
benvanik-3810

Conversation

@benvanik

Copy link
Copy Markdown
Collaborator

me

While here I noticed that this directory is a mismatch of styles from
MLIR and TF, wasn't properly namespaced (both on pass names or C++) in
many places, and didn't follow the rest of the conventions used in
iree/compiler/. To make this code easier to maintain and before we start
to copypasta it for other integrations I did a first-pass cleanup.
I also noticed we still had a bunch of super flakey alwayslink stuff so
I fixed that too. No more alwayslink required!

Fixes #3965.

@benvanik benvanik added integrations/tensorflow TensorFlow model import and conversion quality of life 😊 Nice things are nice; let's have some labels Nov 23, 2020
@benvanik benvanik added this to the 2020Q4 Core milestone Nov 23, 2020
@benvanik
benvanik requested a review from rsuderman November 23, 2020 04:46
@google-cla google-cla Bot added the cla: yes label Nov 23, 2020
While here I noticed that this directory is a mismatch of styles from
MLIR and TF, wasn't properly namespaced (both on pass names or C++) in
many places, and didn't follow the rest of the conventions used in
iree/compiler/. To make this code easier to maintain and before we start
to copypasta it for other integrations I did a first-pass cleanup.
I also noticed we still had a bunch of super flakey alwayslink stuff so
I fixed that too. No more alwayslink required!

Fixes #3965.
@benvanik
benvanik marked this pull request as ready for review November 23, 2020 05:25
@benvanik
benvanik requested a review from ScottTodd December 1, 2020 18:12

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delayed reviews. This generally LGTM.


// All IREE-specific passes that lower TF representations before reaching the
// IREE core should go here.
void createIreeTfImportPipeline(OpPassManager &pm) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stellaraccident this (and possibly other files) will conflict with #4043

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.

FIFO - go ahead and land and I'll rebase and likely submit on the OSS side (thought there were going to be more internal entanglements than I thought so started there). I can wait ~a day.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SGTM. I just resolved the merge conflicts with @rsuderman 's #3941. Planning on merging once checks come back green.

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.

Thanks - I was going to offer to help land it, but it seems like you've already done the work :)

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.

Sorry for the delayed reviews. This generally LGTM.

Looks fine with me assuming it does not conflict too much with Stella's changes. I initially hesitated at removing the metadata until I realized its long after I need it for shape inference.

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.

It conflicts but I'll rebase (and had already locally fixed up some of the style issues so hopefully not too bad) and send a fresh PR on the main branch when ready.

@ScottTodd
ScottTodd merged commit 6a7c121 into main Dec 2, 2020
@ScottTodd
ScottTodd deleted the benvanik-3810 branch December 2, 2020 18:58
This was referenced Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations/tensorflow TensorFlow model import and conversion quality of life 😊 Nice things are nice; let's have some

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strip all the tensorflow junk attributes from the IR prior to bringing into IREE

4 participants