8181import setproctitle
8282import torch
8383import torch .types
84- import yaml
84+ import yaml # type: ignore[import-untyped]
8585import zmq
8686import zmq .asyncio
8787from packaging import version
@@ -486,7 +486,10 @@ async def merge_async_iterators(
486486
487487 loop = asyncio .get_running_loop ()
488488
489- awaits = {loop .create_task (anext (it )): (i , it ) for i , it in enumerate (iterators )}
489+ awaits : dict [asyncio .Task [T ], tuple [int , AsyncGenerator [T , None ]]] = {
490+ loop .create_task (anext (it )): (i , it ) # type: ignore[arg-type]
491+ for i , it in enumerate (iterators )
492+ }
490493 try :
491494 while awaits :
492495 done , _ = await asyncio .wait (awaits .keys (), return_when = FIRST_COMPLETED )
@@ -495,7 +498,7 @@ async def merge_async_iterators(
495498 try :
496499 item = await d
497500 i , it = pair
498- awaits [loop .create_task (anext (it ))] = pair
501+ awaits [loop .create_task (anext (it ))] = pair # type: ignore[arg-type]
499502 yield i , item
500503 except StopAsyncIteration :
501504 pass
@@ -1163,11 +1166,13 @@ def find_nccl_include_paths() -> list[str] | None:
11631166 import importlib .util
11641167
11651168 spec = importlib .util .find_spec ("nvidia.nccl" )
1166- if spec and getattr (spec , "submodule_search_locations" , None ):
1167- for loc in spec .submodule_search_locations :
1168- inc_dir = os .path .join (loc , "include" )
1169- if os .path .exists (os .path .join (inc_dir , "nccl.h" )):
1170- paths .append (inc_dir )
1169+ if spec :
1170+ locations = getattr (spec , "submodule_search_locations" , None )
1171+ if locations :
1172+ for loc in locations :
1173+ inc_dir = os .path .join (loc , "include" )
1174+ if os .path .exists (os .path .join (inc_dir , "nccl.h" )):
1175+ paths .append (inc_dir )
11711176 except Exception :
11721177 pass
11731178
0 commit comments