Skip to content

[Model] Support LongCat 2.0 FP8 - #30275

Merged
BBuf merged 5 commits into
sgl-project:mainfrom
BBuf:longcat2-pr30202-serving-fix
Jul 7, 2026
Merged

BBuf merged 5 commits into
sgl-project:mainfrom
BBuf:longcat2-pr30202-serving-fix

Conversation

@BBuf

@BBuf BBuf commented Jul 6, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Support meituan-longcat/LongCat-2.0-FP8 in SGLang.

This PR includes the original LongCat 2.0 support from #30202 by @sjqgogogogo, plus the serving fixes found while validating the official FP8 checkpoint on an 8x B300 node.

Co-authored-by: sunjiaqi11 sunjiaqi11@meituan.com

Modifications

  • Add LongCat 2.0 model/config support from support LongCat 2.0 #30202.
  • Resolve LongCat HF configs through architectures when model_type is null.
  • Map LongCat 2.0 oe_* ngram embedding config fields so model.ngram_embeddings.* weights are loaded.
  • Align the ngram token-table path with the working implementation from support LongCat2.0 #30042 instead of the decode-only fast path that produced bad outputs.
  • Rename the ngram token-table update skip field to make the chunked-prefill behavior explicit.
  • Use consistent vocab-parallel TP settings for both LongCat word and ngram embedders.
  • Populate ngram embedding metadata for warmup and CUDA graph dummy batches.
  • Auto-resolve the FP8 GEMM runner backend for LongCat FP8 on Blackwell scale layouts.

Accuracy Tests

Hardware: 8x NVIDIA B300

Model: meituan-longcat/LongCat-2.0-FP8

Server command used for validation:

python3 -m sglang.launch_server \
  --model-path /mnt/local_disk/data/bbuf/models/LongCat-2.0-FP8 \
  --trust-remote-code \
  --host 0.0.0.0 \
  --port 13423 \
  --tp-size 8 \
  --ep 8 \
  --max-running-requests 64 \
  --mem-fraction-static 0.92 \
  --chunked-prefill-size 2048 \
  --nsa-prefill-backend fa3 \
  --kv-cache-dtype bfloat16 \
  --model-loader-extra-config '{"enable_multithread_load":true,"num_threads":12}'

Results:

  • Generation check: A shop has 17 apples and sells 8. Then it buys 6 more. -> 15
  • GSM8K 200 examples: 0.980
  • GSM8K full set, 1314 examples: 0.958904109589041

CUDA graph was enabled and decode CUDA graph capture completed successfully.

Speed Tests and Profiling

The full GSM8K validation reported output throughput of about 1084 token/s. This was used as a serving validation, not as a formal throughput benchmark.

Checklist

  • Format/diff check: git diff --check
  • Python syntax check on changed files
  • PYTHONPATH=python python3 test/registered/unit/model_executor/test_ngram_token_table.py
  • GSM8K accuracy validation
  • Full CI

CI States

Latest PR Test (Base): ⏳ Run #28853132542
Latest PR Test (Extra): ⏳ Run #28853132297

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@BBuf
BBuf force-pushed the longcat2-pr30202-serving-fix branch from 9dc9f59 to 5a2e5be Compare July 7, 2026 01:13
Co-authored-by: sunjiaqi11 <sunjiaqi11@meituan.com>
@BBuf
BBuf force-pushed the longcat2-pr30202-serving-fix branch from 5a2e5be to 375da86 Compare July 7, 2026 01:34
@ispobock ispobock added run-ci CI: run the baseline test suite on this PR bypass-fastfail run-ci-extra CI: also run the extra suite (requires run-ci) labels Jul 7, 2026
@BBuf
BBuf force-pushed the longcat2-pr30202-serving-fix branch from 2ceca45 to bd7d803 Compare July 7, 2026 08:39
DarkSharpness pushed a commit that referenced this pull request Jul 7, 2026
The fused v2 PAGED dispatch (from #30274) asserts that DSAMetadata carries
a preprocessed topk_v2_plan instead of silently recomputing it per layer.
The equivalence test builds DSAMetadata by hand without the plan, so
test_topk_fused_backends_equivalence started failing on trunk for every PR
(e.g. #30275's base-b-test-1-gpu-large job). Build the plan the same way
init_forward_metadata / _build_forward_metadata_cuda_graph do; the
sgl-kernel-vs-flashinfer equivalence check now actually covers the v2
fused path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BBuf
BBuf merged commit e339c83 into sgl-project:main Jul 7, 2026
186 of 362 checks passed
dougyster added a commit to dougyster/sglang that referenced this pull request Jul 17, 2026
…ped in v0.5.15

Ancestry-checked each rolling-:dev model against v0.5.15.post1. Support that
landed in the release moves to the stable tag:
- Baidu Unlimited-OCR (sgl-project#29186), LFM2.5 (sgl-project#29659) -> :latest
- MiniCPM-V-4.6 (sgl-project#24855): :dev -> :latest, :dev-cu12 -> :latest-cu129

Kept on :dev (support NOT in the release cut):
- LongCat-2.0 (FP8 support sgl-project#30275 not in v0.5.15.post1)
- Hy3 (HunyuanV3 NextN/MTP fix sgl-project#30331 not in release; MTP is a headline feature)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
Co-authored-by: sunjiaqi11 <sunjiaqi11@meituan.com>
Co-authored-by: Ke Bao <ispobaoke@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail deepseek jit-kernel run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) sgl-kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants