aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-12-02 11:58:19 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2019-12-06 14:54:19 +0000
commitf4261adf78bdb9f8b2d6f2970636125096c173cb (patch)
treea2cf7abd84787720bdc286f09422336691d6fa95 /examples
parent6f58b37a18cfade5dbec38638926f7bd368756d9 (diff)
downloadComputeLibrary-f4261adf78bdb9f8b2d6f2970636125096c173cb.tar.gz
COMPMID-2779: Add support for generating synthetic int8 graphs.
Adds SyntheticDataTypeMutator, which is responsible for mutating graphs to int8 and thus enable performance analysis on a wider range of models. Change-Id: I9a00f0ae59421ab11952660f5115b5dcd9314aaf Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-on: https://review.mlplatform.org/c/2418 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/graph_inception_v3.cpp12
-rw-r--r--examples/graph_inception_v4.cpp12
-rw-r--r--examples/graph_resnet50.cpp12
-rw-r--r--examples/graph_resnet_v2_50.cpp12
-rw-r--r--examples/graph_squeezenet.cpp12
-rw-r--r--examples/graph_squeezenet_v1_1.cpp12
-rw-r--r--examples/graph_srcnn955.cpp12
-rw-r--r--examples/graph_vgg16.cpp12
-rw-r--r--examples/graph_vgg19.cpp12
-rw-r--r--examples/graph_vgg_vdsr.cpp9
10 files changed, 50 insertions, 67 deletions
diff --git a/examples/graph_inception_v3.cpp b/examples/graph_inception_v3.cpp
index 1de6a5fad7..d49561ae38 100644
--- a/examples/graph_inception_v3.cpp
+++ b/examples/graph_inception_v3.cpp
@@ -55,9 +55,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -199,10 +196,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_inception_v4.cpp b/examples/graph_inception_v4.cpp
index bac85eef15..a322b2268d 100644
--- a/examples/graph_inception_v4.cpp
+++ b/examples/graph_inception_v4.cpp
@@ -55,9 +55,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -150,10 +147,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
// Load the precompiled kernels from a file into the kernel library, in this way the next time they are needed
// compilation won't be required.
diff --git a/examples/graph_resnet50.cpp b/examples/graph_resnet50.cpp
index 17506dcf71..84355131d0 100644
--- a/examples/graph_resnet50.cpp
+++ b/examples/graph_resnet50.cpp
@@ -55,9 +55,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -113,10 +110,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_resnet_v2_50.cpp b/examples/graph_resnet_v2_50.cpp
index 785ae9c27a..e2325151bc 100644
--- a/examples/graph_resnet_v2_50.cpp
+++ b/examples/graph_resnet_v2_50.cpp
@@ -55,9 +55,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -116,10 +113,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_squeezenet.cpp b/examples/graph_squeezenet.cpp
index 9721775495..234def150d 100644
--- a/examples/graph_squeezenet.cpp
+++ b/examples/graph_squeezenet.cpp
@@ -55,9 +55,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -166,10 +163,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_squeezenet_v1_1.cpp b/examples/graph_squeezenet_v1_1.cpp
index 0fd52b9e19..b43c8ffdad 100644
--- a/examples/graph_squeezenet_v1_1.cpp
+++ b/examples/graph_squeezenet_v1_1.cpp
@@ -55,9 +55,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -166,10 +163,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_srcnn955.cpp b/examples/graph_srcnn955.cpp
index b69305889b..29faf72ac2 100644
--- a/examples/graph_srcnn955.cpp
+++ b/examples/graph_srcnn955.cpp
@@ -75,9 +75,6 @@ public:
std::cout << "Image width: " << image_width << std::endl;
std::cout << "Image height: " << image_height << std::endl;
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Get trainable parameters data path
const std::string data_path = common_params.data_path;
const std::string model_path = "/cnn_data/srcnn955_model/";
@@ -120,10 +117,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_vgg16.cpp b/examples/graph_vgg16.cpp
index d58bf6cbf5..2c7f614f64 100644
--- a/examples/graph_vgg16.cpp
+++ b/examples/graph_vgg16.cpp
@@ -65,9 +65,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -224,10 +221,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_vgg19.cpp b/examples/graph_vgg19.cpp
index 82895bb516..e3733d859c 100644
--- a/examples/graph_vgg19.cpp
+++ b/examples/graph_vgg19.cpp
@@ -64,9 +64,6 @@ public:
return false;
}
- // Checks
- ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
-
// Print parameter values
std::cout << common_params << std::endl;
@@ -235,10 +232,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);
diff --git a/examples/graph_vgg_vdsr.cpp b/examples/graph_vgg_vdsr.cpp
index f82ae4c20e..870d3cb391 100644
--- a/examples/graph_vgg_vdsr.cpp
+++ b/examples/graph_vgg_vdsr.cpp
@@ -138,10 +138,11 @@ public:
// Finalize graph
GraphConfig config;
- config.num_threads = common_params.threads;
- config.use_tuner = common_params.enable_tuner;
- config.tuner_mode = common_params.tuner_mode;
- config.tuner_file = common_params.tuner_file;
+ config.num_threads = common_params.threads;
+ config.use_tuner = common_params.enable_tuner;
+ config.tuner_mode = common_params.tuner_mode;
+ config.tuner_file = common_params.tuner_file;
+ config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
graph.finalize(common_params.target, config);