Skip to content

feat: CISPO implementation#2187

Open
slikhite-1 wants to merge 7 commits into
mainfrom
slikhite/cispo
Open

feat: CISPO implementation#2187
slikhite-1 wants to merge 7 commits into
mainfrom
slikhite/cispo

Conversation

@slikhite-1
Copy link
Copy Markdown
Contributor

What does this PR do ?

This PR implements CISPO (Clipped Importance Sampling Policy Optimization) Algorithm from Minimax M1 paper.

Add a one line overview of what this PR aims to accomplish.

Issues

List issues that this PR closes (syntax):

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

Signed-off-by: slikhite-1 <slikhite@nvidia.com>
Signed-off-by: slikhite-1 <slikhite@nvidia.com>
Signed-off-by: slikhite-1 <slikhite@nvidia.com>
Signed-off-by: slikhite-1 <slikhite@nvidia.com>
Signed-off-by: slikhite-1 <slikhite@nvidia.com>
Signed-off-by: slikhite-1 <slikhite@nvidia.com>
@slikhite-1 slikhite-1 requested review from a team as code owners April 1, 2026 23:30
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 1, 2026

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@slikhite-1 slikhite-1 changed the title CISPO implementation feat: CISPO implementation Apr 1, 2026
@slikhite-1 slikhite-1 requested a review from terrykong April 3, 2026 00:51
Copy link
Copy Markdown
Collaborator

@terrykong terrykong left a comment

Choose a reason for hiding this comment

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

thanks @slikhite-1

@@ -0,0 +1,25 @@
defaults: "grpo_math_1B.yaml"
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.

The filename says 8B but this inherits from grpo_math_1B.yaml which sets model_name: "Qwen/Qwen2.5-1.5B", and there's no model override here.

Can you provide async lag-1 results with and without this change? That would help validate correctness.

For the nightly test, please rename this config to match the actual model (Qwen 1.5B) and add:

  1. Recipe YAML at examples/configs/recipes/llm/cispo-qwen2.5-math-1.5b-instruct-<nodes>n<gpus>g-<strategy>.yaml — set defaults: ../../grpo_math_1B.yaml, enable use_cispo under loss_fn:, and add model/cluster overrides. See examples/configs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-1n8g-fsdp2tp1.v3.yaml for the pattern.

  2. Driver script at tests/test_suites/llm/cispo-qwen2.5-math-1.5b-instruct-<nodes>n<gpus>g-<strategy>.sh — source common.env, call uv run examples/run_grpo.py --config $CONFIG_PATH ..., dump TB logs, and run check_metrics.py. See tests/test_suites/llm/grpo-qwen2.5-math-1.5b-instruct-1n8g-fsdp2tp1.v3.sh for the pattern.

  3. Add to nightly list — append the driver script path to tests/test_suites/nightly.txt.

if self.use_cispo:
assert not self.disable_ppo_ratio, (
"use_cispo is incompatible with disable_ppo_ratio; "
)
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.

Add an assertion here to guard against ratio_clip_c being set with CISPO — the dual-clipping block below will silently corrupt the CISPO loss if both are enabled.

self.use_cispo = cfg.get("use_cispo", False)
if self.use_cispo:
assert not self.disable_ppo_ratio, (
"use_cispo is incompatible with disable_ppo_ratio; "
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.

Suggested change
"use_cispo is incompatible with disable_ppo_ratio; "
"use_cispo is incompatible with disable_ppo_ratio; CISPO needs the pi_theta/pi_theta_old ratio but disable_ppo_ratio removes it"

assert self.loss_type == LossType.SEQUENCE_LEVEL, (
"sequence-level importance sampling (e.g. GSPO) is mutually exclusive with token-level loss"
)
self.use_cispo = cfg.get("use_cispo", False)
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.

Should be cfg["use_cispo"] — no hidden default. Also, please add use_cispo: false to examples/configs/grpo_math_1B.yaml under loss_fn: alongside the other boolean flags.

@pengdurice
Copy link
Copy Markdown
Contributor

@slikhite-1 , hi this is Peng. Are you still working on this? If you are busy with other stuff, I am happy to address the comments and push this forward. Thank you!

@pengdurice pengdurice mentioned this pull request May 19, 2026
4 tasks
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.

3 participants