sglang
sglang copied to clipboard
Refactor flashinfer logic for deepseek v3
Motivation
flashinfer_backend.py for attention is too complex, this PR extract the logic of MLA and creates a new flashinfer_mla_backend.py
Modifications
- Define
FlashInferMLAAttnBackendinflashinfer_mla_backend.pyby removing codes irrelevant to MLA inflashinfer_backend.py - Simplify the code in forward of MLA
Checklist
- [x] Format your code according to the Code Formatting with Pre-Commit.
- [ ] Add unit tests as outlined in the Running Unit Tests.
- [ ] Update documentation / docstrings / example tutorials as needed, according to Writing Documentation.
- [ ] Provide throughput / latency benchmark results and accuracy evaluation results as needed, according to Benchmark and Profiling and Accuracy Results.
- [ ] For reviewers: If you haven't made any contributions to this PR and are only assisting with merging the main branch, please remove yourself as a co-author when merging the PR.
- [ ] Please feel free to join our Slack channel at https://slack.sglang.ai to discuss your PR.