{"record":{"id":"7bf9f001ed5a7a96","repo":"sgl-project/sglang","slug":"sm120-relative-bias-requires-tile-mn-64-128","errorCode":null,"errorMessage":"SM120 relative bias requires tile_mn=(64, 128)","messagePattern":"SM120 relative bias requires tile_mn=\\(64, 128\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/kernels/ops/attention/fa4_sm120/runtime.py","lineNumber":632,"sourceCode":"        seqlen_q: Optional[int],\n        seqlen_k: Optional[int],\n        num_head_kv: int,\n        qhead_per_kvhead: int,\n        is_causal: bool,\n        is_local: bool,\n        window_size_left: Optional[int],\n        window_size_right: Optional[int],\n        pack_gqa: bool,\n        paged_kv: bool,\n    ) -> Sm120ForwardConfig:\n        if has_bias:\n            if max(head_dim, head_dim_v) > 128:\n                raise ValueError(\n                    \"SM120 relative bias currently supports head_dim and \"\n                    \"head_dim_v up to 128\"\n                )\n            if tile_mn is not None and tile_mn != (64, 128):\n                raise ValueError(\"SM120 relative bias requires tile_mn=(64, 128)\")\n            tile_m, tile_n = 64, 128\n        elif tile_mn is None:\n            tile_m, tile_n = FlashAttentionForwardSm120.get_fwd_tile_size(\n                head_dim,\n                head_dim_v,\n                total_q_rows=total_q_rows,\n                num_sms=num_sms,\n                num_batch=num_batch,\n                seqlen_q=seqlen_q,\n                seqlen_k=seqlen_k,\n                num_head_kv=num_head_kv,\n                qhead_per_kvhead=qhead_per_kvhead,\n                is_causal=is_causal,\n                is_local=is_local,\n                window_size_left=window_size_left,\n                window_size_right=window_size_right,\n                pack_gqa=pack_gqa,\n                paged_kv=paged_kv,","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/kernels/ops/attention/fa4_sm120/runtime.py#L614-L650","documentation":"When relative bias is enabled on the SM120 FlashAttention path, the only supported tile is (64, 128); the kernel hardcodes that tile after selecting it. If the caller explicitly passes a different tile_mn, select_config rejects it.","triggerScenarios":"Calling _flash_attn_fwd with has_bias=True and tile_mn explicitly set to anything other than (64, 128), e.g. (128, 64) tuned for a non-bias run.","commonSituations":"Reusing a hand-tuned tile config from a bias-free benchmark; autotuning sweeps that persist the best tile across configurations with and without bias.","solutions":["Pass tile_mn=None when has_bias=True and let select_config choose (64, 128)","Or explicitly pass tile_mn=(64, 128)","Exclude bias-enabled runs from autotune configs with other tiles"],"exampleFix":"// before\ncfg = select_config(..., has_bias=True, tile_mn=(128, 64))\n// after\ncfg = select_config(..., has_bias=True, tile_mn=None)","handlingStrategy":"validation","validationCode":"if has_bias:\n    tile_mn = None  # let select_config pick (64, 128)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scope autotuned tile caches by (has_bias, dims, arch) so bias runs never reuse non-bias tiles"],"tags":["flash-attention","sm120","tile-config","relative-bias"],"backgroundTag":"unsupported-argument-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}