Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion miles/ray/rollout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import itertools
import logging
import multiprocessing
import os
import random
import time
from pathlib import Path
Expand Down Expand Up @@ -547,7 +548,10 @@ def _allocate_rollout_engine_addr_and_ports_normal(*, args, num_engines, rollout
def get_addr_and_ports(engine):
# use small ports to prevent ephemeral port between 32768 and 65536.
# also, ray uses port 10002-19999, thus we avoid near-10002 to avoid racing condition
start_port = 15000
# MILES_ROLLOUT_START_PORT: shift the range so concurrent miles runs
# on one host don't collide (the free-port probe can miss servers
# bound to a specific interface).
start_port = int(os.environ.get("MILES_ROLLOUT_START_PORT", "15000"))

def port(consecutive=1):
nonlocal start_port
Expand Down
Loading