函数调用关系图
2025-02-11 10:47:17 1 举报
AI智能生成
函数调用关系图
作者其他创作
大纲/内容
ReadMetaGraphDefFromSavedModel
ReadSavedModel
ReadBinaryProto
FindMetaGraphDef
LoadMetaGraphIntoSession
DirectSessionFactory.NewSession
DirectSession.Create(GraphDef)
DirectSession.ExtendLocked(GraphDef)
GraphExecutionState.MakeForBaseGraph
AddDefaultAttrsToGraphDef
ConvertGraphDefToGraph
InitBaseGraph(base_graph)
RestoreStatefulNodes(base_graph)
PRE_PLACEMENT
Placer.run()
POST_PLACEMENT
node_name_to_cost_id_map_
SaveStatefulNodes
GetAssetFileDefs
loader.RunRestore
AddAssetsTensorsToInputs
loader.RunOnce(运行一次图)
vector<std::pair<string, Tensor>> inputs
CallableOptions
RunOptions& run_options
add_feed
add_target
session->MakeCallable
ExecutorsAndKeys ek ->CallableHandle
FunctionInfo func_info -> CallableHandle
CreateExecutors
ExecutorsAndKeys ek
FunctionInfo func_info
BuildGraphOptions
GraphExecutionState.CreateGraphs
GraphExecutionState.BuildGraph
GraphExecutionState::OptimizeGraph
grappler::GrapplerItem item
graph_->ToGraphDef(&item.graph)
item.AddDevice(d->name())
item.fetch.insert(options.callable_options.target())
loop: graph_->nodes()
GetFeedShapeAndTypeFromAttribute(node->def())
item.feed.emplace_back(node->name(), fake_input)
Device* cpu_device
RunMetaOptimizer(item)
OptimizeGraph(cluster, trimmed_item, optimized_graph)
InitializeOptimizers(&optimizers)
ModelPruner
ImplementationSelector
FunctionOptimizer
ConstantFolding
ShapeOptimizer
Remapper
ArithmeticOptimizer
LoopOptimizer
DependencyOptimizer
GenericLayoutOptimizer
MemoryOptimizer
minimized_flib(*optimized_graph)
ConvertGraphDefToGraph
PruneGraph
execution_state->GetStatefulPlacements()???
Partition
ConvertGraphDefToGraph
GraphOptimizationPassOptions
循环每个子图
创建OpKernel
LookupDevice
GraphOptimizer.Optimize
CSE
常量合并
Function Inlining (函数内联)
EnsureMemoryTypes???
ExecutorFactory.NewExecutor
ek->input_name_to_index
session->RunCallable
Tensor variables_path_tensor
RunCallableCallFrame
RunInternal
IntraProcessRendezvous
ExecutorBarrier
Executor::Args::Runner default_runner
executors_and_keys.items.executor->RunAsync
device->FillContextMap
ready.push_back impl_->root_nodes_
ScheduleReady(ready, nullptr)
DirectSession.run
GetOrCreateExecutors
executors_.find(key)
executors_.find(sorted_key)
CreateExecutors
RunInternal
outputs
0 条评论
下一页