Esempio n. 1
0
 def ShouldRunTest(self, run_params):
     if get_linked_tensorrt_version()[0] < 5:
         return False
     # Only test static engine mode, with or without calibration.
     return (trt_test.IsQuantizationMode(run_params.precision_mode)
             and not run_params.convert_online
             and not run_params.dynamic_engine)
Esempio n. 2
0
 def ShouldRunTest(self, run_params):
     """Whether to run the test."""
     # Disable the test in fp16 mode since multiple matmul and add ops together
     # can cause overflow.
     return ((run_params.precision_mode != "FP16")
             and not (trt_test.IsQuantizationMode(run_params.precision_mode)
                      and not run_params.use_calibration))
 def ShouldRunTest(self, run_params):
     # Only test static engine mode, with or without calibration.
     return (get_linked_tensorrt_version()[0] >= 5
             and trt_test.IsQuantizationMode(run_params.precision_mode)
             and not run_params.convert_online
             and not run_params.dynamic_engine
             ), "test static engine, offline conversion and INT8"
Esempio n. 4
0
 def ShouldRunTest(self, run_params):
   should_run, reason = super().ShouldRunTest(run_params)
   should_run = should_run and \
       not trt_test.IsQuantizationMode(run_params.precision_mode)
   reason += ' and precision != INT8'
   # Only run for TRT 7.1.3 and above.
   return should_run and trt_utils.is_linked_tensorrt_version_greater_equal(
       7, 1, 3), reason + ' and >= TRT 7.1.3'
Esempio n. 5
0
 def ShouldRunTest(self, run_params):
     should_run, reason = super().ShouldRunTest(run_params)
     should_run = should_run and \
         not trt_test.IsQuantizationMode(run_params.precision_mode)
     reason += ' and precision != INT8'
     # Only run for TRT 7.1.3 and above.
     return should_run and trt_test.IsTensorRTVersionGreaterEqual(7, 1, 3), \
         reason + ' and >= TRT 7.1.3'
Esempio n. 6
0
 def ShouldRunTest(self, run_params):
     # There is no CombinedNonMaxSuppression op for GPU at the moment, so
     # calibration will fail.
     # TODO(laigd): fix this.
     # Only run for TRT 5.1 and above.
     return trt_test.IsTensorRTVersionGreaterEqual(
         5, 1) and not trt_test.IsQuantizationMode(
             run_params.precision_mode), 'test >=TRT5.1 and non-INT8'
Esempio n. 7
0
    def ShouldRunTest(self, run_params):
        # There is no CombinedNonMaxSuppression op for GPU at the moment, so
        # calibration will fail.
        # TODO(laigd): fix this.
        if trt_test.IsQuantizationMode(run_params.precision_mode):
            return False

        # Only run for TRT 5.1 and above.
        ver = get_linked_tensorrt_version()
        return ver[0] > 5 or (ver[0] == 5 and ver[1] >= 1)
Esempio n. 8
0
 def ShouldRunTest(self, run_params):
   # TODO(b/162447069): Enable the test for TRT 7.1.3.
   if trt_test.IsTensorRTVersionGreaterEqual(7, 1, 3):
     return (False, 'Skip test due to b/162447069')
   # There is no CombinedNonMaxSuppression op for GPU at the moment, so
   # calibration will fail.
   # TODO(laigd): fix this.
   # Only run for TRT 5.1 and above.
   return trt_test.IsTensorRTVersionGreaterEqual(
       5, 1) and not trt_test.IsQuantizationMode(
           run_params.precision_mode), 'test >=TRT5.1 and non-INT8'
 def ShouldRunTest(self, run_params):
     # Only test FP32/FP16 mode.
     return not trt_test.IsQuantizationMode(
         run_params.precision_mode), "test non-INT8"
Esempio n. 10
0
 def ShouldRunTest(self, run_params):
     """Whether to run the test."""
     return (not trt_test.IsQuantizationMode(run_params.precision_mode)
             and not run_params.dynamic_engine)
Esempio n. 11
0
 def ShouldRunTest(self, run_params):
   # Only test static engine mode, with or without calibration.
   return (trt_test.IsTensorRTVersionGreaterEqual(5) and
           trt_test.IsQuantizationMode(run_params.precision_mode) and
           not run_params.convert_online and not run_params.dynamic_engine
          ), "test static engine, offline conversion and INT8"
Esempio n. 12
0
 def ExpectedEnginesToBuild(self, run_params):
     """Return the expected engines to build."""
     if (run_params.dynamic_engine and
             not trt_test.IsQuantizationMode(run_params.precision_mode)):
         return ["TRTEngineOp_0", "TRTEngineOp_1"]
     return ["TRTEngineOp_1"]
Esempio n. 13
0
 def ShouldRunTest(self, run_params):
     """Whether to run the test."""
     # TODO(aaroey): Trt 4.0 forbids conversion for tensors with rank <3 in int8
     # mode, which is a bug. Re-enable this when trt library is fixed.
     return not trt_test.IsQuantizationMode(run_params.precision_mode)
Esempio n. 14
0
 def ShouldRunTest(self, run_params):
     # TODO(b/162448349): Enable the test for TRT 7.1.3.
     if trt_test.IsTensorRTVersionGreaterEqual(7, 1, 3):
         return (False, "Skip test due to b/162448349")
     return (run_params.dynamic_engine and not trt_test.IsQuantizationMode(
         run_params.precision_mode)), "test dynamic engine and non-INT8"
Esempio n. 15
0
 def ShouldRunTest(self, run_params):
     # Test static/dynamic engine with/without calibration.
     return (trt_test.IsQuantizationMode(run_params.precision_mode)
             and not run_params.convert_online
             ), "test offline conversion and INT8"
Esempio n. 16
0
 def ShouldRunTest(self, run_params):
     return (run_params.dynamic_engine and not trt_test.IsQuantizationMode(
         run_params.precision_mode)), "test dynamic engine and non-INT8"
Esempio n. 17
0
 def ShouldRunTest(self, run_params):
   if trt_convert.get_linked_tensorrt_version()[0] < 5:
     return False
   # Test static/dynamic engine with/without calibration.
   return (trt_test.IsQuantizationMode(run_params.precision_mode) and
           not run_params.use_optimizer)