NUMA Binding Utilities#
Created On: Jul 25, 2025 | Last Updated On: Aug 12, 2025
- class torch.numa.binding.AffinityMode(value)[source]#
See behavior description for each affinity mode in torch.distributed.run.
- class torch.numa.binding.NumaOptions(affinity_mode: torch.numa.binding.AffinityMode, should_fall_back_if_binding_fails: bool = False)[source]#
- affinity_mode: AffinityMode#
If true, we will fall back to using the original command/entrypoint if we fail to compute or apply NUMA bindings.
You should avoid using this option! It is only intended as a safety mechanism for facilitating mass rollouts of numa binding.
- torch.numa.binding.maybe_get_temporary_python_executable_with_numa_bindings(*, python_executable_path, gpu_index, numa_options)[source]#
- torch.numa.binding.maybe_wrap_command_with_numa_bindings(*, command_args, gpu_index, numa_options)[source]#
- Parameters
- Returns
command_args, but wrapped so that it runs with NUMA bindings corresponding to gpu_index and numa_options. E.g., (“numactl”, “–cpunodebind=0”, “/usr/local/bin/python”, “train.py”)
- Return type