@@ -450,6 +450,7 @@ def test_load_model_weights_inplace(dist_init, model_runner, model_runner_2):
450
450
451
451
452
452
def test_init_kv_cache_with_kv_sharing_invalid_target_layer_order ():
453
+ torch .set_default_dtype (torch .float16 )
453
454
layer_0 = "model.layers.0.self_attn.attn"
454
455
layer_1 = "model.layers.1.self_attn.attn"
455
456
error_msg = f"{ layer_1 } must come before the current layer"
@@ -478,6 +479,7 @@ def test_init_kv_cache_with_kv_sharing_invalid_target_layer_order():
478
479
479
480
480
481
def test_init_kv_cache_with_kv_sharing_target_layer_not_exist ():
482
+ torch .set_default_dtype (torch .float16 )
481
483
layer_0 = "model.layers.0.self_attn.attn"
482
484
layer_1 = "model.layers.1.self_attn.attn"
483
485
invalid_layer = "model.layers.0.cross_attn.attn"
@@ -506,6 +508,7 @@ def test_init_kv_cache_with_kv_sharing_target_layer_not_exist():
506
508
507
509
508
510
def test_init_kv_cache_with_kv_sharing_target_same_as_current ():
511
+ torch .set_default_dtype (torch .float16 )
509
512
layer_0 = "model.layers.0.self_attn.attn"
510
513
layer_1 = "model.layers.1.self_attn.attn"
511
514
error_msg = f"{ layer_1 } cannot be the same as the current layer"
@@ -534,6 +537,7 @@ def test_init_kv_cache_with_kv_sharing_target_same_as_current():
534
537
535
538
536
539
def test_init_kv_cache_without_kv_sharing ():
540
+ torch .set_default_dtype (torch .float16 )
537
541
layer_0 = "model.layers.0.self_attn.attn"
538
542
layer_1 = "model.layers.1.self_attn.attn"
539
543
vllm_config = get_vllm_config ()
@@ -601,6 +605,7 @@ def test_init_kv_cache_without_kv_sharing():
601
605
602
606
603
607
def test_init_kv_cache_with_kv_sharing_valid ():
608
+ torch .set_default_dtype (torch .float16 )
604
609
layer_0 = "model.layers.0.self_attn.attn"
605
610
layer_1 = "model.layers.1.self_attn.attn"
606
611
vllm_config = get_vllm_config ()
0 commit comments