$ the-wire · showcase
GSPO lands in torchrl, Helion's flash attention closes on cuDNN
By RepoJournal · Filed · About PyTorch · Composed from the cited sources · methodology
torchrl gains a sequence-level importance ratio for GRPO-style RL, Helion's CuTe flash-attention stack clears a batch of shape and tile-count gaps on B200, and two PyTorch compiler fixes correct rounding placement and exception semantics.
[Feature] Add GSPOLoss pytorch/rl
Adds `GSPOLoss` as a `GRPOLoss` subclass in the same shape as `CISPOLoss`, overriding only `_log_weight` to use GSPO's per-sequence ratio s_i = exp(mean_t(log pi_theta - log pi_old)) in the GRPO clipped objective. Token-level clipping, entropy, KL terms and aggregation stay untouched, so swapping it in for `GRPOLoss` does not require rebuilding the surrounding loss machinery.
[cutedsl] Let two single-tile flash CTAs share an SM and load K/V before the Q wait pytorch/helion
The CuTe flash-attention hillclimb let two single-tile CTAs share an SM and moved K/V loads ahead of the Q wait, targeting the fp8 attention case where the grid holds more CTAs than the device has SMs. Its companion change in the same stack took dense attention at head dim 64 (B2 H32 S1024 D64 fp16 on a B200) from 0.987x to 1.028x of cuDNN.
[metal] Lower attention's matmuls on simdgroup fragments pytorch/helion
`metal_matmul="fragment"` now lowers `examples/attention.py` end to end; the fragment planner previously refused batched matmuls and any reduction of a fragment result, and staged per-row vectors and P through threadgroup memory. The fragment path closing on plain attention is the gate for anything downstream on Metal.
[Inductor] Round Python scalar constants on the host (#207031) pytorch/pytorch
Inductor used to build its rounding temporary for a Python scalar like `(x + 1)` against the default `device`, so under FakeTensorMode tracing on CUDA the tensor landed on the GPU; the round now happens on the host, removing that device placement and the `.item()` sync it forced. No BC break.
Restore submodule training modes in swa_utils.update_bn (#205939) pytorch/pytorch
`swa_utils.update_bn` restored training mode only on the root, so modules in eval mode such as Dropout would return to train after the call. It now restores every submodule's mode individually, which keeps Monte Carlo dropout inside an eval-mode model in train mode too; only the mode is restored, not the running statistics.