MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / _print_numa_info

Function _print_numa_info

benchmarking/nsys_wrapper.py:79–88  ·  view source on GitHub ↗

Print NUMA/CPU topology before nsys captures stdout.

(rank: str)

Source from the content-addressed store, hash-verified

77
78
79def _print_numa_info(rank: str) -> None:
80 """Print NUMA/CPU topology before nsys captures stdout."""
81 cpus = sorted(os.sched_getaffinity(0))
82 print(f"[rank {rank}] CPUs (after bind): {cpus}", flush=True)
83 if rank == "0":
84 try:
85 topo = subprocess.check_output(["nvidia-smi", "topo", "-m"], text=True).strip()
86 print(f"GPU topology:\n{topo}", flush=True)
87 except (FileNotFoundError, subprocess.CalledProcessError) as e:
88 print(f"[rank {rank}] Failed to get GPU topology: {e}", flush=True)
89
90
91def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected