Repository navigation
[New Model] Add Baidu Unlimited-OCR - #29186
Merged
Merged
Conversation
adityakamat24
requested review from
Fridge003,
JustinTong0323,
Ying1123,
hnyls2002,
merrymercy,
mickqian,
yhyang201 and
yuan-luo
as code owners
June 24, 2026 16:04
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
adityakamat24
requested review from
CatherineSue,
HaiShaw,
Qiaolin-Yu,
alphabetc1,
hanming-lu,
hebiao064,
hzh0425,
ispobock,
slin1237,
xiezhq-hermann and
yizhang2077
as code owners
June 24, 2026 16:04
2 tasks
mickqian
reviewed
Jun 26, 2026
mickqian
left a comment
Collaborator
There was a problem hiding this comment.
Could you also attach the results of accuracy test?
| image_max_dynamic_patch: Optional[int] = None | ||
| video_max_dynamic_patch: Optional[int] = None | ||
|
|
||
| images_config: Optional[dict] = None |
Collaborator
There was a problem hiding this comment.
nit: For Unlimited-OCR
| else: | ||
| new_batch.decoding_reqs = None | ||
|
|
||
| if getattr(self.tp_worker.model_runner, "prefill_aware_swa", False): |
Contributor
Author
@mickqian I updated the pr body with the accuracy tests results and made changes to the code as per your review. Please do re-review it. Thanks! |
mickqian
reviewed
Jun 27, 2026
| src_base = req_idx * req_to_token_stride | ||
| dst_base = bid * dst_stride | ||
|
|
||
| for start in range(0, kv_len, BLOCK_SIZE): |
Collaborator
There was a problem hiding this comment.
kv_len is dynamic, tl.range(0, kv_len, BLOCK_SIZE) is better for JIT
Collaborator
|
/tag-and-rerun-ci |
5 tasks
2 of 5 tasks
5 tasks done
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) <[email protected]>
Chronostasys
pushed a commit
to MindLab-Research/sglang
that referenced
this pull request
Aug 24, 2026
Co-authored-by: Mick <[email protected]>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Add support for Baidu Unlimited-OCR. Closes #29115.
Modifications
images_configrequest field to select the image mode (tiny/small/base/gundam).Usage
Launch the server:
CUDA graph and the overlap scheduler are on by default and account for the throughput below, so no extra flags are needed (in particular, the overlap scheduler does not need to be disabled).
Example request;
images_configselects the image mode (tiny, small, base, gundam):Accuracy Tests
Evaluated on ParseBench, the benchmark Baidu reports on the model card, served through this implementation and scored with ParseBench's official
unlimitedocrprovider and offline rule-based metrics (no LLM judge). The port reproduces the published leaderboard scores on a single H100:text_content)table)All 1009 documents completed with no failures (text_content 506/506, table 503/503). The numbers are the ParseBench leaderboard dimensions -
text_contentrule pass rate andtableGriTS composite. Decoding follows the model's reference recipe: greedy with the model'sDeepseekOCRNoRepeatNGramLogitProcessor(ngram 35, window 128) and gundam image mode, with the overlap scheduler on.The optimizations do not change output: transcriptions are byte-for-byte identical with the CUDA graph on and off, the overlap scheduler on and off, across all four image modes, and for long inputs (3000+ token prompt, 2000+ token output spanning many sliding-window eviction cycles).
Reproduce - ParseBench's
unlimitedocrprovider posts{"image_base64"}and reads{"markdown"}, so a small adapter forwards the image to/v1/chat/completionsand returns the response with the decoding above:Run logs, full metric reports, and per-document scores (all 1009 documents)
Run summary:
text_contentaggregate metrics (full_evaluation_report.md):tableaggregate metrics (full_evaluation_report.md):Per-document scores -
text_content(506 documents; columns: example_id, rule_pass_rate, content_faithfulness):Per-document scores -
table(503 documents; columns: example_id, grits_trm_composite, table_record_match):Speed Tests and Profiling
Single H100 80GB, FA3, page size 1, tp 1, temperature 0, single stream. Decode is the server-side gen throughput. Baseline is the conservative launch with the overlap scheduler disabled; optimized enables the overlap scheduler. CUDA graph is on for both.
Decode throughput:
Latency (optimized):
The R-SWA cache is correct with the overlap scheduler, so it does not need to be disabled. Keeping it on pipelines the per-step CPU work (scheduling, sampling, detokenization) behind the GPU forward, which is the ~60% decode gain. Output was checked byte-for-byte with the scheduler on vs off and is identical across all image modes and for long inputs (3000+ token prompt, 2000+ token output across many eviction cycles). CUDA graph is required for these numbers; eager decode is ~70 tok/s. Tuning the fused MoE config for this shape was also tried and moved throughput about 2 percent, within noise, so the default is kept.
Checklist
CI States
Latest PR Test (Base): ✅ Run #28285309464
Latest PR Test (Extra): ❌ Run #28285309384