Skip to content

[FEAT][kernels]: implement fused Gumbel-Softmax sampler for differentiable rollouts #45

Description

@Flink-ddd

Description:

Context:

Standard autoregressive sampling like greedy or temperature sampling in vLLM breaks the computational graph, requiring REINFORCE-style gradient estimators like PPO. For future alignment algorithms that may rely on reparameterization gradients through discrete tokens, we need a high-performance, differentiable Gumbel-Softmax sampling operator.

Tasks:

  1. Implement a Triton kernel for the Gumbel-Softmax trick in rl_engine/kernels/ops/triton/sampling.py.
  2. The kernel should support hard=True returns one-hot vectors on forward, continuous gradients on backward and temperature annealing.
  3. Ensure it efficiently handles the [Batch, Sequence, Vocab_size] tensor shape without materializing excessive intermediate random noise arrays in global memory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: kernelsTasks involving the development of CUDA and Triton underlying operatorsenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions