Revert to ethernet - IB not accessible in containers

IB attempts are failing because /proc/drivers/infiniband is not
mounted in the container (container runtime security restriction).

Even though RDMA devices are exposed, NCCL needs /proc/drivers/infiniband
for proper IB initialization. This requires container image changes.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-15 12:41:44 +03:00
parent 7620477bb6
commit 971bff62f7

View File

@@ -115,20 +115,17 @@ def run_training_node_func(rank, world_size):
os.environ['WORLD_SIZE'] = str(world_size) os.environ['WORLD_SIZE'] = str(world_size)
os.environ['RANK'] = str(rank) os.environ['RANK'] = str(rank)
# NCCL Configuration - Try IB with RDMA devices # NCCL Configuration - Use ethernet (IB not accessible in containers)
os.environ['NCCL_DEBUG'] = 'INFO' os.environ['NCCL_DEBUG'] = 'INFO'
os.environ['NCCL_TIMEOUT'] = str(NCCL_TIMEOUT) os.environ['NCCL_TIMEOUT'] = str(NCCL_TIMEOUT)
os.environ['NCCL_BLOCKING_WAIT'] = '1' os.environ['NCCL_BLOCKING_WAIT'] = '1'
os.environ['NCCL_IB_DISABLE'] = '0' # Enable IB os.environ['NCCL_SOCKET_IFNAME'] = 'eth0' # Use ethernet (reliable)
# Don't set SOCKET_IFNAME - let NCCL auto-detect os.environ['NCCL_IB_DISABLE'] = '1' # Disable IB - /proc/drivers/infiniband not accessible
os.environ['NCCL_P2P_DISABLE'] = '0' # Enable P2P os.environ['NCCL_P2P_DISABLE'] = '0' # Enable P2P
os.environ['NCCL_IGNORE_CPU_AFFINITY'] = '1' # Better compatibility os.environ['NCCL_IGNORE_CPU_AFFINITY'] = '1' # Better compatibility
os.environ['NCCL_LL_THRESHOLD'] = '0' # Disable LL for compatibility os.environ['NCCL_LL_THRESHOLD'] = '0' # Disable LL for compatibility
os.environ['NCCL_ALGO'] = 'Ring' # Use ring algorithm os.environ['NCCL_ALGO'] = 'Ring' # Use ring algorithm
os.environ['NCCL_PROTO'] = 'Simple' # Use simple protocol os.environ['NCCL_PROTO'] = 'Simple' # Use simple protocol
# These help with IB in containers where /proc/drivers/infiniband isn't available
os.environ['NCCL_IB_HCA'] = '^irdma[0-9]+$|^mlx5_[0-9]+$|^hfi1_[0-9]+$|^qib0$' # Match any IB HCA
os.environ['NCCL_SOCKET_NTHREADS'] = '4' # More threads for better performance
print(f"[{rank}] Environment configured:") print(f"[{rank}] Environment configured:")
print(f" MASTER_ADDR: {MASTER_ADDR}") print(f" MASTER_ADDR: {MASTER_ADDR}")