Skip to content

Conversation

Superjomn
Copy link
Contributor

@Superjomn Superjomn commented May 8, 2018

This is the framework for inference analysis

This PR is a part of the full code.

@Superjomn Superjomn force-pushed the feature/inference-framework branch from e812ab6 to c4739d0 Compare May 8, 2018 10:08
Copy link
Contributor

@luotao1 luotao1 left a 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。

Copy link
Contributor

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目录都依赖生成的模型。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

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)

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. 现在的写法,不能分开测试node_tester , dot_tester, data_flow_graph_tester
  2. 11-18行的依赖可以直接使用{FLUID_CORE_MODULES}, https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/inference/CMakeLists.txt#L1
  3. 对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})

Copy link
Contributor

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里面即可。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

graph_traits.cc可以删去。

Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

这个PR为什么需要修改metrics.py?

Copy link
Contributor

Choose a reason for hiding this comment

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

node_tester.cc没有内容的话,可以先删掉。

Copy link
Contributor

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:为什么有些可以有名字,有些没有呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Value 有名字,Function没有; 类比 variable 有名字,OP没有名字

Copy link
Contributor

Choose a reason for hiding this comment

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

Get it 可以加下注释。

@Superjomn Superjomn force-pushed the feature/inference-framework branch from c4739d0 to 52e6b20 Compare May 8, 2018 12:59
Copy link
Contributor

Choose a reason for hiding this comment

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

Get it 可以加下注释。

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. kNone是用在什么地方呢?
  2. kFunction->kOp?
  3. kFunctionBlock->kBlock?

Copy link
Contributor

Choose a reason for hiding this comment

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

Formatted->Format the

Copy link
Contributor

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都有自定义?

@Superjomn Superjomn changed the title feature/inference analysis framework feature/inference analysis dot May 8, 2018

if(WITH_TESTING)
add_subdirectory(tests/book)
# analysis test depends the models that generate by python/paddle/fluid/tests/book
Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

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.
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.

done

luotao1
luotao1 previously approved these changes May 8, 2018
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@Superjomn Superjomn merged commit 6eeb819 into PaddlePaddle:develop May 9, 2018
@Superjomn Superjomn deleted the feature/inference-framework branch May 9, 2018 07:00
putcn pushed a commit to putcn/Paddle that referenced this pull request May 10, 2018
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