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

Share memory in single session without user specification #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 1 addition & 4 deletions onnxruntime/core/framework/session_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,8 @@ Status SessionState::PrepackConstantInitializedTensors(InlinedHashMap<std::strin
bool is_packed = false;
const Tensor& const_initialized_tensor = constant_initialized_tensors[ort_value_idx].Get<Tensor>();

auto iter = initializers_to_share_map.find(input_name);
bool is_shared_initializer = (iter != initializers_to_share_map.end());

// Caching pre-packed weights is limited to shared initializers associated with the CPU EP for now
if (is_shared_initializer && should_cache_prepacked_weights_for_shared_initializers &&
if (should_cache_prepacked_weights_for_shared_initializers &&
node.GetExecutionProviderType() == kCpuExecutionProvider) { // caching of pre-packed weights' turned ON

AllocatorPtr allocator_for_caching = prepacked_weights_container_->GetOrCreateAllocator(CPU);
Expand Down