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

Method PartialRunSetup

tensorflow/core/distributed_runtime/master_session.cc:1811–1848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1809}
1810
1811Status MasterSession::PartialRunSetup(const PartialRunSetupRequest* req,
1812 PartialRunSetupResponse* resp) {
1813 std::vector<string> inputs, outputs, targets;
1814 for (const auto& feed : req->feed()) {
1815 inputs.push_back(feed);
1816 }
1817 for (const auto& fetch : req->fetch()) {
1818 outputs.push_back(fetch);
1819 }
1820 for (const auto& target : req->target()) {
1821 targets.push_back(target);
1822 }
1823
1824 string handle = std::to_string(partial_run_handle_counter_.fetch_add(1));
1825
1826 ReffedClientGraph* rcg = nullptr;
1827
1828 // Prepare.
1829 BuildGraphOptions opts;
1830 BuildBuildGraphOptions(*req, &opts);
1831 int64 count = 0;
1832 TF_RETURN_IF_ERROR(StartStep(opts, true, &rcg, &count));
1833
1834 rcg->Ref();
1835 RunState* run_state =
1836 new RunState(inputs, outputs, rcg,
1837 NewStepId(BuildGraphOptions::kNoCollectiveGraphKey), count);
1838 {
1839 mutex_lock l(mu_);
1840 partial_runs_.emplace(
1841 std::make_pair(handle, std::unique_ptr<RunState>(run_state)));
1842 }
1843
1844 TF_RETURN_IF_ERROR(BuildAndRegisterPartitions(rcg));
1845
1846 resp->set_partial_run_handle(handle);
1847 return Status::OK();
1848}
1849
1850Status MasterSession::Run(CallOptions* opts, const RunStepRequestWrapper& req,
1851 MutableRunStepResponseWrapper* resp) {

Callers

nothing calls this directly

Calls 9

to_stringFunction · 0.85
BuildBuildGraphOptionsFunction · 0.85
feedMethod · 0.45
push_backMethod · 0.45
fetchMethod · 0.45
targetMethod · 0.45
RefMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected