Skip to content

Commit

Permalink
make isolation process failure more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Nov 27, 2023
1 parent 23801a1 commit bf5626d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optimum_benchmark/backends/isolation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def check_cuda_continuous_isolation(isolated_pid: int, isolation_check_interval:
f"Continuously checking only process(es) {permitted_pids} are running on device(s) {isolated_devices}"
)
else:
return
exit(0)

while True:
try:
Expand All @@ -169,8 +169,9 @@ def check_cuda_continuous_isolation(isolated_pid: int, isolation_check_interval:
except RuntimeError as e:
LOGGER.error("Error while checking CUDA isolation:")
LOGGER.error(e)
LOGGER.error("Killing isolated process...")

for isolated_pid in all_isolated_pids:
LOGGER.error(f"Killing isolated process {isolated_pid}...")
os.kill(isolated_pid, signal.SIGTERM)
LOGGER.error("Exiting isolation process...")
raise e

0 comments on commit bf5626d

Please sign in to comment.