MCPcopy Create free account
hub / github.com/MuLabPKU/TransArch / sync_gpus

Function sync_gpus

TransMLA_NeurIPS_2025/transmla/utils.py:185–188  ·  view source on GitHub ↗

Sync all GPUs to make sure all operations are finished, needed for correct benchmarking of latency/throughput.

()

Source from the content-addressed store, hash-verified

183 return loader
184
185def sync_gpus() -> None:
186 """Sync all GPUs to make sure all operations are finished, needed for correct benchmarking of latency/throughput."""
187 for i in range(torch.cuda.device_count()):
188 torch.cuda.synchronize(device=i)
189
190def map_tensors(obj, device: torch.device | str | None = None, dtype: torch.dtype | None = None):
191 """Recursively map tensors to device and dtype."""

Callers 1

evaluate_pplFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected