Commit f6a737c
[Feature] Virtual Width Network Eagle3 (vllm-project#10042)
### What this PR does / why we need it?
We add a customed speculative model "Virtual Width Network Eagle3" with
architecture similar to Seed's work 'Virtual Width Network'
(https://huggingface.co/papers/2511.11238)
We impelmented and trained the 'vwn eagle3' based on 'speculators'
library (https://github.com/vllm-project/speculators); the training
datasets includes 'ultrachat'
(https://huggingface.co/datasets/openbmb/UltraChat) and 'sharegpt'
(https://huggingface.co/collections/bunnycore/sharegpt-datasets).
We used the same setting to train a vwn-eagle3 and an eagle3 model to
compare their performace on longbenchv2, gsm8k, sharegpt, and humaneval;
as well as some man-made fixed-length datasets. The performance is
concluded as following:
Datasets testing result:
| Dataset | Context-Length | E2E Throughput Gain|
| ------ | ------ | ------ |
| gsm8k | 1.5k | 7.9%|
| humaneval | 2.5k | 11.94%|
| sharegpt | 5k | 2.84%|
| longbench_v2| 128k | 18.23%|
Fixed length testing results:
|Input Lenght | Output Length | E2E Throughput Gain|
| ------ | ------ | ------ |
| 2k | 2k | 9.83%|
| 3.5k | 1.5k | 2.38%|
| 32k | 1k | 18.66%|
### Does this PR introduce _any_ user-facing change?
Nope. VWN Eagle3 uses the same interface with eagle3 and can be
distinguished by draft model's config file, thus, the user can simply
use the same setting to start the server:
`--speculative-config '{"method": "eagle3","model":
"/vwn-eagle3-model-path/", "num_speculative_tokens": 3}' `
To reduce redundant codes, we reuse the implementation of
llama_eagle3.py to the greatest extent:
| Component | Provided by Upstream Eagle3 | Overridden/Added by VWN |
Reuse Rate |
|-----------|-----------------------------|------------------------|------------|
| Top-level CausalLM | ✅ forward, embed_input_ids, load_weights | Only
replaces `self.model` | ~80% |
| Model container | ✅ embed, fc, load_weights | Swaps layer type +
simplifies forward | ~50% |
| Decoder Layer | ✅ self_attn, mlp, quant | Adds VWN projections +
rewrites forward | ~40% |
| PreVwnLayerV1 | ❌ No counterpart | Entirely new implementation | 0%
(pure addition) |
### How was this patch tested?
- vLLM-ascend main @ 7cb4484
- vLLM version: v0.22.1
- vLLM main:
vllm-project/vllm@967c5c3
---------
Signed-off-by: YzTongNiar <1667927948@qq.com>
Co-authored-by: wu_yushan <wuyushan1@huawei.com>1 parent 16e9156 commit f6a737c
7 files changed
Lines changed: 796 additions & 2 deletions
File tree
- .github/workflows
- misc
- scripts
- tests
- e2e/pull_request/two_card/spec_decode
- ut/spec_decode
- vllm_ascend
- models
- spec_decode
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
| 460 | + | |
459 | 461 | | |
460 | 462 | | |
461 | 463 | | |
| |||
Lines changed: 100 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
327 | 335 | | |
328 | 336 | | |
329 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
0 commit comments