Repository navigation
feat: support flashinfer kernel autotune - #12306
Kangyan-Zhou merged 10 commits into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Great work! May I ask how long a single tuning run takes now? Is there a switch to control whether the kernel is tuned? |
For B200+gpt-oss-120b, it takes about 1 min from my local test:
The current design from flashinfer is just running one dummy forward iteration on max batch size with flashinfer context, if there is any flashinfer apis called in the iteration(e.g. |
3e541ac to
a9c50aa
Compare
|
@FlamingoPg Could you review this PR? Thanks! |
Looks fine, let's wait for the CI |
|
@FlamingoPg There are quite a few CI failures. Are all of them caused by this PR? Or are some of them known failing issues? |
a9c50aa to
5c666ea
Compare
|
I will help you rerun failed jobs |
|
Hi @FlamingoPg, It seems that CI failures are not related to my PR. Could you help confirm? Thanks! |
edd223e to
817866b
Compare
|
Waiting for the CI to pass. |
|
Hi @Qiaolin-Yu @FlamingoPg @Fridge003, could you help us to merge this PR? The CI failures are all unrelated. Thanks! |
67bab45 to
852fc37
Compare
@Kangyan-Zhou will help to merge this after all Nvidia CI pass. |
|
Test failures:
and timeout at: why does capturing cuda graphs take that long?
|
We've fixed a few test failure issue on main due to a number of issues recently. Sry for the delay, retrying now |
Co-authored-by: Qiaolin Yu <[email protected]> Co-authored-by: Kangyan-Zhou <[email protected]>
Motivation
Flashinfer MoE requires autotune to select a most performant kernel. This should be done before cudagraph captures.
Modifications
This PR added a kernel warmup stage before the cudagraph captures. In the warmup stage, it will run a dummy forward for the model under the Flashinfer autotune context.
Accuracy Tests
lm_eval --model local-completions --tasks gsm8k --model_args model=openai/gpt-oss-120b,base_url=http://127.0.0.1:18000/v1/completions,max_retries=3,tokenized_requests=False,timeout=1200,max_gen_toks=2048,max_length=8192 --batch_size 2048 --trust_remote_code --limit 0.5PR:
main:
Benchmarking and Profiling
python3 -m sglang.bench_serving --model openai/gpt-oss-120b --host 127.0.0.1 --port 18000 --backend sglang-oai --dataset-name random --random-range-ratio 1 --random-input-len 1024 --random-output-len 1024 --max-concurrency 512 --num-prompts 2560PR(16% perf improvement):
main:
Checklist