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

enable merge grad unit test #4860

Merged
merged 5 commits into from
Oct 17, 2017
Merged

Conversation

tensor-tang
Copy link
Contributor

@tensor-tang tensor-tang commented Oct 17, 2017

  • add finish job at neutral network to convert mkldnn weight to the paddle format.
  • fix bug.
    if output has cpu layer, mkldnn layer should clear the grad.
  • add branch unit test of conv
    mkldnn_branches_xxx_32c.conf is for test cases that can surly use internal format.

std::vector<std::string> cases = {"conv_conv_concat",
"conv_conv_concat_32c",
"conv_conv_addto",
"conv_conv_addto_32c"};
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. XXX_32c的conf,和普通的conf有什么区别呢?从配置上怎么看出区别?
  2. PR的描述中写着:mkldnn_branches_xxx_32c.conf is for test cases that can surly use internal format. 但代码中没有这样的注释。用户不知道32c是做什么的?
  3. 新增的配置太多,这四个配置可以简化成两个:即outputs(concat, addto)。
  4. conv_conv_concat这个取名不是很好,请换一个。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

32c主要是为了测channel为32的时候,这样一般情况下可以测到mkldnn的内部格式。
这几个文件可以考虑合并下。

Copy link
Contributor

Choose a reason for hiding this comment

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

这四个配置可以合并成一个:

  1. concat和addto, 利用outputs(concat, addto)合并成一个配置。
  2. 有无32c,利用get_config_args参数可以合并成一个配置。

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,done


settings(batch_size=16)

data = data_layer(name ="input", size=32*16*16)
Copy link
Contributor

Choose a reason for hiding this comment

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

配置中可以加注释说明下,和普通的conf区别在哪里。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的。

@@ -411,4 +413,143 @@ void MKLDNNTester::run(const TestConfig& dnn,
}
}

void MKLDNNTester::initArgument(DataIn& data,
Copy link
Contributor

Choose a reason for hiding this comment

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

initArgument,getOutResult和compareGradient,与test_NetworkCompare中的initArgument,calcGradient和compareGradient非常像,可以考虑复用下。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是比较像,不过还是有很多不同点的:

  1. 参数DataOutDataIn的定义不一样。
  2. 这里考虑了iteration,默认跑 3个iteration,每个的输入数据是不一样的随机数。test_NetworkCompare的20次,用的同样的随机数。
  3. 这里,最后比较的是forward的output value和backward且更新了,param的value。
  4. 关于compareResult,最好还是用现在的方法,因为我考虑了,当data值都特别小的时候等等。

不过是可以考虑以后弄在一起。

Copy link
Contributor

Choose a reason for hiding this comment

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

赞第二点中不同的随机数和第四点中data值特别小的情况。可以以后考虑优化test_NetworkCompare.cpp后,合并到一块。

@luotao1 luotao1 merged commit 3ae9aa9 into PaddlePaddle:develop Oct 17, 2017
@tensor-tang tensor-tang moved this from Doing to Done in Optimization on Intel Platform Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants