MCPcopy
hub / github.com/z-lab/dflash / _dist_gather

Function _dist_gather

dflash/benchmark.py:162–170  ·  view source on GitHub ↗
(torch_dist, obj: Any, dst: int = 0)

Source from the content-addressed store, hash-verified

160
161
162def _dist_gather(torch_dist, obj: Any, dst: int = 0):
163 if not torch_dist.is_initialized():
164 return [obj]
165 if _dist_is_main():
166 objs = [None for _ in range(_dist_size())]
167 torch_dist.gather_object(obj, objs, dst=dst)
168 return objs
169 torch_dist.gather_object(obj, dst=dst)
170 return None
171
172
173_TRANSFORMERS_SUPPORTED_PATTERN = re.compile(r"qwen3(?!\.5)[\w-]*|llama.*3\.1.*8b.*instruct", re.IGNORECASE)

Callers 1

_run_transformersFunction · 0.85

Calls 2

_dist_is_mainFunction · 0.85
_dist_sizeFunction · 0.85

Tested by

no test coverage detected