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

rewrite the TF lite binary conv. op #88

Merged
merged 9 commits into from
Nov 7, 2019
Merged

rewrite the TF lite binary conv. op #88

merged 9 commits into from
Nov 7, 2019

Conversation

arashb
Copy link
Contributor

@arashb arashb commented Nov 6, 2019

closes #73

In this PR, I separate the impl. path of bconv op in TF and TF lite. Now the TF lite bconv op uses the default memory layout of TF lite for filters and also(dilated)im2col functions and TF lite internal types (MatrixParams, ...). This simplifies the integrating the Op to RUY framework and might give us also some performance improvements.

@Tombana
Copy link
Collaborator

Tombana commented Nov 7, 2019

What was the speed difference that you got? 😄

@pytest.mark.parametrize("kernel_size", [3, 5])
@pytest.mark.parametrize("strides", [[1, 1], [2, 2]])
@pytest.mark.parametrize("padding", ["VALID", "SAME"])
def test_bconv2d_op_inference(
Copy link
Collaborator

@Tombana Tombana Nov 7, 2019

Choose a reason for hiding this comment

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

Nice new testing setup!
Once our zero-padding-correction-functor supports dilations, we should also add that here.

Comment on lines 305 to 307
PaddingFunctor padding_functor;
padding_functor(params->batch, params->input_height, params->input_width,
params->channels_in, filter->data.f,
Copy link
Collaborator

@Tombana Tombana Nov 7, 2019

Choose a reason for hiding this comment

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

I think the padding functor requires special care when there are dilations. Now that we partially support dilations (since we use TFlite's im2col) we should add a TODO here or in the padding functor itself, and open a GitHub issue.

Copy link
Collaborator

@Tombana Tombana left a comment

Choose a reason for hiding this comment

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

Looks great!

@Tombana Tombana merged commit 478d1ce into master Nov 7, 2019
@Tombana Tombana deleted the tflite_setup branch November 7, 2019 17:19
lgeiger pushed a commit that referenced this pull request Nov 13, 2020
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.

Use TFlite conv2d setup
3 participants