Conversation
…t-dependent flakiness Summary: 24 tests in SDPATestForLargeSeqLength/SDPATestForSpeculativeDecode fail intermittently (~60% rate) on allclose(ref, op, atol=1e-6). The custom blocked CPU kernel legitimately diverges from the ATen reference at the ~1e-6 level (accumulation order differs by tiling, host BLAS path, and thread count), so the threshold has zero headroom and results vary by CI host. No recent kernel commit correlates (failures span all versions 09-02..09-16); sibling test_quantized_sdpa tests are green at atol=1e-5 (default) / 1e-3 (scaled +/-15 tensors). Match that precedent here: atol=1e-3 when scale_tensors else 1e-5. Test Plan: pytest --collect-only: 34 tests collected, syntax OK. Full numerical verification needs CI (local AOT dylib is stale).
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22904
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit 682fafb with merge base b03dec2 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
🟢 Approval recommended
The test-only tolerance update addresses documented numerical variation without product changes.
Pull request overview
This PR adjusts SDPA KV-cache test tolerances to prevent host-dependent numerical flakiness.
Changes:
- Uses
1e-5tolerance normally and1e-3for scaled tensors. - Applies the tolerance to both SDPA assertions.
File summaries
| File | Summary |
|---|---|
extension/llm/custom_ops/test_sdpa_with_kv_cache.py |
Adds scale-aware numerical tolerances. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
24 tests in
SDPATestForLargeSeqLength/SDPATestForSpeculativeDecode(test_sdpa_with_kv_cache.py) fail intermittently (~60% failure rate observed Sep 2–16) onallclose(ref, op, atol=1e-6).The custom blocked CPU kernel legitimately diverges from the ATen reference SDPA at the ~1e-6 level: accumulation order differs by tiling, host BLAS path (
gemm_uses_blas()varies by CI host), and thread count. With zero headroom at the assertion threshold, the identical test binary passes or fails depending on which CI host runs it. For the seq-130 variants with +/-15 scaled tensors, the divergence is amplified to ~1e-3.Ruled out as triggers (failures span all kernel versions in the window):
The sibling
test_quantized_sdpa.pyin the same directory already documents this phenomenon ("when scaling tensors, the test fails with smaller atol") and usesatol=1e-5by default /atol=1e-3for scaled tensors — and those tests are green on the same hosts. This change matches that precedent in_test_sdpa_common:atol = 1e-3 if scale_tensors else 1e-5.Classification: TEST_BUG (no product change).
Test Plan
pytest --collect-only: 34 tests collected, syntax OK.