Repository navigation
[FlyDSL] [Misc] Simplify PA decode reducer bound and reuse shared helpers - #7077
Conversation
- Fold the reducer's partition_bound into max_partitions: pa_decode passes one tight per-call bound; above a wave the power-of-two round-up is capped by the CU count. - Use dtypes.fp8 for the KV FP8 dtype, tensor_shim._FX_ELEM for the reducer's dtype lookup, and fx.as_ir_value instead of _to_raw. - Name the gfx1250 thread count Gfx1250Traits.BLOCK_THREADS instead of hardcoding 128. - Treat any nonpositive sliding_window as disabled in pa_decode and plan_pa_decode instead of rejecting values below -1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
#7077 made pa_decode require dtypes.fp8 for FP8 KV instead of a per-arch dtype table. The capability and default-budget helpers still used that table, so they could accept a dtype pa_decode rejects. Compare against dtypes.fp8 there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…7077) - Fold the reducer's partition_bound into max_partitions: pa_decode passes one tight per-call bound; above a wave the power-of-two round-up is capped by the CU count. - Use dtypes.fp8 for the KV FP8 dtype, tensor_shim._FX_ELEM for the reducer's dtype lookup, and fx.as_ir_value instead of _to_raw. - Name the gfx1250 thread count Gfx1250Traits.BLOCK_THREADS instead of hardcoding 128. - Treat any nonpositive sliding_window as disabled in pa_decode and plan_pa_decode instead of rejecting values below -1. Co-authored-by: who who who <17592563+fsx950223@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Motivation
Cleanups in the FlyDSL PA decode wrapper and kernels. The reducer launcher took two partition limits where one is enough, and several spots duplicated helpers that aiter or FlyDSL already provide.
Changes
launch_pa_decode_ps_reducetakes a singlemax_partitions, which is the tight per-call bound.pa_decodecomputes it from the plan cap, plan capacity, context tiles and the sliding-window cap, and the separatepartition_boundargument is removed.max_partitions. With a non-default plan cap that isn't a power of two, the compiled bound can round past it (for example 100 → 128). This is safe because the reducer's per-sequence buffer bound zero-fills partitions beyond the live count.pa_decodeusesdtypes.fp8instead of its own arch → FP8 dtype table. The supported-arch check stays.tensor_shim._FX_ELEMinstead of a local_DTYPE_MAP, and still accepts onlyf32,f16andbf16.fx.as_ir_valueinstead oftensor_shim._to_raw.Gfx1250Traits.BLOCK_THREADS(NWARP * WAVE= 128) replaces the hardcoded 128 inknown_block_size, the launch block, the direct-output copy loop andstage_vector_dma. It's a class constant, not a dataclass field, so traits cache keys don't change.sliding_window:pa_decodeandplan_pa_decodetreat any nonpositive value as disabled instead of raising for values below -1. The docstrings say so.Test
op_tests/test_flydsl_pa_decode.pyon gfx1250 with FlyDSL 0.4.0: 119 passed, 5 skipped.plan_pa_decode(..., sliding_window=-5)builds the same plan as-1.dtypes.fp8and_FX_ELEMchanges also apply there.blackandruffpass.🤖 Generated with Claude Code