Skip to content

Commit

Permalink
Fix float return when limited by memory (#389)
Browse files Browse the repository at this point in the history
Cast return value of `get_parallel_num_workers` to float. Fix #388
  • Loading branch information
maxyanghu authored and vadiklyutiy committed Dec 20, 2024
1 parent b61d6b1 commit 03e5966
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/hidet/utils/multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_parallel_num_workers(max_num_workers: Optional[int] = None, mem_for_work
limit_by_memory = psutil.virtual_memory().available // mem_for_worker
limit_by_memory = max(limit_by_memory, 1)
num_workers = min(num_workers, limit_by_memory)
return num_workers
return int(num_workers)


def parallel_imap(
Expand Down

0 comments on commit 03e5966

Please sign in to comment.