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

Reduce Gather op when ONNX-exported #20

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

takagi
Copy link
Collaborator

@takagi takagi commented Nov 8, 2023

The current _getc6_impl implementation gives some Gather ops when exported as ONNX, which has memory copy and causes performance inefficiency. This PR changes the implementation to make it export an ONNX graph with fewer Gather ops.

This change brings ~20% performance gain on my ONNX inference measurement. As a side effect, it also has ~10% performance gain on out-of-the-box PyTorch execution.

Thanks @asi1024!

@takagi takagi changed the title Remove Gather op when exported Reduc Gather op when ONNX-exported Nov 8, 2023
@takagi takagi changed the title Reduc Gather op when ONNX-exported Reduce Gather op when ONNX-exported Nov 8, 2023
@takagi takagi mentioned this pull request Nov 14, 2023
@corochann corochann self-requested a review November 14, 2023 05:37
Copy link
Member

@corochann corochann left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@corochann corochann merged commit c690dd6 into pfnet-research:master Nov 14, 2023
1 check passed
@takagi takagi deleted the remove-onnx-gather branch November 14, 2023 08:18
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