Skip to content

test(gspo): document current surrogate ratio semantics - #441

Open
yaoyao12345666 wants to merge 1 commit into
inclusionAI:mainfrom
yaoyao12345666:test/gspo-surrogate-ratio-semantics
Open

test(gspo): document current surrogate ratio semantics#441
yaoyao12345666 wants to merge 1 commit into
inclusionAI:mainfrom
yaoyao12345666:test/gspo-surrogate-ratio-semantics

Conversation

@yaoyao12345666

Copy link
Copy Markdown

What does this PR do?

Adds focused CPU tests that document the current GSPO surrogate semantics:

  • sequence-level ratio statistics remain unit-valued when rollout logprobs differ;
  • rollout-vs-train token drift remains visible through dedicated metrics; and
  • the unit-valued sequence surrogate retains length-normalized policy gradients.

This changes tests only, not the GSPO implementation.

Related issue

Fixes #67

Type of change

  • Test coverage improvement

How was it tested?

  • python -m pytest tests/test_losses_rewards_cpu.py -q (13 passed)
  • ruff check tests/test_losses_rewards_cpu.py --no-cache
  • ruff format --check tests/test_losses_rewards_cpu.py --no-cache

Checklist

  • The PR title summarizes the contribution.
  • Linked the related issue in the description.
  • New coverage tests the documented sequence-level semantics.
  • No public API, CLI, or algorithm behavior changes.

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.

Document current GSPO surrogate ratio semantics

1 participant