-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
赛题八:paddleviz能力扩展——Tensor信息展示 #56837
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
ca6a064
to
fd0c655
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
third_party/flashattn的修改不要提交
std::stringstream ss; | ||
ss << this; | ||
std::string this_pointer = ss.str(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码是没有使用的吧。删掉吧
VLOG(3) << "Finish AD API Grad: GradNodeAccumulation"; | ||
if (VLOG_IS_ON(4)) { | ||
VLOG(6) << "gradnode_ptr = " << this; | ||
if (VLOG_IS_ON(6)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
const char* TENSOR_X_GRAD_TEMPLATE = "(grad_out, [%s]), "; | ||
std::string output_x_grad_str = paddle::string::Sprintf( | ||
TENSOR_X_GRAD_TEMPLATE, egr::EagerUtils::TensorStr(grad_out)); | ||
output_str += output_x_grad_str; | ||
VLOG(4) << paddle::string::Sprintf( | ||
VLOG(6) << paddle::string::Sprintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
@@ -72,6 +72,30 @@ AddNGradNodeFinal::operator()( | |||
egr::CheckTensorHasNanOrInf("add_n_grad", returns); | |||
} | |||
|
|||
VLOG(6) << "gradnode_ptr = " << this; | |||
if (VLOG_IS_ON(6)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
@@ -162,6 +163,41 @@ Conv2dGradNodeFinal::operator()( | |||
// Set TensorWrappers for Forward Outputs if needed | |||
} | |||
|
|||
VLOG(6) << "gradnode_ptr = " << this; | |||
if (VLOG_IS_ON(6)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
@@ -457,7 +458,7 @@ SyncBatchNormGradNode::operator()( | |||
std::string output_bias_grad_str = paddle::string::Sprintf( | |||
TENSOR_BIAS_GRAD_TEMPLATE, egr::EagerUtils::TensorStr(bias_grad)); | |||
output_str += output_bias_grad_str; | |||
VLOG(4) << paddle::string::Sprintf( | |||
VLOG(6) << paddle::string::Sprintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
//std::cout << "The pointer to the current object: " << this << std::endl; | ||
//std::stringstream ss; | ||
//ss << this; | ||
//std::string this_pointer = ss.str(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码删掉吧
@@ -259,10 +266,10 @@ class {} : public egr::GradNodeBase {{ | |||
""" | |||
|
|||
AFTER_LOG_PRINT_TEMPLATE = """ | |||
if(VLOG_IS_ON(4)){{ | |||
if(VLOG_IS_ON(6)){{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
const char* INPUT_PRINT_TEMPLATE = \"{{ Input: [%s], \\n Output: [%s] }} \"; | ||
{} | ||
VLOG(4) << paddle::string::Sprintf(INPUT_PRINT_TEMPLATE, input_str, output_str); | ||
VLOG(6) << paddle::string::Sprintf(INPUT_PRINT_TEMPLATE, input_str, output_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个VLog的级别是不能改的。必须是4
paddle/fluid/eager/grad_node_info.cc
Outdated
//打印一下 next_node 对象的指针值 | ||
std::cout << "next_node: " << next_node << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个日志是要保留的吗?如果要保留的话需要是英文注释,而且不能用std::cout,要用Vlog。如果不需要保留就删掉吧
fb84c53
to
fd0c655
Compare
e54e7b1
to
e6edf3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR-CI-Codestyle-Check 需要解决格式问题 |
好的 这边处理一下 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
VLOG(4) << paddle::string::Sprintf(INPUT_PRINT_TEMPLATE, input_str, output_str); | ||
VLOG(6) << paddle::string::Sprintf(INPUT_PRINT_TEMPLATE, input_str, output_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两行看上去一样,新加一个VLOG(6)的作用是什么呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的, 确实存在重复打印的问题, 这边修改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -870,6 +870,8 @@ PYBIND11_MODULE(libpaddle, m) { | |||
[](const std::shared_ptr<egr::GradNodeBase> &self) { | |||
return self->NextFunctions(); | |||
}) | |||
|
|||
.def("node_this_ptr", &egr::GradNodeBase::GetThisPtr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node_this_ptr
这么命名感觉有些奇怪,可以再想想有没有更好的命名
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wanghuancoder 欢哥 命名这块有没有什么建议?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要不改成.def("node_ptr", &egr::GradNodeBase::GetPtr)吧
这个PR不要改了。新提一个PR修改。这个PR先合入。
for paddleviz
for paddleviz
for paddleviz
PR types
New features
PR changes
Others
Description
赛题简介:
飞桨深度学习框架提供了动态图编程的模式来开发深度学习模型(方便开发与调试),但动态图的反向图调试能力仍存在不足。@qiuwenbogdut 和 @Tomoko-hjf 两位社区开发者为Paddle开发了反向图可视化工具 paddleviz,很大程度上提升了反向图的调试能力。但我们还希望,在现有 paddleviz 基础上,扩展 paddleviz 的能力,进一步提升反向图的调试能力。
赛题要求:
深入学习Paddle动态图机制,掌握动态图反向图的基础数据结构之间的关系
学习了解 paddleviz 的原理
探索如何在 paddleviz 基础上,扩展反向图边(Tensor)的调试信息,包括不限于Tensor name、shape、dtype、place、stop_gradient 等。
探索以上数据可以通过框架的哪些数据结构中获得,何时、如何获得
探索如何将这些数据在 paddleviz 中展示
赛题八 任务描述
赛题八 tracking issue
当前这个PR计划完成的工作: