Skip to content

feat(grpo): in-kernel force-on-policy TIS weight - #8

Open
dongseokmotif wants to merge 2 commits into
mainfrom
feat/grpo-force-on-policy
Open

feat(grpo): in-kernel force-on-policy TIS weight#8
dongseokmotif wants to merge 2 commits into
mainfrom
feat/grpo-force-on-policy

Conversation

@dongseokmotif

@dongseokmotif dongseokmotif commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

main 기준으로 force-on-policy TIS만 담도록 재작성한 PR입니다 (base를 entropy 브랜치 → main으로 변경, clamp/entropy 커밋 제거).

Supports an in-kernel force-on-policy truncated-importance-sampling (TIS) weight for the fused chunked GRPO loss. When old_per_token_logps is None the kernel sets old := curr.detach() (PPO ratio == 1, truly on-policy). With force_on_policy_tis=True, the vllm_is_ratio slot carries the generation logprobs and the kernel forms exp(old - gen) == exp(curr - gen) internally — needed because curr only exists inside the fused chunk, so the caller cannot precompute it.

Details

  • New scalar kwargs (mirror entropy_coef threading): force_on_policy_tis, truncated_importance_sampling_ratio (upper clamp), truncated_importance_sampling_ratio_min (lower clamp / floor).
  • gen rides the existing vllm_is_ratio chunked slot; nan_to_num guards the exp.
  • All params default off → backward-compatible.
  • Autograd arg/grad balance verified (29 apply args = 29 backward grads).

Commits

  1. feat(grpo): in-kernel force-on-policy TIS weight
  2. feat(grpo): add lower clamp (min) for in-kernel force-on-policy TIS weight

dongseokmotif and others added 2 commits June 14, 2026 05:24
Support force_on_policy_ratio with the fused chunked GRPO loss. When
old_per_token_logps is None the kernel already sets old := curr.detach()
(=> PPO ratio == 1, truly on-policy). Add force_on_policy_tis: when set,
the vllm_is_ratio slot CARRIES the generation logprobs and the kernel
forms the TIS weight exp(old - gen) == exp(curr - gen) internally, clamped
to truncated_importance_sampling_ratio. Needed because curr only exists
inside the fused chunk, so the caller cannot precompute it.

Threaded as fixed scalar kwargs (mirroring entropy_coef) through
LigerFusedLinearGRPOLoss.forward -> Function.forward/backward ->
base.forward -> _compute_chunk_loss -> ppo_loss_fn; gen rides the existing
vllm_is_ratio chunked slot. Both params default off => backward-compatible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eight

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dongseokmotif
dongseokmotif force-pushed the feat/grpo-entropy-bonus branch from 9982957 to 3a8fd70 Compare June 14, 2026 05:25
@dongseokmotif
dongseokmotif force-pushed the feat/grpo-force-on-policy branch from 7a47e5b to de93042 Compare June 14, 2026 05:25
@dongseokmotif
dongseokmotif changed the base branch from feat/grpo-entropy-bonus to main June 14, 2026 05:26
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.

1 participant