You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEAT][kernels]: implement fused GRPO loss with in-place group reward normalization #46
component: alignmentTasks involving RL loss functions such as DPO and GRPO, and mathematical alignment logiccomponent: kernelsTasks involving the development of CUDA and Triton underlying operatorstype: performancePerformance optimization tasks aimed at increasing throughput and reducing latency etc.
For GRPO, computing the advantage requires calculating the mean and standard deviation of rewards within a specific generation group (responses corresponding to the same prompt) and then computing the policy gradient loss. Doing this in standard PyTorch involves excessive broadcasting, expanding, and memory allocation.
Tasks:
Implement a fused CUDA/Triton kernel (grpo_loss.py) that accepts flat sequences, group boundary indices, and raw rewards.
Perform group-wise reward normalization mean/std entirely within Shared Memory or fast registers without materializing intermediate broadcasted tensors.
Compute the clipped surrogate objective and the KL penalty in the same kernel pass.
Return the final scalar loss and the backward gradient for the policy logits.
component: alignmentTasks involving RL loss functions such as DPO and GRPO, and mathematical alignment logiccomponent: kernelsTasks involving the development of CUDA and Triton underlying operatorstype: performancePerformance optimization tasks aimed at increasing throughput and reducing latency etc.
Activity
KJLdefeated commentedon Jun 8, 2026
I am interested in this issue and have idea about how to do it. Can I try to resolve this?
Flink-ddd commentedon Jun 8, 2026
sure, Thank you.