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

Add padding to FC op #19996

Closed
wants to merge 4 commits into from
Closed

Add padding to FC op #19996

wants to merge 4 commits into from

Conversation

GaoWei8
Copy link
Contributor

@GaoWei8 GaoWei8 commented Sep 25, 2019

Add padding in paddle and the size of padding is same with BERT.

@CLAassistant
Copy link

CLAassistant commented Sep 25, 2019

CLA assistant check
All committers have signed the CLA.

for (int i = 0; i < M; i++) {
memcpy(X1_data + i * (K + 4), X + i * K, K * sizeof(X[0]));
}
if (N % 128 == 0 && K % 128 == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

30-41行可以挪到42行的if条件里。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

将memory copy放到if条件里,性能没有变化。
原因是ERNIE中GEMM尺寸都能被128整除。

@GaoWei8 GaoWei8 force-pushed the padding branch 3 times, most recently from 0101c59 to bf96829 Compare November 1, 2019 06:35
@GaoWei8 GaoWei8 closed this Nov 1, 2019
@GaoWei8 GaoWei8 deleted the padding branch November 1, 2019 06:36
@GaoWei8 GaoWei8 restored the padding branch November 1, 2019 06:36
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.

None yet

4 participants