Kl Consistency Test

Write, calibrate, and debug the prefill-vs-decode logprob (KL) consistency tests in sglang -- the two independent conditions a zero requires (every operator batch-invariant, and the two paths computing the same function), which helper separates them, how to pick a threshold once they hold, and how to localize a divergence to a single operator. Use when adding a KL test to a model, picking or defending a kl_div threshold, or investigating a KL number that is too high.

sgl-project Updated 38.9k repo stars
Organizations adopting SGLang

File contents

sgl-project/sglang commit 3bf67c240b

Frequently asked questions

npx get-skill add sgl-project/kl-consistency-test