Skip to content

Comments

feature/inference analysis#10459

Closed
Superjomn wants to merge 22 commits intoPaddlePaddle:developfrom
Superjomn:feature/inference_analysis
Closed

feature/inference analysis#10459
Superjomn wants to merge 22 commits intoPaddlePaddle:developfrom
Superjomn:feature/inference_analysis

Conversation

@Superjomn
Copy link
Contributor

@Superjomn Superjomn commented May 7, 2018

Inference Analysis

Borrow some ideas from LLVM/analysis, the analysis phase optimize the codes(similar concept as ProgramDesc) there is some analysis passes, the original ProgramDesc will be translated to a lower computation graph representation for simple operation, and the graph will pass through all the passes one by one just like a pipe.

For example

ProgramDesc -> DFG(DataFlowGraph) ->
# following are the analyasis/optimization passes
# just a demo, some passes havn't been implemented
InferenceOpPrunePass -> TensorRTSubgrahpSplitterPass -> InferenceMemoryReusePass ->

DFG -> ProgramDesc -> Executor

All the passes can be controled by GFLAGS, and turned on/off by some configurations.

This is an Analysis framework designed to contain all the transpiler like analysis/optimization, which rewrites a ProgramDesc to an optimized one.

code structure

  • graph representation related
    • data_flow_graph.cc/.h
    • node
    • graph_traits some graph retrival algorithms
  • Pass related
    • pass.h define the basic Pass interfaces
    • pass_manager
    • fluid_to_data_flow_graph_pass transform a data flow graph from a fluid ProgramDesc
    • tensorrt_subgraph_pass split sub-graphs for TensorRT
    • data_flow_graph_to_fluid_pass translate from a data flow graph to a fluid ProgramDesc that can be executed by a Executor
  • Helpers
    • dot, help to visualize a graph for better debug
    • subgraph_splitter split a graph according to some conditions
    • helper some helper methods

status

  • ready to review
  • working on some changes

@luotao1
Copy link
Contributor

luotao1 commented May 8, 2018

Since this PR is large, could it split into several small PRs? Maybe one concept with its test one PR?

node_tester.cc
dot_tester.cc
data_flow_graph_tester.cc
subgraph_splitter_tester.cc
fluid_to_data_flow_graph_pass_tester.cc
data_flow_graph_to_fluid_pass_tester.cc

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