Skip to content

Commit

Permalink
unit test fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Paramuzov <[email protected]>
  • Loading branch information
vladimir-paramuzov committed Jan 28, 2025
1 parent d1cd693 commit 6794136
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
3 changes: 1 addition & 2 deletions src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ struct network {
void set_reuse_variable_mem(bool reuse = false);
bool is_reuse_variable_mem() { return _reuse_variable_mem; }

const ExecutionConfig& get_config() const { return _config; }
const ExecutionConfig& get_config() const { return _program->get_config(); }

std::shared_ptr<ShapePredictor> get_shape_predictor() { return _shape_predictor; }
void set_shape_predictor(std::shared_ptr<ShapePredictor> shape_predictor) { _shape_predictor = shape_predictor; }
Expand All @@ -210,7 +210,6 @@ struct network {
using output_chains_map = std::map<primitive_id, std::vector<primitive_inst*>>;
uint32_t net_id = 0;
program::ptr _program;
ExecutionConfig _config;
engine& _engine;
stream::ptr _stream;
std::unique_ptr<memory_pool> _memory_pool;
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/intel_gpu/src/graph/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ opt pass).
*/
network::network(program::ptr program, stream::ptr stream, bool is_internal, bool is_primary_stream)
: _program(program)
, _config(program->get_config())
, _engine(program->get_engine())
, _stream(stream)
, _memory_pool(new memory_pool(program->get_engine(), program->get_config()))
Expand Down Expand Up @@ -225,7 +224,7 @@ network::~network() {
if (_program != nullptr)
_program->cancel_compilation_context();
_memory_pool->clear_pool_for_network(net_id);
std::string dump_path = GPU_DEBUG_VALUE_OR(_config.get_dump_profiling_data_path(), "");
std::string dump_path = GPU_DEBUG_VALUE_OR(get_config().get_dump_profiling_data_path(), "");
GPU_DEBUG_IF(!dump_path.empty()) {
dump_perf_data_raw(dump_path + "/perf_raw" + std::to_string(net_id) + ".csv", false, _exec_order);
}
Expand Down Expand Up @@ -385,7 +384,7 @@ void network::calculate_weights_cache_capacity() {
}

// Sum all weights constants for each stream
required_mem_size += weights_const_size * _config.get_num_streams();
required_mem_size += weights_const_size * get_config().get_num_streams();
// Add all other constants (shared between streams)
required_mem_size += total_const_size - weights_const_size;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
auto config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));
config.set_property(ov::hint::dynamic_quantization_group_size(32));
config.set_user_property(ov::hint::dynamic_quantization_group_size(32));

network::ptr network = get_network(engine, topology, config, get_test_stream_ptr(), is_caching_test);

Expand Down Expand Up @@ -1643,7 +1643,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
ov::intel_gpu::ImplementationDesc fc_impl_desc = { format::bfyx, "fully_connected_gpu_bfyx_ref", impl_types::ocl };
config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ {"fc_prim", fc_impl_desc} }));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network network(engine, topology, config);
network.set_input_data("input", input_mem);
Expand All @@ -1669,7 +1669,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
auto config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network::ptr network = get_network(engine, topology, config, get_test_stream_ptr(), is_caching_test);

Expand Down Expand Up @@ -1753,7 +1753,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
ov::intel_gpu::ImplementationDesc fc_impl_desc = { format::bfyx, "fully_connected_gpu_bfyx_ref", impl_types::ocl };
config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ {"fc_prim", fc_impl_desc} }));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network network(engine, topology, config);
network.set_input_data("input", input_mem);
Expand All @@ -1780,9 +1780,9 @@ class fully_connected_gpu_tests: public ::testing::Test {
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));
if (is_dyn_quan) {
config.set_property(ov::hint::dynamic_quantization_group_size(32));
config.set_user_property(ov::hint::dynamic_quantization_group_size(32));
} else {
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));
}

network::ptr network = get_network(engine, topology, config, get_test_stream_ptr(), is_caching_test);
Expand Down Expand Up @@ -1923,7 +1923,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
ov::intel_gpu::ImplementationDesc fc_impl = { in_layout.format, "", impl_types::ocl };
config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ { "fc_prim1", fc_impl }, { "fc_prim2", fc_impl } }));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network network(engine, topology, config);
network.set_input_data("input", input_mem);
Expand Down Expand Up @@ -1952,7 +1952,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
auto config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network::ptr network = get_network(engine, topology, config, get_test_stream_ptr(), is_caching_test);

Expand Down Expand Up @@ -2905,7 +2905,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
ov::intel_gpu::ImplementationDesc fc_impl_desc = { format::bfyx, "fully_connected_gpu_bfyx_ref", impl_types::ocl };
config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ {"fc_prim", fc_impl_desc} }));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network network(engine, topo, config);
network.set_input_data("input", input_mem);
Expand All @@ -2931,7 +2931,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
auto config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));
config.set_property(ov::hint::dynamic_quantization_group_size(quantize_group_size));
config.set_user_property(ov::hint::dynamic_quantization_group_size(quantize_group_size));

network::ptr network = get_network(engine, topology, config, get_test_stream_ptr(), false);

Expand Down Expand Up @@ -3031,7 +3031,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
ov::intel_gpu::ImplementationDesc fc_impl_desc = { format::bfyx, "fully_connected_gpu_bf_tiled", impl_types::ocl };
config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ {"fc_prim", fc_impl_desc} }));
config.set_property(ov::hint::dynamic_quantization_group_size(0));
config.set_user_property(ov::hint::dynamic_quantization_group_size(0));

network network(engine, topo, config);
network.set_input_data("input", input_mem);
Expand All @@ -3057,7 +3057,7 @@ class fully_connected_gpu_tests: public ::testing::Test {
auto config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));
config.set_property(ov::hint::dynamic_quantization_group_size(quantize_group_size));
config.set_user_property(ov::hint::dynamic_quantization_group_size(quantize_group_size));

network::ptr network = get_network(engine, topology, config, get_test_stream_ptr(), false);

Expand Down Expand Up @@ -4210,7 +4210,7 @@ TEST_F(fully_connected_gpu_tests, compressed_int4_scale_dynamic_quantize_wzp_sta
this->test_compressed_int4_scale_dyn_quan_weight_i4(false, 320, 1024, 1024, 32, 32, true);
}

// Test weight zp for INT8 ASYM
// Test weight zp for INT8 ASYM
TEST_F(fully_connected_gpu_tests, compressed_int8_scale_dynamic_quantize_wzp_128_large) {
this->test_compressed_int8_scale_dyn_quan_weight_u8(true, 320, 4096, 4096, 128, 128, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,6 @@ static void test_loop_gpu_wo_trip_count_update_primitive_id(ov::PartialShape bod

auto const_shape = engine.allocate_memory({ov::PartialShape{4}, data_types::i32, format::bfyx});


std::vector<int32_t> body_input_layouts;
for (size_t i = 0; i < body_input_layout.size(); i++) {
if (body_input_layout[i].is_dynamic())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ namespace cldnn
p.prepare_memory_dependencies();
}
static void update_configs_properties(program& p, const ov::AnyMap& properties) {
p._config.set_property(properties);
auto config_copy = p._config.clone();
config_copy.set_property(properties);
p._config = config_copy;
}
};

Expand Down

0 comments on commit 6794136

Please sign in to comment.