Repository navigation
HF export staging is private to each island process; tests keep out of ~/yeto-output - #929
Open
michaellchung wants to merge 1 commit into
Open
michaellchung wants to merge 1 commit into
michaellchung wants to merge 1 commit into
Conversation
…f ~/yeto-output The verl and Miles island exports staged in one fixed directory under the system temp dir (yeto-hf-export/round-<r>). Two island processes on one host exporting the same round shared it: one export's cleanup ran inside the other's write, and an island's store could get the other island's weights. Each process now stages in its own mkdtemp directory; each Megatron island driver names its own staging directory for its ranks. Tests: the launcher-built syncer commands get a tmp_path --dispense-log, the island entry parse writes its event tape under tmp_path, and the home guard also refuses in-process writes to the real ~/yeto-output and local child processes whose command line names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Product bug: the HF exports of the verl and Miles islands staged in one fixed directory
under the system temp dir,
<tmp>/yeto-hf-export/round-<r>. Two island processes on onehost that export the same round at the same time shared it. One export's cleanup
(
rmtreeof a torn earlier attempt, and of the staging copy after the upload) raninside the other's write. The second export then failed, or an island's store received
the other island's weights.
This is how
tests/test_verl_miles_parity.py::test_one_file_when_the_model_fits_and_the_round_lands_in_the_storefailed in a full run with four shards: another test process on the same host exported
round 6 into the same directory.
When it happens
/tmp) whose export roundscoincide (
--rl-export-hf-rounds, for examplefinal).Fix
yeto.rl.engine.hf_export.private_staging(): each island process stages in a newtempfile.mkdtemp(prefix="yeto-hf-export-")directory. Only that process writes orremoves anything in it. The export flow is unchanged: write, take the marker, upload,
delete the staging copy, or keep it after a failed upload (
staging_kept).adapters/verl/hf_export.hf_round_exports) and Miles(
adapters/miles/entry.hf_exports_for) use it. Miles' one-node path, where everyrank writes its share, gets the directory passed to the ranks as before.
megatron_ports): every trainer rank must name the same directory,so the island driver (
MegatronHfExports) picks one name per driver,yeto-verl-hf-export-<random>, and passes it to the ranks in the export config.Before this change the name was the same for every island on the host.
Impact
final.jsonand tapefields. Only the local staging path changes, which shows in
staging_keptafter afailed upload.
examples/k31run confignor the customer kit enables
--rl-export-hf-rounds, and the customer gate below isidentical to main. With exports enabled, a single island writes the same store
content as on main.
Tests keep out of the real ~/yeto-output
The launcher's syncer command writes
--dispense-log ~/yeto-output/task-dispense.jsonl.Nine test files replace the checkpoint and tape paths of that command but not this one,
so every session appended to the developer's real
~/yeto-output/task-dispense.jsonl(over 100 MB on one host). The island entry parse in
test_prod_defaults_argvalsowrote
~/yeto-output/rl-island-<k>.jsonl.test_modal_two_islands_with_syncer_rebuild_tapes_and_fail_closedreached the launcher's teardown, which copies the dispenser log of a syncer on this
machine. It read the developer's
~/yeto-output/task-dispense.jsonland wrote~/yeto-output/dispense-check.json.--dispense-logattmp_path.test_prod_defaults_argvwrites its event tape undertmp_path.HOME.tests/yeto_home_guard.py, which already guards the real~/.yeto, now also guards~/yeto-output:names the real
~/yeto-output: its absolute path, or~/,$HOME/or${HOME}/while the child's
HOMEis the real one.node:~/yeto-output/..., ansshorrsyncargument) and a child given its own
HOME.~/.yeto.Verification
test_two_islands_on_one_host_export_the_same_round_at_the_same_time: both exportsmeet inside their first parameter export (a barrier), so they write the same round at
the same time. On main it fails on every run: an island's store gets the other
island's tensors, or an export fails. With this change it passes.
The flaky test: on main, with another process's export of the same round started
between its cleanup and its write (local-only injection), it failed 20/20. With this
change it stages under its own temp dir and passes.
Mutations (each applied alone):
private_stagingreturning a fixed name~/yeto-outputssh/rsyncargumentsHOME--dispense-logreplacementAll are caught.
With the guard on, 192 test files ran: every file that starts a launcher-built
syncer, uses the dispenser evidence or an event tape, or names
yeto-output. Theguard found the teardown test above, now fixed; after the fix the real
~/yeto-outputgets no write from them. 4131 passed. The one failure,test_rl_full_parameter_async::test_real_fixed_roster_quorum_timeout_keeps_the_pushes_and_the_attempt,is a known flaky test that does not touch this change; it has its own fix in the
flaky-test batch. CI runs the guard over the full suite.
Customer gate: the 52 goldens pass, and the
examples/k31dry-runs (run up --dry-runof both run configs with their preflight logs, and the pool
--dry-run) are identicalline by line to origin/main after normalization.
The existing
~/yeto-output/task-dispense.jsonlon a developer host is left as it is.🤖 Generated with Claude Code