Skip to content

Commit

Permalink
[GPU] Remove property
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-paramuzov committed Sep 19, 2024
1 parent dd4d729 commit 89ff672
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,6 @@ static constexpr Property<bool> enable_sdpa_optimization{"GPU_ENABLE_SDPA_OPTIMI
* @ingroup ov_runtime_ocl_gpu_prop_cpp_api
*/
static constexpr Property<bool> enable_kernels_reuse{"GPU_ENABLE_KERNELS_REUSE"};

/**
* @brief Turning on this key switches addressing mode to allow allocations larger than 4GB
* as described here
* https://github.com/intel/compute-runtime/blob/master/programmers-guide/ALLOCATIONS_GREATER_THAN_4GB.md#creating-allocations-greater-than-4GB
* Note: On some platform performance of primitives with i64 data type may be lower with this option enabled.
* @ingroup ov_runtime_ocl_gpu_prop_cpp_api
*/
static constexpr Property<bool> enable_large_allocations{"GPU_ENABLE_LARGE_ALLOCATIONS"};
} // namespace hint

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,6 @@ void set_params(const kernel_impl_params& param_info, kernel_selector::params& p
params.engineInfo.supports_imad = device_info.supports_imad;
params.engineInfo.supports_immad = device_info.supports_immad;
params.engineInfo.enable_sub_groups_emulation = true;
params.engineInfo.enable_large_allocations = config.get_property(ov::intel_gpu::hint::enable_large_allocations);
params.engineInfo.bOptHintsSupport = false;

params.engineInfo.bLocalBlockIOSupport = query_local_block_io_supported(engine, config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ std::shared_ptr<KernelString> KernelBaseOpenCL::GetKernelString(const std::strin
kernel_string->undefs = jit.second;
if (engine_info.vendor_id == cldnn::INTEL_VENDOR_ID) {
kernel_string->options = exe_mode + " -cl-mad-enable";
if (engine_info.enable_large_allocations)
kernel_string->options += " -cl-intel-greater-than-4GB-buffer-required";
kernel_string->options += " -cl-intel-greater-than-4GB-buffer-required";
if (engine_info.bOptHintsSupport)
kernel_string->options += " -DOPT_HINTS_SUPPORTED=1";
if (engine_info.bLocalBlockIOSupport)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ struct EngineInfo {
bool supports_imad = false;
bool supports_immad = false;
bool enable_sub_groups_emulation = false;
bool enable_large_allocations = false;
bool bOptHintsSupport = false;
bool bLocalBlockIOSupport = false;
bool supports_microkernels = false;
Expand Down
23 changes: 0 additions & 23 deletions src/plugins/intel_gpu/src/plugin/program_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "openvino/core/shape.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/split.hpp"
#include "openvino/op/variadic_split.hpp"
Expand All @@ -17,7 +16,6 @@
#include "intel_gpu/primitives/data.hpp"
#include "intel_gpu/op/fully_connected_compressed.hpp"
#include "intel_gpu/op/placeholder.hpp"
#include "openvino/runtime/intel_gpu/properties.hpp"
#include "openvino/util/pp.hpp"

#ifdef __linux__
Expand All @@ -28,18 +26,6 @@
#include <malloc.h>
#endif

namespace {
bool requires_large_allocations(const std::shared_ptr<ov::Node>& op, size_t max_alloc_size) {
for (size_t i = 0; i < op->get_output_size(); i++) {
const auto& out_pshape = op->get_output_partial_shape(i);
if (out_pshape.is_static() && ov::shape_size(out_pshape.to_shape()) * op->get_output_element_type(i).size() >= max_alloc_size) {
return true;
}
}

return false;
}
} // namespace

namespace ov {
namespace intel_gpu {
Expand Down Expand Up @@ -168,22 +154,13 @@ std::shared_ptr<cldnn::program> ProgramBuilder::build(const std::vector<std::sha
}
}

bool enable_large_allocations = false;
for (const auto& op : ops) {
if (requires_large_allocations(op, m_engine.get_device_info().max_alloc_mem_size)) {
enable_large_allocations = true;
break;
}
}

if (is_inner_program) {
allow_new_shape_infer = (m_config.get_property(ov::intel_gpu::allow_new_shape_infer) || allow_new_shape_infer);
}

m_config.set_property(ov::intel_gpu::partial_build_program(partial_build));
m_config.set_property(ov::intel_gpu::optimize_data(true));
m_config.set_property(ov::intel_gpu::allow_new_shape_infer(allow_new_shape_infer));
m_config.set_property(ov::intel_gpu::hint::enable_large_allocations(enable_large_allocations));

prepare_build();
{
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/intel_gpu/src/runtime/execution_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "intel_gpu/runtime/execution_config.hpp"
#include "intel_gpu/runtime/debug_configuration.hpp"
#include "openvino/runtime/intel_gpu/properties.hpp"
#include "openvino/runtime/internal_properties.hpp"

#include <thread>
Expand Down Expand Up @@ -53,7 +52,6 @@ void ExecutionConfig::set_default() {
std::make_tuple(ov::intel_gpu::hint::queue_throttle, ov::intel_gpu::hint::ThrottleLevel::MEDIUM),
std::make_tuple(ov::intel_gpu::hint::queue_priority, ov::hint::Priority::MEDIUM),
std::make_tuple(ov::intel_gpu::hint::enable_sdpa_optimization, true),
std::make_tuple(ov::intel_gpu::hint::enable_large_allocations, false),
std::make_tuple(ov::intel_gpu::enable_loop_unrolling, true),
std::make_tuple(ov::intel_gpu::disable_winograd_convolution, false),
std::make_tuple(ov::internal::exclusive_async_requests, false),
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/intel_gpu/src/runtime/ocl/ocl_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ gpu_usm::gpu_usm(ocl_engine* engine, const layout& layout, allocation_type type)
std::vector<cl_mem_properties_intel> properties;
if (engine->get_device_info().vendor_id == INTEL_VENDOR_ID) {
properties = {CL_MEM_FLAGS, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL, 0};
} else {
properties = {0};
}

switch (get_allocation_type()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2229,9 +2229,10 @@ TEST(reduce_f32_fw_gpu, large_buffer) {

layout in_l = { sz_8gb, data_types::f32, format::bfyx };

auto config = get_test_default_config(*engine);
topology topology(input_layout("input", in_l),
reduce("reduce", input_info("input"), reduce_mode::mean, {2}, true));
network network(*engine, topology, get_test_default_config(*engine));
network network(*engine, topology, config);
auto input = network.get_output_memory("input");
{
mem_lock<float, mem_lock_type::write> l(input, get_test_stream());
Expand Down

0 comments on commit 89ff672

Please sign in to comment.