Skip to content

Commit

Permalink
fix wrong exit code in pipeline_manager (#715)
Browse files Browse the repository at this point in the history
* fix exit

* change to general exit errorcode=1
  • Loading branch information
RunningLeon authored Jul 7, 2022
1 parent d57cf85 commit 585e34b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mmdeploy/apis/core/pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def pop_mp_output(self, call_id: int = None) -> Any:
if call_id not in self._mp_dict:
get_root_logger().error(
f'`{self._func_name}` with Call id: {call_id} failed. exit.')
exit()
exit(1)
ret = self._mp_dict[call_id]
self._mp_dict.pop(call_id)
return ret
Expand Down
14 changes: 7 additions & 7 deletions mmdeploy/backend/pplnn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def register_engines(device_id: int,
x86_engine = pplnn.X86EngineFactory.Create(x86_options)
if not x86_engine:
logger.error('Failed to create x86 engine')
sys.exit(-1)
sys.exit(1)

if disable_avx512:
status = x86_engine.Configure(pplnn.X86_CONF_DISABLE_AVX512)
if status != pplcommon.RC_SUCCESS:
logger.error('x86 engine Configure() failed: ' +
pplcommon.GetRetCodeStr(status))
sys.exit(-1)
sys.exit(1)

engines.append(pplnn.Engine(x86_engine))

Expand All @@ -55,15 +55,15 @@ def register_engines(device_id: int,
cuda_engine = pplnn.CudaEngineFactory.Create(cuda_options)
if not cuda_engine:
logger.error('Failed to create cuda engine.')
sys.exit(-1)
sys.exit(1)

if quick_select:
status = cuda_engine.Configure(
pplnn.CUDA_CONF_USE_DEFAULT_ALGORITHMS)
if status != pplcommon.RC_SUCCESS:
logger.error('cuda engine Configure() failed: ' +
pplcommon.GetRetCodeStr(status))
sys.exit(-1)
sys.exit(1)

if input_shapes is not None:
status = cuda_engine.Configure(pplnn.CUDA_CONF_SET_INPUT_DIMS,
Expand All @@ -72,7 +72,7 @@ def register_engines(device_id: int,
logger.error(
'cuda engine Configure(CUDA_CONF_SET_INPUT_DIMS) failed: '
+ pplcommon.GetRetCodeStr(status))
sys.exit(-1)
sys.exit(1)

if export_algo_file is not None:
status = cuda_engine.Configure(pplnn.CUDA_CONF_EXPORT_ALGORITHMS,
Expand All @@ -81,7 +81,7 @@ def register_engines(device_id: int,
logger.error(
'cuda engine Configure(CUDA_CONF_EXPORT_ALGORITHMS) '
'failed: ' + pplcommon.GetRetCodeStr(status))
sys.exit(-1)
sys.exit(1)

if import_algo_file is not None:
status = cuda_engine.Configure(pplnn.CUDA_CONF_IMPORT_ALGORITHMS,
Expand All @@ -90,7 +90,7 @@ def register_engines(device_id: int,
logger.error(
'cuda engine Configure(CUDA_CONF_IMPORT_ALGORITHMS) '
'failed: ' + pplcommon.GetRetCodeStr(status))
sys.exit(-1)
sys.exit(1)

engines.append(pplnn.Engine(cuda_engine))

Expand Down

0 comments on commit 585e34b

Please sign in to comment.