File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -331,19 +331,14 @@ def __init__(
331331 master_port : int = 29500 ,
332332 device : str = "cuda" ,
333333 ):
334- current_method = mp .get_start_method (allow_none = True )
335- if current_method is None or current_method != "spawn" :
336- try :
337- mp .set_start_method ("spawn" )
338- except RuntimeError as e :
339- raise RuntimeError ("Failed to set start method to spawn:" , e )
340334 super ().__init__ ()
341335 self .config = module .config if isinstance (module , BasePipeline ) else None
342336 self ._module_name = module .__class__ .__name__
343337
344338 self .world_size = cfg_degree * sp_ulysses_degree * sp_ring_degree * tp_degree
345- self .queue_in = mp .Queue ()
346- self .queue_out = mp .Queue ()
339+ spawn_ctx = mp .get_context ("spawn" )
340+ self .queue_in = spawn_ctx .Queue ()
341+ self .queue_out = spawn_ctx .Queue ()
347342 self .ctx = mp .spawn (
348343 _worker_loop ,
349344 args = (
You can’t perform that action at this time.
0 commit comments