Skip to content

Commit

Permalink
[checkpointing] support ipv6 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
d4l3k authored Nov 16, 2024
1 parent aec61c7 commit 936016c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion torchft/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
logger: logging.Logger = logging.getLogger(__name__)


class IPv6HTTPServer(ThreadingHTTPServer):
address_family = socket.AF_INET6
request_queue_size = 1024


class CheckpointServer:
def __init__(self, state_dict) -> None:
self._checkpoint_lock = threading.Lock()
Expand Down Expand Up @@ -53,7 +58,7 @@ def err(self, msg: str) -> None:
self.wfile.write(msg.encode())

server_address = ("", 0)
self._server = ThreadingHTTPServer(server_address, RequestHandler)
self._server = IPv6HTTPServer(server_address, RequestHandler)
logger.info(f"Started CheckpointServer on {self.address()}...")

self._thread = threading.Thread(
Expand Down

0 comments on commit 936016c

Please sign in to comment.