Skip to content
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

[onert] Introduce BiasInsertionPass #13842

Closed

Conversation

ragmani
Copy link
Contributor

@ragmani ragmani commented Aug 29, 2024

This commit introduces BiasInsertionPass to insert bias for training in case bias is optional input.

ONE-DCO-1.0-Signed-off-by: ragmani [email protected]

This commit introduces BiasInsertionPass to insert bias for training in case bias is optional input.

ONE-DCO-1.0-Signed-off-by: ragmani <[email protected]>
@ragmani ragmani added the PR/ready for review It is ready to review. Please review it. label Aug 29, 2024
@ragmani ragmani requested a review from a team August 29, 2024 08:35
@ragmani
Copy link
Contributor Author

ragmani commented Aug 29, 2024

Copy link
Contributor

@jyoungyun jyoungyun left a comment

Choose a reason for hiding this comment

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

LGTM

@zetwhite zetwhite requested a review from a team August 29, 2024 11:02
void run() final;

public:
void visit(const ir::operation::FullyConnected &node) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have to insert bias into each node?
I'd like to review this PR, But I feel hard to understand the background 🥲

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes TFLite converter may generate a inference model that does not have bias input(i.e. optional input) when the bias data has all zero values. It's reasonable in inference because there is no reason to add zero values. But, in training, bias is necessary because bias needs to be trained and updated.
As a result, we need to insert bias input if a model to be trained does have bias input.

Copy link
Contributor Author

@ragmani ragmani Aug 30, 2024

Choose a reason for hiding this comment

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

@zetwhite
Thanks for your advise offline. I made a note about that at #13808 (comment).

@zetwhite zetwhite requested a review from a team August 29, 2024 13:03
@ragmani ragmani added PR/NO MERGE Please don't merge. I'm still working on this :) and removed PR/ready for review It is ready to review. Please review it. labels Aug 30, 2024
@hseok-oh hseok-oh marked this pull request as draft August 30, 2024 07:56
@ragmani
Copy link
Contributor Author

ragmani commented Sep 4, 2024

We concluded that we assumed onert only supports training for pre-trained models. So this PR is not necessary anymore.

@ragmani ragmani closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR/NO MERGE Please don't merge. I'm still working on this :)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants