fix: add dtype guard to FlashAttnBackend capability check
- _backend_supports now rejects fp32 for FlashAttnBackend (flash-attn only supports fp16/bf16), preventing runtime crash on fallback chain - rename test_default_backend_is_torch_native to reflect multi-backend reality - scheduler test fixture uses bf16 model (matches production, avoids unnecessary 3-step fallback chain)
This commit is contained in:
@@ -135,6 +135,8 @@ def _backend_supports(
|
||||
if isinstance(backend, FlashAttnBackend):
|
||||
if not flash_attn_available():
|
||||
return False
|
||||
if q.dtype not in (torch.float16, torch.bfloat16):
|
||||
return False
|
||||
if q.size(1) == 1 and kv_cache is not None:
|
||||
return True
|
||||
return not (attn_mask is not None and not is_causal)
|
||||
|
||||
Reference in New Issue
Block a user