Add segmentation test of code generation for ARM/FPGA
Add segmentation test of code generation for ARM/FPGA
@@ -134,6 +134,12 @@ def dict_codegen_segmentation_x86() -> dict:
}
+def dict_codegen_segmentation_fpga() -> dict:
+ """Test parameters for testing code generation for segmentation on FPGA"""
+ return updated_dict(dict_codegen_segmentation_x86(),
+ {'cpu_name':'arm_fpga', 'prefix': 'fpga_seg', 'hard_quantize': True, 'need_arm_compiler': True})
+
+
def get_configurations():
configurations = [
# Classification / x86
@@ -240,6 +246,15 @@ def get_configurations():
updated_dict(dict_codegen_object_detection_fpga(),
{'cache_dma': True, 'threshold_skipping': True}),
+ # Segmentation on FPGA
+ dict_codegen_segmentation_fpga(),
+ updated_dict(dict_codegen_segmentation_fpga(),
+ {'cache_dma': True, 'threshold_skipping': False}),
+ updated_dict(dict_codegen_segmentation_fpga(),
+ {'cache_dma': False, 'threshold_skipping': True}),
+ updated_dict(dict_codegen_segmentation_fpga(),
+ {'cache_dma': True, 'threshold_skipping': True}),
+
# Classification ARM
updated_dict(dict_codegen_classification_fpga(),
{'cpu_name': 'arm', 'prefix': 'arm_cls', 'hard_quantize': False,
@@ -277,6 +292,18 @@ def get_configurations():
{'cpu_name':'arm', 'prefix': 'arm_det', 'hard_quantize': False, 'threshold_skipping': True}),
updated_dict(dict_codegen_object_detection_fpga(),
{'cpu_name':'arm', 'prefix': 'arm_det', 'hard_quantize': True, 'threshold_skipping': True}),
+
+ # Segmentation ARM
+ updated_dict(dict_codegen_segmentation_fpga(),
+ {'cpu_name':'arm', 'prefix': 'arm_seg', 'hard_quantize': True, 'threshold_skipping': False}),
+ updated_dict(dict_codegen_segmentation_fpga(),
+ {'cpu_name':'arm', 'prefix': 'arm_seg', 'hard_quantize': True, 'threshold_skipping': True}),
+ # FIXME: Cannot run library with hard_quantize=False for segmentation task.
+ # Issue link: https://github.com/blue-oil/blueoil/issues/512
+ # updated_dict(dict_codegen_segmentation_fpga(),
+ # {'cpu_name':'arm', 'prefix': 'arm_seg', 'hard_quantize': False, 'threshold_skipping': False}),
+ # updated_dict(dict_codegen_segmentation_fpga(),
+ # {'cpu_name':'arm', 'prefix': 'arm_seg', 'hard_quantize': False, 'threshold_skipping': True}),
]
return [(i, configuration) for i, configuration in enumerate(configurations)]
@@ -288,6 +315,7 @@ class TestCodeGeneration(TestCaseDLKBase):
@params(*get_configurations())
def test_all_configuration(self, i, configuration) -> None:
+ print(f"\nCode generation test: ID: {i}, Testcase: {configuration}")
# TODO consider better implementation
this_test_level = configuration.get("test_level", 0)
if this_test_level < CURRENT_TEST_LEVEL:
