Repository navigation
feat(jetspec): validate SGLang export and decode acceptance #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hereisaway
wants to merge
4
commits into
inclusionAI:main
Choose a base branch
from
hereisaway:feat/jetspec-acceptance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f0adfc7
feat(jetspec): validate SGLang export and decode acceptance
hereisaway ecee9db
docs(jetspec): clarify checkpoint conversion and timing limits
hereisaway 5e069a0
test(jetspec): add published checkpoint export harness
hereisaway d3d206c
docs(jetspec): link the published export harness
hereisaway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # JetSpec bounded decode compatibility | ||
|
|
||
| This is a bounded decode integration check, not a throughput benchmark, convergence | ||
| result or serving-quality claim. It verifies that an ASpec-exported JetSpec asset is | ||
| loaded by official SGLang 0.5.21, that the causal head is active, and that exporting | ||
| the published checkpoint through ASpec preserves the decode result. | ||
|
|
||
| ## Setup | ||
|
|
||
| - Host: one H100 PCIe 80GB, `sglang==0.5.21`, torch 2.13.0+cu130. | ||
| - Target: `Qwen/Qwen3-8B` (`/public/models/Qwen3-8B`). | ||
| - Data: 16 prompts from the held-out validation split. | ||
| - Decode: greedy, 32 new tokens, two complete repeats, normal radix cache. | ||
| - Draft: JetSpec block size 16, five Target feature layers `[1, 9, 17, 25, 33]`. | ||
| - Export: `aspec export` default SGLang layout with top-level `is_causal=true` and | ||
| `dflash_config.causal_head=true`. | ||
|
|
||
| SGLang 0.5.21 reads the top-level `is_causal` flag for DFlash full-attention layers; | ||
| `dflash_config.causal_head` alone leaves those layers bidirectional. | ||
|
|
||
| ## Results | ||
|
|
||
| | Draft | Acceptance length | Verifications | Median speedup | Greedy equal | Repeats stable | | ||
| | --- | ---: | ---: | ---: | --- | --- | | ||
| | ASpec 8-step checkpoint | 1.032 | 992 | 0.795x | yes | yes | | ||
| | Published `JetSpec/jetspec-qwen3-8b` loaded directly | 2.723 | 376 | 1.823x | yes | yes | | ||
| | Published checkpoint exported through ASpec | 2.723 | 376 | 1.823x | yes | yes | | ||
|
|
||
| Acceptance length follows `aspec evaluate`: completion tokens divided by real | ||
| verifier calls, including Target tokens. Each repeat produced 512 completion tokens; | ||
| the two repeats produced 1024 tokens total, which is the numerator used above. | ||
|
|
||
| The ASpec-exported published checkpoint matched the directly loaded checkpoint's | ||
| acceptance length, verification count and speedup in this bounded setup. That checks | ||
| config/weight/layout compatibility; it does not establish convergence or a trained | ||
| quality comparison. | ||
|
|
||
| Timing is fixed-order: the evaluator completes all Target-only repeats before all | ||
| speculative repeats. Two repeats do not counterbalance that order, so the speedup | ||
| column is a bounded decode observation with an uncontrolled order-dependent | ||
| limitation, not an unbiased throughput result. | ||
|
|
||
| The 8-step ASpec checkpoint was trained only as a functional smoke test on synthetic | ||
| data. Its lower acceptance and slower speculative decode are expected and are not | ||
| evidence against the method. | ||
|
|
||
| ## Reproduction | ||
|
|
||
| ```bash | ||
| aspec export --input-dir outputs/jetspec/checkpoints/iter_0000009 \ | ||
| --output-dir outputs/jetspec-sglang | ||
|
|
||
| CUDA_VISIBLE_DEVICES=0 aspec evaluate \ | ||
| --target /models/Qwen3-8B --draft outputs/jetspec-sglang \ | ||
| --data held-out.jsonl --output outputs/jetspec-decode.json \ | ||
| --samples 16 --max-new-tokens 32 --repeats 2 | ||
| ``` | ||
|
|
||
| The command above applies to an ASpec FSDP training checkpoint. For the published | ||
| draft head, use the reproducible validation harness: | ||
|
|
||
| ```bash | ||
| python -m tools.validation.jetspec_published_export \ | ||
| --checkpoint /models/jetspec-qwen3-8b \ | ||
| --target-model /models/Qwen3-8B \ | ||
| --output outputs/jetspec-official-sglang | ||
| ``` | ||
|
|
||
| The harness loads the published tensors through `load_initial_draft_weights`, writes | ||
| the minimal distributed-checkpoint layout the converter expects, and calls | ||
| `convert_checkpoint(..., artifact_format="sglang")`. The published checkpoint omits | ||
| `embed_tokens`, so `--target-model` supplies the borrowed embedding; converting only | ||
| the config is not sufficient. | ||
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.