Skip to content

Commit 6e1f33a

Browse files
committed
add 'max_model_len' as parameter
Signed-off-by: Sophie du Couédic <[email protected]>
1 parent 608ba62 commit 6e1f33a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/e2e/test_spyre_cb_scheduler_steps.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_prompts_aligned_with_tkv_boundaries(model: str, backend: str,
3333
steps_add_reqs = [0, 0, 0] # add all requests in the beginning
3434
available_blocks = -1 # no restriction
3535
max_num_seqs = 2
36+
max_model_len = 256
3637

3738
checked_steps = [
3839
{
@@ -170,6 +171,7 @@ def test_prompts_aligned_with_tkv_boundaries(model: str, backend: str,
170171
steps_add_reqs=steps_add_reqs,
171172
checked_steps=checked_steps,
172173
max_num_seqs=max_num_seqs,
174+
max_model_len=max_model_len,
173175
available_blocks=available_blocks,
174176
use_cb=True,
175177
)
@@ -197,6 +199,7 @@ def test_prompts_misaligned_with_tkv_boundaries(
197199
steps_add_reqs = [0, 0, 0] # add all requests in the beginning
198200
available_blocks = -1 # no restriction
199201
max_num_seqs = 2
202+
max_model_len = 256
200203

201204
checked_steps = [
202205
{
@@ -332,6 +335,7 @@ def test_prompts_misaligned_with_tkv_boundaries(
332335
steps_add_reqs=steps_add_reqs,
333336
checked_steps=checked_steps,
334337
max_num_seqs=max_num_seqs,
338+
max_model_len=max_model_len,
335339
available_blocks=available_blocks,
336340
use_cb=True,
337341
)
@@ -358,6 +362,7 @@ def test_two_sequences_finish_same_time_as_new_arrive(
358362
steps_add_reqs = [0, 0, 31]
359363
available_blocks = -1 # no restriction
360364
max_num_seqs = 2
365+
max_model_len = 256
361366

362367
checked_steps = [
363368
{
@@ -470,6 +475,7 @@ def test_two_sequences_finish_same_time_as_new_arrive(
470475
steps_add_reqs=steps_add_reqs,
471476
checked_steps=checked_steps,
472477
max_num_seqs=max_num_seqs,
478+
max_model_len=max_model_len,
473479
available_blocks=available_blocks,
474480
use_cb=True,
475481
)
@@ -496,6 +502,7 @@ def test_new_sequence_joins_during_decode(model: str, backend: str,
496502
steps_add_reqs = [0, 0, 32, 131]
497503
available_blocks = -1 # no restriction
498504
max_num_seqs = 4
505+
max_model_len = 256
499506

500507
checked_steps = [
501508
{
@@ -707,6 +714,7 @@ def test_new_sequence_joins_during_decode(model: str, backend: str,
707714
steps_add_reqs=steps_add_reqs,
708715
checked_steps=checked_steps,
709716
max_num_seqs=max_num_seqs,
717+
max_model_len=max_model_len,
710718
available_blocks=available_blocks,
711719
use_cb=True,
712720
)
@@ -731,6 +739,7 @@ def test_prompt_too_long_for_current_tkv(model: str, backend: str,
731739
steps_add_reqs = [0, 0]
732740
available_blocks = -1 # no restriction
733741
max_num_seqs = 2
742+
max_model_len = 256
734743

735744
checked_steps = [
736745
{
@@ -854,6 +863,7 @@ def test_prompt_too_long_for_current_tkv(model: str, backend: str,
854863
steps_add_reqs=steps_add_reqs,
855864
checked_steps=checked_steps,
856865
max_num_seqs=max_num_seqs,
866+
max_model_len=max_model_len,
857867
available_blocks=available_blocks,
858868
use_cb=True,
859869
)
@@ -879,6 +889,7 @@ def test_requested_tokens_not_fitting_remaining_space(
879889
steps_add_reqs = [0, 0, 0]
880890
available_blocks = -1 # no restriction
881891
max_num_seqs = 2
892+
max_model_len = 256
882893

883894
checked_steps = [
884895
{
@@ -1039,6 +1050,7 @@ def test_requested_tokens_not_fitting_remaining_space(
10391050
steps_add_reqs=steps_add_reqs,
10401051
checked_steps=checked_steps,
10411052
max_num_seqs=max_num_seqs,
1053+
max_model_len=max_model_len,
10421054
available_blocks=available_blocks,
10431055
use_cb=True,
10441056
)
@@ -1067,6 +1079,8 @@ def test_requests_use_all_available_blocks(model: str, backend: str,
10671079
# total number of blocks needed if scheduled together : 4 * (1 + 1) = 8
10681080
available_blocks = 8
10691081
max_num_seqs = 4
1082+
max_model_len = 256
1083+
10701084
checked_steps = [
10711085
{
10721086
"step": 0,
@@ -1170,6 +1184,7 @@ def test_requests_use_all_available_blocks(model: str, backend: str,
11701184
steps_add_reqs=steps_add_reqs,
11711185
checked_steps=checked_steps,
11721186
max_num_seqs=max_num_seqs,
1187+
max_model_len=max_model_len,
11731188
available_blocks=available_blocks,
11741189
use_cb=True,
11751190
)
@@ -1199,6 +1214,8 @@ def test_requests_use_more_than_available_blocks(
11991214
# total number of blocks needed if scheduled together : 4 * (1 + 1) = 8
12001215
available_blocks = 4
12011216
max_num_seqs = 4
1217+
max_model_len = 256
1218+
12021219
checked_steps = [
12031220
{
12041221
"step": 0,
@@ -1327,6 +1344,7 @@ def test_requests_use_more_than_available_blocks(
13271344
steps_add_reqs=steps_add_reqs,
13281345
checked_steps=checked_steps,
13291346
max_num_seqs=max_num_seqs,
1347+
max_model_len=max_model_len,
13301348
available_blocks=available_blocks,
13311349
use_cb=True,
13321350
)

tests/scheduling_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def check_scheduler_inference_steps(
4141
steps_add_reqs: list[int],
4242
checked_steps: list[dict[str, Any]],
4343
max_num_seqs: int,
44+
max_model_len: int,
4445
available_blocks: int,
4546
use_cb: bool = True,
4647
):

0 commit comments

Comments
 (0)