Repository navigation
Conversation
yafshar
force-pushed
the
fix/nfs-marker-revalidate
branch
from
October 14, 2026 13:18
0129526 to
d646abb
Compare
On a shared NFS mount, a cached negative lookup hid a marker created by the other host for the 30 s attribute timeout, so each weight sync took ~31 s instead of ~1 s. Open the step dir and its parent before each check to force close-to-open revalidation. Measured across two hosts (NFSv3, default options): plain polling 28-30 s in both handshake directions, opendir under 1 s. Signed-off-by: Yaser Afshar <yaser.afshar@intel.com> Co-authored-by: Yaser Afshar <yaser.afshar@intel.com>
yafshar
force-pushed
the
fix/nfs-marker-revalidate
branch
from
October 20, 2026 19:56
d646abb to
ce72025
Compare
yafshar
marked this pull request as ready for review
November 3, 2026 18:36
Contributor
Author
|
Ready for review. When the trainer and the consumer share the output dir over NFS, each handshake marker could take ~30 s to become visible, because the NFS client caches "not found" answers. This revalidates the directory before each check, which cuts the wait from ~29 s to ~0.6 s; the measurements are in the description. The utils/pathing.py waits are left out of scope, as noted. @biswapanda could you review? @samsja @faresobeid for approval. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the trainer and the weight consumer (orchestrator or evals process) run on different hosts and share the output dir over NFS, a weight-broadcast handshake marker can take ~30 s to become visible to the side waiting for it.
The NFS client caches negative lookups. If the waiter's
Path.exists()runs just before the other host creates the marker, the client keeps answering "not found" from its cache until the parent directory's cached attributes expire (acdirmin, 30 s by default). Every broadcast has two cross-host waits: the consumer waits for.sender_ready, and the trainer waits for.receiver_ready. In one split deployment, the weights moved in under 1 s, but every broadcast took ~31 s, about a third of the step time.Fix
marker_existsintransports/weights/base.pyopens the marker's step dir, and the broadcast dir above it, before callingmarker.exists(). Opening a directory makes the NFS client revalidate it (close-to-open consistency), so a stale "not found" is dropped once the directory has changed. The broadcast dir is opened too because the step dir may not exist yet when the consumer starts polling, since the trainer recreates it for every broadcast.It replaces the bare
.exists()in_wait_for_receiver_ready,is_publishedandwait_published. The added cost is up to two directory opens per marker check.Measured
The setup was two hosts sharing an NFSv3 mount with default options. One host creates a marker after a random 0.2–2 s delay, and the other polls for it at 0.1 s, as the handshake does. Each leg is timed on the creating host's monotonic clock, which stops when the poller reports the marker back over TCP, so clock skew doesn't affect the numbers. Every trial uses a fresh step dir. The trials cover both directions and both layouts: the waiter created the step dir (as for
.receiver_ready), or the creator made the dir and the marker together (as for.sender_ready).marker.exists()marker_exists(marker)Plain polling stalled in every direction and layout, each time until ~30 s after the first poll.
Scope
This PR covers the handshake markers only.
wait_for_pathandsync_wait_for_pathinutils/pathing.py, which serve the filesystem weight transport's.finishedwait and the filesystem batch transport, still use a bare.exists(). They have the same exposure across hosts on NFS. Deployments that can remount have another option: thelookupcache=positivemount option disables negative lookup caching.