JAXBench: Fix ragged paged attention benchmark inputs#66
Conversation
There was a problem hiding this comment.
Could you remove this.
There was a problem hiding this comment.
Could you remove this as well.
There was a problem hiding this comment.
Do you have correctness check for this optimized code
Not equal to tolerance rtol=0.1, atol=0.1 Outputs from baseline.py and optimized.py do not match. Mismatched elements: 29672584 / 33554432 (88.4%) First 5 mismatches are at indices: [0, 0, 0]: 0.05458643287420273 (ACTUAL), 0.414387583732605 (DESIRED) [0, 0, 1]: 0.00877971388399601 (ACTUAL), 0.5063981413841248 (DESIRED) [0, 0, 2]: 0.04373247176408768 (ACTUAL), -0.3895590305328369 (DESIRED) [0, 0, 3]: 0.14047656953334808 (ACTUAL), 1.2859950065612793 (DESIRED) [0, 0, 4]: -0.15021640062332153 (ACTUAL), -0.5560941696166992 (DESIRED) Max absolute difference among violations: 5.3871675 Max relative difference among violations: 199319.38 ACTUAL: array([[[ 0.054586, 0.00878 , 0.043732, ..., -0.077147, 0.013508, -0.088013], [-0.08656 , 0.024763, 0.032719, ..., 0.052373, 0.129617,... DESIRED: array([[[ 0.414388, 0.506398, -0.389559, ..., -0.658711, -0.285335, 0.094416], [ 0.085367, -0.116005, 0.952759, ..., 0.557319, 0.065653,...
I found it could not pass the tol=0.1 test.
There was a problem hiding this comment.
Hmm did you use both my new baseline and optimized code or are you comparing against the old baseline? If this is a comparison against the old baseline, it should not be expected to match as the kernel was updated.
| 'head_dim': 128, | ||
| 'page_size': 16, | ||
| 'pages_per_seq': 256, | ||
| 'scenario': 'continuous_batching_48_decode_8_chunked_prefill', |
There was a problem hiding this comment.
Could you remove this line.
- Revert README.md install instructions - Remove JAXBench-local requirements.txt pin - Drop descriptive scenario/num_active_seqs CONFIG keys (unused metadata) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Fixes the
7p_Ragged_Paged_Attentionbenchmark, whose previous inputs were nominally ragged but actually used:This allowed implementations to treat the workload as fixed-shape dense attention without honoring the ragged metadata.
Changes
cu_q_lens, variable KV lengths, and inactive sequences while remaining JIT-compatible.pl.ANYAPI.Validation
Tested on TPU v6e-1 with JAX 0.9.2:
0.003906250.0066716.12 ms3.46 ms4.66×git diff --checkpass