Skip to content

Expose native GSPO through Tinker API - #2044

Merged
erictang000 merged 2 commits into
NovaSky-AI:mainfrom
kalectory:neil/native-gspo-probe
Aug 17, 2026
Merged

Expose native GSPO through Tinker API#2044
erictang000 merged 2 commits into
NovaSky-AI:mainfrom
kalectory:neil/native-gspo-probe

Conversation

@kalectory

@kalectory kalectory commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
  • 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

image
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.


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.

Reviewed by Cursor Bugbot for commit efb4101. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
kalectory force-pushed the neil/native-gspo-probe branch from 096639f to a909be6 Compare August 14, 2026 23:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 096639f. Configure here.

Comment thread skyrl/tinker/types.py

@erictang000 erictang000 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, ty!

@erictang000
erictang000 merged commit 22b668f into NovaSky-AI:main Aug 17, 2026
5 of 7 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants