mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-23 22:13:38 +00:00
nGraph: Avoid input and output data copies (#940)
This commit is contained in:
parent
01cd7eaca8
commit
3b0dda0aca
3 changed files with 4 additions and 4 deletions
|
|
@ -176,7 +176,7 @@ Status GraphPartitioner::Partition(Graph& graph, bool export_dll, FuncManager& f
|
|||
//prepare the func kernel
|
||||
KernelDefBuilder builder;
|
||||
BuildFusedKernelDef(builder, *node);
|
||||
if (node->GetExecutionProviderType() == onnxruntime::kTensorrtExecutionProvider) {
|
||||
if (node->GetExecutionProviderType() == onnxruntime::kTensorrtExecutionProvider || node->GetExecutionProviderType() == onnxruntime::kNGraphExecutionProvider) {
|
||||
builder.SetDefaultInputsMemoryType(OrtMemTypeCPUInput);
|
||||
builder.SetDefaultOutputMemoryType(OrtMemTypeCPUOutput);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ common::Status CopyOneInputAcrossDevices(const SessionState& session_state,
|
|||
ORT_ENFORCE(p_input_provider);
|
||||
}
|
||||
|
||||
//no copy for TRT
|
||||
if (required_provider_type == onnxruntime::kTensorrtExecutionProvider) {
|
||||
//no copy for TRT and nGraph
|
||||
if (required_provider_type == onnxruntime::kTensorrtExecutionProvider || required_provider_type == onnxruntime::kNGraphExecutionProvider) {
|
||||
new_mlvalue = orig_mlvalue;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ void TransformerMemcpyImpl::ProcessDefs(onnxruntime::Node& node, const KernelReg
|
|||
} else {
|
||||
// TODO: copy between devices? i.e. multiple GPUs
|
||||
if (node.GetExecutionProviderType() != onnxruntime::kCpuExecutionProvider && node.GetExecutionProviderType() != onnxruntime::kTensorrtExecutionProvider &&
|
||||
!node.GetExecutionProviderType().empty()) {
|
||||
node.GetExecutionProviderType() != onnxruntime::kNGraphExecutionProvider && !node.GetExecutionProviderType().empty()) {
|
||||
ORT_THROW("Execution type '", node.GetExecutionProviderType(), "' doesn't support memcpy ");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue