Fix Mistral GSM8K chat eval - #27757
Conversation
# Conflicts: # test/registered/unit/server_args/test_server_args.py
The FA3 backend-disable (server_args guard + is_fa3_default_disabled_architecture + TestDefaultAttentionBackend) is orthogonal to the GSM8K nightly regression: bisect attributes the break to sgl-project#21931 (mgsm_en -> gsm8k eval migration), not a backend change, and the PR body premise (Mistral already on FlashInfer) is false on main, which defaults Mistral/Mixtral to fa3 on Hopper. The chat-mode prompt + stop sequences + extract_answer is the actual fix. - remove is_fa3_default_disabled_architecture, the server_args guard, and the TestDefaultAttentionBackend unit tests - hoist the idx-invariant _chat_prompt_style out of the per-sample loop - collapse the duplicated chat-branch scaffolding in _build_prompt - lower FP8 Mixtral threshold to match bf16 (shared-threshold invariant)
|
Results for 🚀 🚀 |
|
/rerun-test test/registered/eval/test_text_models_gsm8k_eval.py |
|
Results for 🚀 |
lmms-eval v0.5 pins antlr4-python3-runtime==4.7.2, which overwrites the 4.9.3 installed via sglang[test] (sgl-eval's latex2sympy2_extended raises ImportError on 4.7.x). Re-pin 4.9.3 right after the lmms-eval install so the nightly sgl-eval GSM8K path can import.
|
/rerun-test test/registered/eval/test_text_models_gsm8k_eval.py |
|
Results for 🚀 |
Baselined on H100 2-GPU over the full 1319-example GSM8K test split using
sgl-eval (zero-shot chat, \boxed{} answer, math_verify grading). Thresholds
are measured_score - 0.05. Replaces the 0.0 placeholders that only checked
'sgl-eval did not crash'.
|
/rerun-test test/registered/eval/test_text_models_gsm8k_eval.py |
|
Results for 🚀 |
| from sglang.test.simple_eval_gsm8k import GSM8KEval | ||
| if getattr(args, "api", None) == "sgl_eval": | ||
| # Only the nightly correctness eval opts into sgl-eval (zero-shot | ||
| # chat, \boxed{}, math_verify). Every other gsm8k caller — spec | ||
| # decoding perf/accuracy, disaggregation, quant, model e2e — uses | ||
| # the 5-shot completion last-number scorer and relies on | ||
| # max_tokens/throughput behavior sgl-eval cannot provide. | ||
| return _run_sgl_eval("gsm8k", args) | ||
| from sglang.test.simple_eval_mixed_prefix_gsm8k import GSM8KEval |
There was a problem hiding this comment.
Are there plans to have sgl-eval support these two features and ultimately unify the evaluation technology stack?
There was a problem hiding this comment.
Yes, we are planing to migrate all evals gradually.
|
/rerun-test test_mimo_v2_flash.py |
|
Results for 🚀 |
# Conflicts: # python/sglang/test/run_eval.py # python/sglang/test/simple_eval_common.py
Summary
Move the nightly text-model GSM8K eval from the hand-rolled 5-shot chat-API scorer to
sgl-eval(zero-shot chat,\boxed{}answer,math_verifygrading), fill in real thresholds for every nightly model, and fix the CI install-order bug that blocked the sgl-eval path.Root cause
nightly-test-text-accuracy-2-gpu-h100was red on Mistral-family models (e.g.mistralai/Mistral-7B-Instruct-v0.30.414 vs 0.47 threshold). Reproduced on a devbox: the model generates correctly withfinish_reason=stopand no runaway — it is not a serving regression. The old scorer wraps a completion-style 5-shotQuestion:/Answer:prompt in Mistral's[INST]chat template, which breaks the few-shot context for Mistral-family models; last-number extraction then occasionally grabs the wrong number when the response continues into another Q/A block.What this PR does
sgl-eval(api="sgl_eval"intest_text_models_gsm8k_eval.py). sgl-eval is a black-box subprocess running zero-shot chat with\boxed{}formatting andmath_verifygrading, which avoids the few-shot/chat-template interaction.api='sgl_eval'. Every other gsm8k caller keeps the hand-rolled 5-shot completion scorer unchanged.The CI install-order bug
sgl-eval's
latex2sympy2_extendedrequiresantlr4-python3-runtime4.9.3 / 4.11 / 4.13.2 and raisesImportError: Unsupported ANTLR version 4.7.2on 4.7.x. Theantlr4-python3-runtime==4.9.3pin inpython/pyproject.toml [test]was not enough — CI still loaded 4.7.2:The clobber comes from
latex2sympy2==1.9.1(a transitive dep oflmms-eval, distinct fromlatex2sympy2_extended), which hard-pinsantlr4-python3-runtime==4.7.2.Fix: in
scripts/ci/cuda/ci_install_dependency.sh, right after thelmms-evalinstall, force it back:Thresholds (H100 2-GPU, full 1319 split, sgl-eval zero-shot)
Low scorers (
gemma-2-2b-it-FP80.07,Mistral-7B-v0.3-FP80.28) are genuine — verified on a devbox that the model emits\boxed{}correctly and the grader extracts the answer (no format issue, nono_answer). GSM8K is a numeric answer task, so these reflect weak zero-shot reasoning on small/older-instruct models, not an eval bug.Validation
/rerun-test test/registered/eval/test_text_models_gsm8k_eval.pyon 2-gpu-h100 — all 15 models pass: run 28645576771 ✅pre-commit run --filesandpy_compileon changed files.CI States
Latest PR Test (Base): ❌ Run #29058072699
Latest PR Test (Extra): ❌ Run #29058072562