forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Optimize SPMD architecture with delta + serialization optimiza…
…tion (vllm-project#7109)
- Loading branch information
Showing
36 changed files
with
727 additions
and
351 deletions.
There are no files selected for viewing
This file contains 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 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 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,33 @@ | ||
import msgspec | ||
|
||
from vllm.executor.msgspec_utils import decode_hook, encode_hook | ||
from vllm.sequence import ExecuteModelRequest | ||
|
||
from ..spec_decode.utils import create_batch | ||
|
||
|
||
def test_msgspec_serialization(): | ||
num_lookahead_slots = 4 | ||
seq_group_metadata_list, _, _ = create_batch(16, num_lookahead_slots) | ||
execute_model_req = ExecuteModelRequest( | ||
seq_group_metadata_list=seq_group_metadata_list, | ||
num_lookahead_slots=num_lookahead_slots, | ||
running_queue_size=4) | ||
|
||
encoder = msgspec.msgpack.Encoder(enc_hook=encode_hook) | ||
decoder = msgspec.msgpack.Decoder(ExecuteModelRequest, | ||
dec_hook=decode_hook) | ||
req = decoder.decode(encoder.encode(execute_model_req)) | ||
expected = execute_model_req.seq_group_metadata_list | ||
actual = req.seq_group_metadata_list | ||
assert (len(expected) == len(actual)) | ||
expected = expected[0] | ||
actual = actual[0] | ||
|
||
assert expected.block_tables == actual.block_tables | ||
assert expected.is_prompt == actual.is_prompt | ||
assert expected.request_id == actual.request_id | ||
assert (expected.seq_data[0].prompt_token_ids == | ||
actual.seq_data[0].prompt_token_ids) | ||
assert (expected.seq_data[0].output_token_ids == | ||
actual.seq_data[0].output_token_ids) |
This file contains 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 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 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 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 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 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 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.