Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow input shared across execution providers #1715

Merged
merged 1 commit into from
Aug 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions onnxruntime/core/framework/session_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,20 @@ common::Status SessionState::AddInputNameToNodeInfoMapping(const std::string& in
// replace existing entry that is for an implicit input with new entry for explicit usage in this graph
entries[0] = node_info;
} else {
// if the providers match we can add the new entry for completeness (it will be ignored in
// if the devices match we can add the new entry for completeness (it will be ignored in
// utils::CopyOneInputAcrossDevices though).
// if they don't, we are broken.
const auto& current_provider = utils::GetNodeInputProviderType(entries[0]);
const auto& new_provider = utils::GetNodeInputProviderType(node_info);
const auto& current_device = entries[0].device;
const auto& new_device = node_info.device;

if (current_provider == new_provider) {
if (current_device == new_device) {
entries.push_back(node_info);
} else {
return ORT_MAKE_STATUS(
ONNXRUNTIME, NOT_IMPLEMENTED,
"Using an input in multiple nodes on different devices is not supported currently. Input:", input_name,
" is used by node ", existing_entry.p_node->Name(), " (", current_provider, ") and node ",
node_info.p_node->Name(), " (", new_provider, ").");
" is used by node ", existing_entry.p_node->Name(), " (", current_device->ToString(), ") and node ",
node_info.p_node->Name(), " (", new_device->ToString(), ").");
}
}
}
Expand Down