Skip to content

Commit

Permalink
Used correct core instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
popovaan committed Dec 19, 2024
1 parent d926303 commit eb4d110
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cpp/src/continuous_batching_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ContinuousBatchingPipeline::ContinuousBatchingImpl::ContinuousBatchingImpl(

bool is_need_per_layer_cache_control = scheduler_config.use_cache_eviction;
utils::apply_paged_attention_transformations(model, device_config, is_need_per_layer_cache_control);
m_core = std::make_shared<Core>(core);

init(model, scheduler_config, compile_properties, device_config, core);
}
Expand All @@ -44,11 +45,10 @@ void ContinuousBatchingPipeline::ContinuousBatchingImpl::_pull_awaiting_requests
}

size_t ContinuousBatchingPipeline::ContinuousBatchingImpl::_get_available_gpu_memory() {
ov::Core core = utils::singleton_core();
auto device = m_device_config->get_device();
OPENVINO_ASSERT(device.find("GPU") != std::string::npos, "_get_available_gpu_memory() is applicable for GPU only.");
auto memory_statistics = core.get_property(device, ov::intel_gpu::memory_statistics);
auto device_type = core.get_property(device, ov::device::type);
auto memory_statistics = m_core->get_property(device, ov::intel_gpu::memory_statistics);
auto device_type = m_core->get_property(device, ov::device::type);

// sum up all used device memory
std::vector<std::string> device_memory_types = {"cl_mem", "usm_device"};
Expand All @@ -68,7 +68,7 @@ size_t ContinuousBatchingPipeline::ContinuousBatchingImpl::_get_available_gpu_me
used_device_mem *= used_memory_threshold;

// total device memory in bytes
auto total_device_memory = core.get_property(device, ov::intel_gpu::device_total_mem_size);
auto total_device_memory = m_core->get_property(device, ov::intel_gpu::device_total_mem_size);

return total_device_memory - used_device_mem;
}
Expand Down
1 change: 1 addition & 0 deletions src/cpp/src/continuous_batching_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ContinuousBatchingPipeline::ContinuousBatchingImpl : public ContinuousBatc
const float m_percentage_threshold_for_cache_increase = 100;

bool m_dynamic_memory_allocation = false;
std::shared_ptr<Core> m_core;

#ifdef DEBUG_CACHE_STATE_DUMP
size_t step_count = 0;
Expand Down

0 comments on commit eb4d110

Please sign in to comment.