Add --attention_backend CLI argument (fixes minor note in #46) - #50
Add --attention_backend CLI argument (fixes minor note in #46)#50RollerCoaster1899 wants to merge 2 commits into
Conversation
…ents Replace hardcoded ATTENTION_BACKEND (fa3), PAGE_SIZE, and MEM_FRACTION_STATIC constants with configurable CLI arguments. This allows users with non-Hopper GPUs (e.g. RTX 4090, sm_89) to use --attention_backend flashinfer or --attention_backend triton instead of the Hopper-only fa3 default. Fixes the minor secondary note in issue baidu#46.
Covers all new arguments (--attention_backend, --page_size, --mem_fraction_static) plus existing ones for regression safety.
|
Exactly the right fix -- the hardcoded Confirmed-valid backends for the custom SGLang wheelThe custom wheel (
_WHEEL_CONFIRMED = {"fa3", "flashinfer", "triton"}
if args.attention_backend not in _WHEEL_CONFIRMED:
print(
f"Warning: --attention_backend {args.attention_backend!r} is accepted by argparse "
"but may not be compiled into the custom SGLang wheel. "
"Server will fail at startup if unavailable.",
file=sys.stderr,
)GPU-to-backend table in READMEUsers won't know which value to use without a guide. Suggested addition alongside the Coordinate with PR #29PR #29 (open) also modifies
|
Summary
Replaces hardcoded
ATTENTION_BACKEND = "fa3",PAGE_SIZE, andMEM_FRACTION_STATICconstants with configurable CLI arguments ininfer.py.Problem
infer.pyhardcodedATTENTION_BACKEND = "fa3", which is FlashAttention-3 (Hopper-only, sm_90). Users with Ada GPUs (e.g. RTX 4090, sm_89) had to manually edit the source to useflashinferortriton.Changes
--attention_backendCLI argument with choices: fa3, flashinfer, triton, fa4, flashmla, cutlass (default: fa3)--page_sizeCLI argument (default: 1)--mem_fraction_staticCLI argument (default: 0.8)start_server()to use args valuesUsage
Related
Fixes the minor secondary note in #46.