[GPU] New debug config: dry_run (#7689)
Enabling dry_run will shorten runtime of any application by exiting just after graph compilation.
This commit is contained in:
parent
4fd59f72ea
commit
ee93823b3a
@ -4,6 +4,7 @@
|
||||
|
||||
#include <cldnn/graph/network.hpp>
|
||||
#include <cldnn/runtime/profiling.hpp>
|
||||
#include "cldnn/runtime/debug_configuration.hpp"
|
||||
|
||||
#include "cldnn_graph.h"
|
||||
#include "simple_math.h"
|
||||
@ -82,6 +83,13 @@ void CLDNNGraph::Build() {
|
||||
}
|
||||
|
||||
UpdateImplementationsMap();
|
||||
|
||||
GPU_DEBUG_GET_INSTANCE(debug_config);
|
||||
GPU_DEBUG_IF(!debug_config->dry_run_path.empty()) {
|
||||
CNNNetwork net(GetExecGraphInfo());
|
||||
net.serialize(debug_config->dry_run_path);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<cldnn::network> CLDNNGraph::BuildNetwork(std::shared_ptr<cldnn::program> program) {
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
std::string dump_sources; // Dump opencl sources
|
||||
std::string dump_layers_path; // Enable dumping intermediate buffers and set the dest path
|
||||
std::string dump_layers; // Dump intermediate buffers of specified layers only, separated by space
|
||||
std::string dry_run_path; // Dry run and serialize execution graph into the specified path
|
||||
int dump_layers_dst_only; // Dump only output of layers
|
||||
static const debug_configuration *get_instance();
|
||||
};
|
||||
|
@ -103,6 +103,7 @@ debug_configuration::debug_configuration()
|
||||
, dump_layers_path(std::string())
|
||||
, dump_layers(std::string())
|
||||
, dump_layers_dst_only(0)
|
||||
, dry_run_path(std::string())
|
||||
, disable_onednn(0) {
|
||||
#ifdef GPU_DEBUG_CONFIG
|
||||
get_common_debug_env_var("Verbose", verbose);
|
||||
@ -114,6 +115,7 @@ debug_configuration::debug_configuration()
|
||||
get_gpu_debug_env_var("DumpLayers", dump_layers);
|
||||
get_gpu_debug_env_var("DumpLayersDstOnly", dump_layers_dst_only);
|
||||
get_gpu_debug_env_var("DisableOnednn", disable_onednn);
|
||||
get_gpu_debug_env_var("DryRunPath", dry_run_path);
|
||||
|
||||
if (dump_layers_path.length() > 0 && !disable_usm) {
|
||||
disable_usm = 1;
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "primitive_inst.h"
|
||||
#include "cldnn/graph/program.hpp"
|
||||
#include "cldnn/runtime/error_handler.hpp"
|
||||
#include "cldnn/runtime/debug_configuration.hpp"
|
||||
#include "kernel_selector_helper.h"
|
||||
#include "cldnn/graph/network.hpp"
|
||||
#include "register.hpp"
|
||||
|
@ -423,9 +423,17 @@ void program::build_program(bool is_internal) {
|
||||
{ pre_optimize_graph(is_internal); }
|
||||
run_graph_compilation();
|
||||
{ post_optimize_graph(is_internal); }
|
||||
prepare_memory_dependencies();
|
||||
compile();
|
||||
init_kernels();
|
||||
|
||||
GPU_DEBUG_GET_INSTANCE(debug_config);
|
||||
#ifdef GPU_DEBUG_CONFIG
|
||||
if (debug_config->dry_run_path.empty()) {
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
prepare_memory_dependencies();
|
||||
compile();
|
||||
init_kernels();
|
||||
}
|
||||
|
||||
if (!is_internal) {
|
||||
prim_info = get_current_stage_info();
|
||||
|
Loading…
Reference in New Issue
Block a user