Unified client recipes - #93
Merged
Merged
Conversation
sfc-gh-kganesan
added a commit
that referenced
this pull request
Aug 26, 2026
Rebase of the Cortex shim onto #93, dropping only what #93 already provides rather than dropping capability. Both frameworks keep the end-to-end path that was validated pre-rebase (verl val@10 0.311 / SkyRL 0.308 on GSM8K). The three places Cortex diverges from on-prem now live in CortexTransport, so no integration carries its own copy and #93's recipes are unaffected: - forward-backward is lowered from verl's {batch, meta} to Cortex's {args, kwargs, context}; frames already in Cortex's shape pass through. - forward is zero-filled, because Cortex has no such sub-job. Sound only for single-epoch on-policy GRPO without KL, so the verl adapter refuses the knobs that would read those values before the client is built. - avg_loss / last_lr, which Cortex returns at the top level, are mirrored into `metrics`. step has no `metrics` key at all, which would otherwise KeyError in verl's _send_update_actor. Dropped as genuinely redundant with #93: its cortex.py changes (a strict superset of ours), the shim's fake-async wrapper (AsyncArcticRLClient), its response flattener and its payload reshape. That shrinks _cortex_dispatch from 147 lines to config translation plus the legacy accessors SkyRL reads. Also folds in the remote_urls fix from tire-kicking: pinned SkyRL asserts num_engines == len(remote_urls), so the recipe never ran as documented. Backend imports in create_arctic_rl_client are now lazy, which is what a CPU-only Cortex driver needs and incidentally fixes tests/rl/test_cpu_import.py. Co-authored-by: Cursor <cursoragent@cursor.com>
sfc-gh-mwyatt
marked this pull request as ready for review
August 27, 2026 16:02
sfc-gh-sbekman
requested changes
Aug 27, 2026
sfc-gh-truwase
approved these changes
Aug 27, 2026
sfc-gh-sbekman
approved these changes
Aug 27, 2026
sfc-gh-kganesan
added a commit
that referenced
this pull request
Aug 28, 2026
#93 landed _NOOP_OPS, _INLINE_OPERATION_TYPES and _submitted verbatim from this branch, so the rebase left two identical definitions of each. Python binds the last one, which is why tests still passed -- but the shadowed copies are a trap for the next reader. What remains here is the terminal-state diagnostic: main raises a bare "reached terminal state 'failed'", which is what made the provisioning failures during this integration so slow to diagnose. Attaching the server's reason and the per-sub-job states distinguishes rate limits and allowlist rejections from genuine crashes. Co-authored-by: Cursor <cursoragent@cursor.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.
Ports cortex-client recipes to unified client. Largely a move/refactor, with some fixes to support these recipes properly on cortex backend. Next steps will be support with onprem backend.
recipes/sft/standalone/,recipes/rl/standalone/) fromcortex-clientto the unifiedarctic_platform.client.forward-backward400s on Cortex: restoreforce_chunkin the DSSST1 encoder and send the wire's ownfwd-bwdoperation label in chunk metadata.KeyError: 'request_id'on weight sync: Cortex's/operationsinterface have inconsistent behavior.weight-syncreturns arequest_idto poll, whilereset-prefix-cacheand four other ops answer inline. Dispatch on the response instead of assuming everything is async.sync_weights()stay backend-portable.TrainingConfig.peft, forward it throughto_cortex(), and addweight_formattosync_weights().training.peftandweight_formatagainst on-prem, and HTTP errors now carry the server's response body.Some of the fixes listed above were cherrypicked from #55