Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/openvinotoolkit/openvino
Browse files Browse the repository at this point in the history
…into as/weights_bank_dq_update
  • Loading branch information
smirnov-alexey committed Oct 3, 2024
2 parents f47c9f1 + 890f2e1 commit 576c699
Show file tree
Hide file tree
Showing 9 changed files with 638 additions and 538 deletions.
10 changes: 5 additions & 5 deletions src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

#pragma once

#include "openvino/runtime/threading/cpu_streams_executor.hpp"
#include "openvino/runtime/threading/istreams_executor.hpp"

#include "intel_gpu/graph/topology.hpp"
#include "intel_gpu/graph/program.hpp"
#include "intel_gpu/graph/serialization/binary_buffer.hpp"
#include "intel_gpu/runtime/compounds.hpp"
#include "intel_gpu/runtime/memory.hpp"
#include "intel_gpu/runtime/engine.hpp"
#include "intel_gpu/runtime/event.hpp"
#include "intel_gpu/runtime/stream.hpp"
#include "intel_gpu/runtime/lru_cache.hpp"
#include "intel_gpu/runtime/shape_predictor.hpp"
#include "intel_gpu/plugin/variable_state.hpp"

Expand Down Expand Up @@ -211,7 +209,7 @@ struct network {
bool is_dynamic() const { return _is_dynamic; }
size_t get_weights_cache_capacity() const { return _weights_cache_capacity; }

memory_pool& get_memory_pool() {
memory_pool& get_memory_pool() const {
return *_memory_pool;
}

Expand Down Expand Up @@ -284,7 +282,9 @@ struct network {
void dump_memory_pool(std::string dump_path, int64_t curr_iter);

#ifdef GPU_DEBUG_CONFIG
int64_t iteration = 0;
mutable int64_t iteration = 0;
friend class NetworkDebugHelper;
friend class NodeDebugHelper;
#endif
};
} // namespace cldnn
526 changes: 526 additions & 0 deletions src/plugins/intel_gpu/src/graph/debug_helper.cpp

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions src/plugins/intel_gpu/src/graph/debug_helper.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright (C) 2018-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include "intel_gpu/graph/network.hpp"
#include "intel_gpu/graph/program.hpp"
#include "intel_gpu/runtime/stream.hpp"
#include "intel_gpu/runtime/debug_configuration.hpp"
#include "primitive_inst.h"

namespace cldnn {

#ifdef GPU_DEBUG_CONFIG

class NodeDebugHelper {
public:
NodeDebugHelper(const primitive_inst& inst);
~NodeDebugHelper();

private:
std::string get_iteration_prefix() {
if (m_iter < 0)
return std::string("");
return std::to_string(m_iter) + "_";
}

std::string get_file_prefix() {
auto prog_id = ((m_program != nullptr) ? m_program->get_id() : 0);
auto net_id = m_network.get_id();

return "program" + std::to_string(prog_id) + "_network" + std::to_string(net_id) + "_" + get_iteration_prefix() + m_inst.id();
}


const primitive_inst& m_inst;
stream& m_stream;
const network& m_network;
const program* m_program;
const size_t m_iter;

const debug_configuration* debug_config = cldnn ::debug_configuration ::get_instance();
};

class NetworkDebugHelper {
public:
NetworkDebugHelper(const network& net);
~NetworkDebugHelper();

private:
void dump_memory_pool(std::string dump_path, int64_t curr_iter) const;
const network& m_network;
const size_t m_iter;

const debug_configuration* debug_config = cldnn ::debug_configuration ::get_instance();
};

#define NETWORK_DEBUG(net) NetworkDebugHelper __network_debug_helper(net)
#define NODE_DEBUG(inst) NodeDebugHelper __node_debug_helper(inst)

#else

#define NETWORK_DEBUG(...)
#define NODE_DEBUG(...)

#endif // GPU_DEBUG_CONFIG

} // namespace cldnn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ std::string get_dir_path(const ExecutionConfig& config);
void dump_graph_optimized(std::ofstream&, const program&);
void dump_graph_processing_order(std::ofstream&, const program&);
void dump_graph_init(std::ofstream&, const program&,
std::function<std::shared_ptr<primitive_inst>(const primitive_id&)> get_primitive_inst = nullptr);
std::function<std::shared_ptr<const primitive_inst>(const primitive_id&)> get_primitive_inst = nullptr);
void dump_graph_info(std::ofstream&, const program&);
} // namespace cldnn
12 changes: 7 additions & 5 deletions src/plugins/intel_gpu/src/graph/layout_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,11 +1089,13 @@ format layout_optimizer::get_expected_format(quantize_node const& node) {
auto use_onednn_impls = _optimization_attributes.use_onednn_impls;

if (use_onednn_impls) {
auto& user = node.get_users().front();
if (user != nullptr && user->get_preferred_input_fmt(user->get_dependency_index(node)) != format::any) {
expected = user->get_preferred_input_fmt(user->get_dependency_index(node));
} else {
expected = format::any;
expected = format::any;
auto& users = node.get_users();
if (users.size() != 0) {
auto& user = users.front();
if (user != nullptr && user->get_preferred_input_fmt(user->get_dependency_index(node)) != format::any) {
expected = user->get_preferred_input_fmt(user->get_dependency_index(node));
}
}
} else if (only_gemm_users(node)) {
// TODO: Gemm is not supporting fsv layouts
Expand Down
Loading

0 comments on commit 576c699

Please sign in to comment.