Skip to content

Commit

Permalink
[Drivers] Suppress OSError (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjjq committed Jun 13, 2023
1 parent 09463e8 commit cdd75ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/hidet/drivers/build_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def build_job(args):
if num_workers > 1 and len(jobs) > 1:
# Set the affinity of current process. Some package such as numpy will change affinity of current process,
# which might limit the parallelism of compilation.
os.sched_setaffinity(0, range(cpu_count))
from contextlib import suppress

with suppress(OSError):
os.sched_setaffinity(0, range(cpu_count))

lazy_initialize_cuda()

Expand Down

0 comments on commit cdd75ec

Please sign in to comment.