Repository navigation
Compile SDPA with bounded tensor-dependent batch sizes - #1257
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1257 +/- ##
=======================================
Coverage 82.91% 82.91%
=======================================
Files 173 173
Lines 11191 11191
=======================================
Hits 9279 9279
Misses 1912 1912 ☔ View full report in Codecov by Harness. |
cf673e1 to
f6b6bda
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Summary
Allow SDPA compilation when a tensor-dependent batch size is provably within the existing 65,535-entry chunk limit.
Description of the change
PyTorch 2.14 CPU, default Inductor backend:
The original Python loop requires a concrete batch size. Use the single iteration
(0,)when at most one chunk is needed; retain the original loop for larger batches. Attention computation and chunk sizes are unchanged, with no custom operation.This covers provably bounded batches. Strict compilation across an unknown 65,535-entry boundary remains unsupported.
Validation
fullgraph=FalseandTrue, tensor-dependent batches changing 2 → 8 → 1, matching eager outputs.