Skip to content

Commit 23d2f23

Browse files
committed
Fix prefetch-dataset hang on GPU
1 parent 17ac9ae commit 23d2f23

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sklbench/runner/implementation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import argparse
1919
import json
20-
from multiprocessing import Pool
20+
from multiprocessing import get_context
2121
from typing import Dict, List, Tuple, Union
2222

2323
from psutil import cpu_count
@@ -102,7 +102,7 @@ def run_benchmarks(args: argparse.Namespace) -> int:
102102
logger.debug(f"Unique dataset names to load:\n{list(dataset_cases.keys())}")
103103
n_proc = min([16, cpu_count(), n_datasets])
104104
logger.info(f"Prefetching {n_datasets} datasets with {n_proc} processes")
105-
with Pool(n_proc) as pool:
105+
with get_context("spawn").Pool(n_proc) as pool:
106106
pool.map(load_data_with_cleanup, dataset_cases.values())
107107

108108
# run bench_cases

0 commit comments

Comments
 (0)