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

Method RunAsync

tensorflow/compiler/xla/client/local_client.cc:231–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231StatusOr<ScopedShapedBuffer> LocalExecutable::RunAsync(
232 const absl::Span<const ShapedBuffer* const> arguments,
233 ExecutableRunOptions run_options) {
234 std::vector<const Shape*> argument_shapes;
235 argument_shapes.reserve(arguments.size());
236 for (const ShapedBuffer* const arg : arguments) {
237 argument_shapes.push_back(&arg->on_host_shape());
238 }
239 TF_ASSIGN_OR_RETURN(auto options_and_stream,
240 RunHelper(argument_shapes, run_options));
241 se::Stream* stream = run_options.stream();
242
243 std::shared_ptr<HloSnapshot> snapshot;
244 if (executable_->dumping_snapshot()) {
245 snapshot = DumpArguments(backend_, executable_.get(), arguments, stream);
246 }
247
248 TF_ASSIGN_OR_RETURN(ScopedShapedBuffer outputs,
249 executable_->ExecuteAsyncOnStreamWrapper(
250 &options_and_stream.first, arguments));
251
252 // Transfer the outputs and save the snapshot to disk.
253 if (snapshot) {
254 DumpOutputsAndSaveSnapshot(backend_, outputs, std::move(snapshot), stream);
255 }
256
257 return std::move(outputs);
258}
259
260static ShapedBuffer MaybeOwningShapeTreeToShapedBuffer(
261 Shape const& on_host_shape, const ShapeTree<MaybeOwningDeviceMemory>& tree,

Callers 2

ComputeMethod · 0.45
ExecuteHelperMethod · 0.45

Calls 15

DumpArgumentsFunction · 0.85
InvalidArgumentFunction · 0.85
dumping_snapshotMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
streamMethod · 0.45
getMethod · 0.45
platformMethod · 0.45
device_ordinalMethod · 0.45

Tested by

no test coverage detected