-
Notifications
You must be signed in to change notification settings - Fork 5.9k
feature/inference analysis dot #10494
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
feature/inference analysis dot #10494
Conversation
e812ab6
to
c4739d0
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.
还未review完,建议dot.h dot_tester.cc可以先拆出来,作为第一个PR merge。
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.
这个注释不够准确。models是由python/paddle/fluid/tests/book
生成的,写成tests/book
,会认为是paddle/fluid/inference/tests/book
生成的。
这个注释可以放到23行前,因为这里两个test目录都依赖生成的模型。
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.
done
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.
.h
不用写在cmake里面,改成
cc_library(inference_analysis SRCS node.cc graph_traits.cc data_flow_graph.cc dot.cc)
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_tester
,dot_tester
,data_flow_graph_tester
- 11-18行的依赖可以直接使用{FLUID_CORE_MODULES}, https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/inference/CMakeLists.txt#L1
- 对dot_tester和node_tester来说,它们不需要依赖fluid代码就可以跑,
cc_test(dot_tester SRCS dot_tester.cc dot.cc)
cc_test(node_tester SRCS node_tester.cc node.cc)
cc_test(data_flow_graph_tester SRCS data_flow_graph_tester.cc data_flow_graph_tester.cc DEPS ${FLUID_CORE_MODULES})
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.
dot.cc 可以删去,20行实现在dot.h里面即可。
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.
reference https://stackoverflow.com/questions/18860895/how-to-initialize-static-members-in-the-header
the static member should be booted in a src.
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.
graph_traits.cc可以删去。
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.
A registry helper class keeps the order they register?
python/paddle/fluid/metrics.py
Outdated
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.
这个PR为什么需要修改metrics.py?
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_tester.cc没有内容的话,可以先删掉。
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.
some nodes can have a name:为什么有些可以有名字,有些没有呢?
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.
Value 有名字,Function没有; 类比 variable 有名字,OP没有名字
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.
Get it 可以加下注释。
c4739d0
to
52e6b20
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.
Get it 可以加下注释。
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.
NOTE that the new node types should be added here.
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.
- kNone是用在什么地方呢?
- kFunction->kOp?
- kFunctionBlock->kBlock?
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.
Formatted->Format the
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.
1.style filled是表示什么?
2.One Node type can customize its own node?是说每一种node type都有自定义?
|
||
if(WITH_TESTING) | ||
add_subdirectory(tests/book) | ||
# analysis test depends the models that generate by python/paddle/fluid/tests/book |
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.
24行放到23行前面
both tests/book and analysis depend on the models that generated by python/paddle/fluid/tests/book
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.
done
@@ -0,0 +1 @@ | |||
cc_test(test_dot SRCS dot.cc dot.h dot_tester.cc) |
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.
cc_test(test_dot SRCS dot.cc dot_tester.cc)
不需要.h
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.
.h is ok
TEST_F(DotTester, Build) { | ||
auto codes = dot->Build(); | ||
// Output the DOT language code, the generated codes are too long to compare | ||
// the string. |
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.
done
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
…/inference-framework
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
This is the framework for inference analysis
This PR is a part of the full code.