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

[Converter] Support GRU operator conversion with separated_rnn_gate_calc=False #323

Merged
merged 7 commits into from
Jun 3, 2024

Conversation

Juelianqvq
Copy link
Contributor

@Juelianqvq Juelianqvq commented Jun 1, 2024

Some duplicate codes can be removed. But the most serious thing is to find out why all pytests failed with hints below:

AssertionError: The values for attribute 'shape' do not match: torch.Size([9, 1, 20]) != torch.Size([9, 0, 20]).

i.e. You can run python converter_op_test.py -k test_gru_no_bias

Generated TFLite looks fine and Help wanted!

@Juelianqvq
Copy link
Contributor Author

Solved.

@Juelianqvq
Copy link
Contributor Author

Further optimization such as removing duplicate code & first time stamp Wh is on the way.

@Juelianqvq Juelianqvq changed the title [Help Wanted] Last mile for supporting GRU operator with separated_rnn_gate_calc=False [Converter] Support GRU operator conversion with separated_rnn_gate_calc=False Jun 3, 2024
@Juelianqvq
Copy link
Contributor Author

@peterjc123 cc

Copy link
Collaborator

@peterjc123 peterjc123 left a comment

Choose a reason for hiding this comment

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

Looks good, just some minor points

tests/converter_op_test.py Outdated Show resolved Hide resolved
tests/converter_op_test.py Outdated Show resolved Hide resolved
@peterjc123 peterjc123 merged commit 7de51e6 into alibaba:main Jun 3, 2024
8 of 9 checks passed
ops.append(tfl.FullyConnectedOperator([t, w_i, b_i], [input_mm]))
input_mm_list.append(input_mm)
ops.append(tfl.FullyConnectedOperator([h, w_h, b_h], [hidden_mm]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be optimized if h is a constant. Let's do this in a follow-up PR.

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