Repository navigation
SFT, MPNN Stream - #15
Merged
Merged
Conversation
…verwritten
Previously publish_into_repo wrote every round to the same repo weights path
({model_name}.pt), overwriting the last version — so history was lost and the
checkpoint file could not even serve as a completion signal.
Now each round writes {model_name}_v{version}.pt into its own per-version
directory (versioned_checkpoint_path), never overwritten, so the whole history
is kept with the version in the filename. That versioned file is what the
manager publishes, so get_current_model() and any reload off it point at the
exact version.
publish_into_repo is preserved as a *pointer copy*: the wrapper copies the
latest versioned checkpoint onto the repo's fixed {model_name}.pt (repo_pointer_
path) so IMPRESS's next pass still picks it up with no wrapper change — the
pointer is just "current", the versioned files are the archive. The job spec
carries target_weights (versioned) and publish_copy (pointer or null); the
wrapper writes the versioned file atomically, then atomically refreshes the
pointer, then the train_complete marker.
Replaces published_weights_path with versioned_checkpoint_path + repo_pointer_
path. Tests and docs (§4) updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012NhrMrisx8FqTqraTpBbdv
The LLM half now ships both objectives: rome.train.llm.SFTTrainer / SFTConfig alongside the existing GRPO. SFT trains the model to imitate chosen (prompt, completion) pairs — building the training text from the tokenizer's chat template when a record has no preformatted `text` field — and is exported lazily from rome.train like GRPO. examples/agnostic/llm_sft_streams.py is the supervised counterpart to llm_grpo_streams.py and uses all three managers: an inference stream samples candidate math answers, a reward stream grades them with a real math reward (extract the final integer, compare to gold), and the data manager keeps only the correct ones (top_k by score, deduped). The SFT trainer then fine-tunes on those winners and the stream hot-swaps onto the new adapter — the STaR / rejection-sampling loop, where the reward selects the data rather than feeding an RL objective. Tests for SFTConfig/SFTTrainer validate + config building + the chat-template fallback; README and the train/ layout note updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012NhrMrisx8FqTqraTpBbdv
…ions)
The trainer improves ProteinMPNN; this runs it as a ROME-A inference stream, so
a protein workflow can use all three managers (generate → score → train →
hot-swap) the way the LLM examples do. Feed backbone PDBs, get designed
sequences; when the trainer publishes a checkpoint the stream reloads onto it.
examples/impress_r/mpnn_stream.py provides two implementations, both subprocess
(neither reimplements ProteinMPNN sampling — they run the checkout's tested
inference):
- mpnn_run_stream: ROME-native, protein_mpnn_run.py per backbone with
--path_to_model_weights so it uses the exact published versioned checkpoint.
- impress_mpnn_stream: the IMPRESS path via this example's mpnn_wrapper.py;
since that wrapper takes no weights path, each reload refreshes the repo's
fixed {model_name}.pt pointer (the one publish_into_repo maintains).
load_func/process_func are module-level and settings ride as load_kwargs, so
they pickle by reference to a Dragon task process. A request is
{backbone_id, pdb_path, design_chains?, num_seqs?}; each output record is
{backbone_id, sequence, score, sample, model_version, pdb_path}, ready for a
reward stream and add_training_data.
Tests cover the FASTA parser (per-sequence score kept distinct from
global_score), both command builders, the reload hook + repo-pointer refresh,
and the stream builders. Docs (§8) and README updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012NhrMrisx8FqTqraTpBbdv
The three applied commits were written before the ROME-A to ROME rename, so their comments and docs still carried the old name. No behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PMu7bbyPmzeV1vzkiGtDoj
…-v6x4ee Stream flows, sft trainer
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.
Add MPNN stream, SFT trainer