Expose native GSPO through Tinker API - #2044
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for the "gspo" loss function across the training backend and API. It updates the input validation schemas, config normalization logic, and adds corresponding unit tests to verify the new functionality. There are no review comments, so I have no feedback to provide.
Signed-off-by: Neil Kale <263453039+kalectory@users.noreply.github.com>
kalectory
force-pushed
the
neil/native-gspo-probe
branch
from
August 14, 2026 23:07
096639f to
a909be6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 096639f. Configure here.
j316chuck
pushed a commit
to j316chuck/SkyRL
that referenced
this pull request
Aug 18, 2026
- Expose SkyRL's existing native GSPO implementation through the Tinker-compatible API. - Accept Tinker-style clipping thresholds and normalize them to SkyRL's epsilon configuration. ## Future Work - This path will fail on Jax, similar to the existing exposed DPPO and PPO_CRITIC paths. We generalize the PPO_CRITIC check to fail loudly on those paths too for now. ## Testing <img width="1870" height="854" alt="image" src="https://github.com/user-attachments/assets/9f0a526d-c0b6-4aaa-911d-4e5502429c1b" /> ``` uv run --extra dev pre-commit run --files skyrl/backends/skyrl_train_backend.py skyrl/tinker/api.py skyrl/tinker/types.py ``` Verified formatting, lint, and secret checks on all changed files. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are API surface and backend routing for a new loss_fn name; JAX fails fast on unsupported losses. No auth or data-path changes; training behavior on SkyRL-Train depends on existing native GSPO implementation. > > **Overview** > Adds **`gspo`** as a Tinker-compatible `loss_fn` on forward/backward, alongside existing PPO-style **`clip_low_threshold`** / **`clip_high_threshold`** config validation in the API layer. > > The SkyRL-Train backend now treats **`gspo`** like **`ppo`** for threshold normalization (Tinker ratios → SkyRL epsilon fields) but maps the internal loss name to **`gspo`** instead of **`regular`**. > > On JAX, unsupported losses are rejected with a single check against **`LOSS_TYPES`** (so **`gspo`**, **`dppo`**, and **`ppo_critic`** fail loudly). Tests cover that behavior via **`JaxBackendImpl._model_pass`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit efb4101. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Signed-off-by: Neil Kale <263453039+kalectory@users.noreply.github.com> Co-authored-by: Neil Kale <263453039+kalectory@users.noreply.github.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.

Future Work
Testing
Verified formatting, lint, and secret checks on all changed files.
Note
Low Risk
Changes are API surface and backend routing for a new loss_fn name; JAX fails fast on unsupported losses. No auth or data-path changes; training behavior on SkyRL-Train depends on existing native GSPO implementation.
Overview
Adds
gspoas a Tinker-compatibleloss_fnon forward/backward, alongside existing PPO-styleclip_low_threshold/clip_high_thresholdconfig validation in the API layer.The SkyRL-Train backend now treats
gspolikeppofor threshold normalization (Tinker ratios → SkyRL epsilon fields) but maps the internal loss name togspoinstead ofregular.On JAX, unsupported losses are rejected with a single check against
LOSS_TYPES(sogspo,dppo, andppo_criticfail loudly). Tests cover that behavior viaJaxBackendImpl._model_pass.Reviewed by Cursor Bugbot for commit efb4101. Bugbot is set up for automated code reviews on this repo. Configure here.