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

Method ComputeSlack

tensorflow/core/distributed_runtime/scheduler.cc:175–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void SlackAnalysis::ComputeSlack(std::vector<int64>* slacks) {
176 std::vector<Microseconds> asap_times;
177 std::vector<Microseconds> alap_times;
178 ComputeAsap(&asap_times);
179 ComputeAlap(&alap_times);
180 slacks->resize(graph_->num_node_ids());
181 Node* srcNode = graph_->source_node();
182 Microseconds makespan = alap_times[srcNode->id()];
183 for (Node* node : graph_->nodes()) {
184 Microseconds latest_stime = alap_times[node->id()] - makespan;
185 (*slacks)[node->id()] = (latest_stime - asap_times[node->id()]).value();
186 }
187}
188
189GreedyScheduler::GreedyScheduler(const DeviceSet* devices,
190 const CostModel* cost_model, const Graph* g,

Callers 1

ComputeScheduleMethod · 0.80

Calls 6

resizeMethod · 0.45
num_node_idsMethod · 0.45
source_nodeMethod · 0.45
idMethod · 0.45
nodesMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected