Skip to content

Commit 3abf77d

Browse files
authored
[Fix] fix using multiprocessing when formatting (#679)
1 parent 57ae0c4 commit 3abf77d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ def main():
119119

120120
cfg = compat_cfg(cfg)
121121

122+
if args.format_only and cfg.mp_start_method != 'spawn':
123+
warnings.warn(
124+
'`mp_start_method` in `cfg` is set to `spawn` to use CUDA '
125+
'with multiprocessing when formatting output result.')
126+
cfg.mp_start_method = 'spawn'
127+
122128
# set multi-process settings
123129
setup_multi_processes(cfg)
124130

0 commit comments

Comments
 (0)