Skip to content

IPv6-safe store address parsing (3 line change)#335

Closed
BenCowen wants to merge 2 commits into
meta-pytorch:mainfrom
modal-projects:ipv6-store-parse
Closed

IPv6-safe store address parsing (3 line change)#335
BenCowen wants to merge 2 commits into
meta-pytorch:mainfrom
modal-projects:ipv6-store-parse

Conversation

@BenCowen

@BenCowen BenCowen commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Motivation

Add support for IPv6 fabric.

Summary

create_store_client parses the rendezvous store address with partition(":"), taking everything after the first colon as the port. That's the correct assumption for host:port / IPv4, but it doesn't apply to an IPv6 address, for example on a flat-IPv6 fabric where containers address each other directly by IPv6:

store_addr = "fdaa:5137:3ebf:a75:...:29521/torchft/<quorum>/<rank>"
host, _, rest = store_addr.partition(":")     # host = "fdaa"  (!)
port, _, prefix = rest.partition("/")          # port = "5137:3ebf:...:29521"
TCPStore(host_name="fdaa", port=int(port))     # ValueError: invalid literal for int()

Fix

Split off the /prefix first, then take the port as the field after the last colon, and strip optional brackets from the host. Correct for IPv4, and for bare or bracketed IPv6 ([host]:port). One function, no signature change.

Testing

Verified end-to-end on a flat-IPv6 fabric (Modal i6pn), single-process replica groups across separate containers:

  • Lighthouse quorum + cross-replica allreduce (Gloo on CPU, and NCCL on GPU).
  • DiLoCo training to convergence.
  • Fault recovery: a killed replica's replacement heals its checkpoint from a peer over IPv6 (HTTPTransport) and rejoins.

Existing host:port / IPv4 behavior is unchanged.

@meta-cla

meta-cla Bot commented Jul 1, 2026

Copy link
Copy Markdown

Hi @BenCowen!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@BenCowen
BenCowen marked this pull request as ready for review July 15, 2026 20:12
@meta-cla

meta-cla Bot commented Jul 15, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 15, 2026
@BenCowen

Copy link
Copy Markdown
Contributor Author

Friendly ping @d4l3k @tushar00jain : 3-line, self-contained IPv6 parse fix, plus a unit test.

@BenCowen BenCowen changed the title IPv6-safe store address parsing in create_store_client IPv6-safe store address parsing (3 line change) Jul 15, 2026

@d4l3k d4l3k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@meta-codesync

meta-codesync Bot commented Jul 15, 2026

Copy link
Copy Markdown

@d4l3k has imported this pull request. If you are a Meta employee, you can view this in D112226662. (Because this pull request was imported automatically, there will not be any future comments.)

@d4l3k

d4l3k commented Jul 16, 2026

Copy link
Copy Markdown
Member

@BenCowen can you rebase on main and fix the lint issues? trunk is green now

I tried to fix it but I don't have permissions to your branch

BenCowen added 2 commits July 16, 2026 02:08
create_store_client split the rendezvous store address on the first colon and
treated the remainder as the port, which mangles a bracket-less IPv6 address
(e.g. on a flat-IPv6 fabric like Modal i6pn). Take the port as the field after
the last colon instead; strip optional brackets from the host. Correct for
IPv4 and for bare or bracketed IPv6.
@BenCowen

Copy link
Copy Markdown
Contributor Author

Thanks @d4l3k, all set!

@meta-codesync meta-codesync Bot closed this in 90d7f68 Jul 16, 2026
@meta-codesync meta-codesync Bot added the Merged label Jul 16, 2026
@meta-codesync

meta-codesync Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request has been merged in 90d7f68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants