Skip to content

softmax's seed has a blind row axis: 37*128 = 0 mod 128, so the check cannot see a whole-band row error #56

Closed

Description

@feitreim

Found while tightening the GEMM's reference (#48), by auditing the other running example's generator against the same question: which coordinate errors can this check not see?

The hole

softmax.rs seeds its input with a permutation whose row term is 37 * 128 * row. Since 37 * 128 = 0 (mod 128), the permutation has period 128 in row — exactly one CTA band. Any row error that is a whole multiple of 128 rows produces bit-identical expected values, so the exact check passes it.

This is the same class as #48 (a coordinate the generator does not actually depend on) but narrower, and the narrowness is why it was left alone rather than folded into #55:

  • The load and the store share the same ROWS * blockIdx.x, so a band error moves both and lands back on itself.
  • The destination buffer is zeroed, so an entirely unwritten band fails on the zeros rather than on the values.

It bites only if those two coordinates diverge — a kernel that computes its load row and its store row separately, which is exactly what a split-row or persistent-CTA variant would do. That is a plausible next edit to this file, not a hypothetical.

What is NOT wrong

The plane axis is strong and needs no change; I checked before assuming symmetry with #48. 53 is odd, hence a bijection mod 128, and since 11^-1 = 35 (mod 128) a one-plane step is a 63-column rotation. Minimum relative error over every cell is 0.9985 against a 2^-8 tolerance — a 255x margin. So this issue is one axis of one example, not "softmax's check is weak".

Acceptance

Not in scope

The GEMM's axes — #55 handled those and documented its own residual (at K = 0 mod 21 the column period collapses 21 to 7; no K this project runs is a multiple of 21).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:scaffolding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions