MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RunGrouping

Method RunGrouping

tensorflow/core/common_runtime/optimization_registry.cc:33–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33Status OptimizationPassRegistry::RunGrouping(
34 Grouping grouping, const GraphOptimizationPassOptions& options) {
35 auto group = groups_.find(grouping);
36 if (group != groups_.end()) {
37 for (auto& phase : group->second) {
38 VLOG(1) << "Running optimization phase " << phase.first;
39 for (auto& pass : phase.second) {
40 VLOG(1) << "Running optimization pass: " << pass->name();
41 Status s = pass->Run(options);
42 if (!s.ok()) return s;
43 if (VLOG_IS_ON(1)) {
44 if (options.graph) {
45 DumpGraphToFile(strings::StrCat("after_group_", grouping, "_phase_",
46 phase.first, "_", pass->name(), "_",
47 reinterpret_cast<uintptr_t>(
48 (*options.graph).get())),
49 **options.graph, options.flib_def);
50 }
51 if (options.partition_graphs) {
52 for (auto& part : *options.partition_graphs) {
53 DumpGraphToFile(
54 strings::StrCat(
55 "after_group_", grouping, "_phase_", phase.first, "_",
56 pass->name(), "_partition_", part.first, "_",
57 reinterpret_cast<uintptr_t>(part.second.get())),
58 *part.second, options.flib_def);
59 }
60 }
61 }
62 }
63 }
64 }
65 return Status::OK();
66}
67
68void OptimizationPassRegistry::LogGrouping(Grouping grouping, int vlog_level) {
69 auto group = groups_.find(grouping);

Callers 8

CreateGraphsMethod · 0.80
CallOptPassesAndPlaceMethod · 0.80
TESTFunction · 0.80
RunPassMethod · 0.80
InitBaseGraphMethod · 0.80
BuildGraphMethod · 0.80
InitItemMethod · 0.80

Calls 8

DumpGraphToFileFunction · 0.85
nameMethod · 0.65
StrCatFunction · 0.50
findMethod · 0.45
endMethod · 0.45
RunMethod · 0.45
okMethod · 0.45
getMethod · 0.45

Tested by 3

CallOptPassesAndPlaceMethod · 0.64
TESTFunction · 0.64
RunPassMethod · 0.64