Skip to content

Expand deterministic SDPA edge-case coverage to remaining pipelines #394

Description

@hwanseoc

Problem

#328 added deterministic coverage for negative row maxima, fully masked rows/columns, and zero-length packed sequences. Important SDPA execution paths remain uncovered by those edge cases:

  • FP8 and MXFP8
  • backward with cumulative cu_seq_len_*
  • the d=256 pipeline
  • BF16 fully masked backward

These paths may use different kernels or numerical handling, so the existing FP16/BF16 coverage does not protect them from the same NaN/Inf regressions tracked by #262.

Proposed coverage

Add focused deterministic cases, without forming a Cartesian product:

  • Add one representative FP8 edge case and one MXFP8 edge case for supported forward/backward paths.
  • Add zero-length cumulative cu_seq_len_* backward coverage after plumbing cu_seq_len_* through the backward test harness.
  • Add one d_qk=256 representative that exercises the alternate pipeline.
  • Run the fully masked-row backward case with BF16 and verify finite O, dQ, dK, and dV; LSE = -inf remains expected for masked rows.

Reuse the existing SDPA execution/reference harness and deterministic tensor hooks introduced by #328. Add version or capability guards where a path is not supported.

Acceptance criteria

  • Each listed pipeline has a deterministic regression case.
  • Outputs and gradients are checked against the reference and explicitly checked for unexpected NaN/Inf.
  • Expected masked-row statistics are validated separately.
  • Coverage stays representative rather than parameterizing every edge case across every dtype and feature.

Related: #262, #328

Metadata

Metadata

Assignees

Labels

cat-enhancementsmod-frontendcuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions