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 MKLDNNAddtoLayer #5309

Merged
merged 5 commits into from
Nov 6, 2017
Merged

Conversation

tensor-tang
Copy link
Contributor

add mkldnn_addto layer without bias

@tensor-tang tensor-tang requested a review from luotao1 November 2, 2017 14:12
@tensor-tang
Copy link
Contributor Author

tensor-tang commented Nov 3, 2017

After merged latest code, still failed of lod_tensor_test

[02:19:18] : [Step 1/1] The following tests FAILED:
[02:19:18] : [Step 1/1] 98 - lod_tensor_test (Failed)
[02:19:18]W: [Step 1/1] Errors while running CTest
[02:19:18]W: [Step 1/1] Process exited with code 8

lod_tensor_test .............................***Failed 1.15 sec
[02:14:02] : [Step 1/1] Running main() from gtest_main.cc
[02:14:02] : [Step 1/1] [==========] Running 6 tests from 2 test cases.
[02:14:02] : [Step 1/1] [----------] Global test environment set-up.
[02:14:02] : [Step 1/1] [----------] 5 tests from LoDTensorTester
[02:14:02] : [Step 1/1] [ RUN ] LoDTensorTester.NumLevels
[02:14:02] : [Step 1/1] unknown file: Failure
[02:14:02] : [Step 1/1] C++ exception with description "std::bad_alloc" thrown in SetUp().

@tensor-tang
Copy link
Contributor Author

After rerun, it pass.

TestConfig dnnConfig;
getAddtoConfig(dnnConfig, pm, nInputs);
dnnConfig.layerConfig.set_type("mkldnn_addto");
// TODO(TJ): test with bias
Copy link
Contributor

Choose a reason for hiding this comment

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

下一个PR是完成有bias的addtoLayer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯,不是下一个就是再下一个了。可能先把Resnet调通下,因为Resnet里面可能还用不到bias的addto。

出于功能,也会实现带有bias的,我已经加到我们list的TODO里面了。

if (withBias) {
dnnConfig.biasSize = pm.ic * pm.ih * pm.iw;
} else {
dnnConfig.biasSize = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

dnnConfig.biasSize = withBias? pm.ic * pm.ih * pm.iw : 0;
下次改Bias的时候一起改了吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哦好的,thx

@@ -132,7 +132,7 @@ void MKLDNNTester::checkForward() {
VLOG(MKLDNN_TESTS) << "Check Forward";
printTopDatas();
double delta =
compareMatrix(dnnLayer_->getOutputValue(), refLayer_->getOutputValue());
compareMatrix(refLayer_->getOutputValue(), dnnLayer_->getOutputValue());
Copy link
Contributor

Choose a reason for hiding this comment

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

这里为什么要互换下位置呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哦,理论上是可以不要调换的,但是还是想把顺序统一下,并且我默认第一个参数是参考。

@luotao1 luotao1 merged commit f8a6bda into PaddlePaddle:develop Nov 6, 2017
@tensor-tang tensor-tang deleted the mkldnn_addto branch November 6, 2017 02:23
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