@@ -57,26 +57,21 @@ def validate_against(self, optimization_combination, rule_set: _OptimizationCont
57
57
58
58
# optimization technique combinations that need to be validated
59
59
if optimization_combination .compilation and optimization_combination .speculative_decoding :
60
- copy_compilation = optimization_combination .compilation .copy ()
61
- copy_speculative_decoding = optimization_combination .speculative_decoding .copy ()
62
- if (
63
- copy_compilation .pop () and copy_speculative_decoding .pop ()
64
- ): # Check that the 2 techniques are not None
60
+ is_compiled = optimization_combination .compilation .copy ().pop ()
61
+ is_speculative_decoding = optimization_combination .speculative_decoding .copy ().pop ()
62
+ if is_compiled and is_speculative_decoding :
65
63
raise ValueError ("Compilation and Speculative Decoding together" )
66
64
67
65
if rule_set == _OptimizationContainer .TRT :
68
- if (
69
- optimization_combination .compilation
70
- and not optimization_combination .quantization_technique
71
- or not optimization_combination .compilation
72
- and optimization_combination .quantization_technique
73
- ):
66
+ is_compiled = optimization_combination .compilation .copy ().pop ()
67
+ is_quantized = optimization_combination .quantization_technique .copy ().pop ()
68
+ if is_compiled and not is_quantized or is_quantized and not is_compiled :
74
69
raise ValueError ("Compilation must be provided with Quantization" )
75
70
else :
76
- copy_compilation = optimization_combination .compilation .copy ()
77
- copy_quantization_technique = optimization_combination .quantization_technique .copy ()
71
+ is_compiled = optimization_combination .compilation .copy (). pop ()
72
+ is_quantization_technique = optimization_combination .quantization_technique .copy (). pop ()
78
73
if (
79
- copy_compilation . pop () and copy_quantization_technique . pop ()
74
+ is_compiled and is_quantization_technique
80
75
): # Check that the 2 techniques are not None
81
76
raise ValueError (
82
77
f"Compilation and Quantization:{ optimization_combination .quantization_technique .pop ()} "
@@ -99,8 +94,8 @@ def validate_against(self, optimization_combination, rule_set: _OptimizationCont
99
94
"supported_instance_families" : {"p4d" , "p4de" , "p5" , "g5" , "g6" },
100
95
"optimization_combination" : _OptimizationCombination (
101
96
optimization_container = _OptimizationContainer .VLLM ,
102
- compilation = TRUTHY_SET ,
103
- quantization_technique = {None , "awq" , "fp8" },
97
+ compilation = FALSY_SET ,
98
+ quantization_technique = {None },
104
99
speculative_decoding = TRUTHY_SET ,
105
100
sharding = TRUTHY_SET ,
106
101
),
@@ -203,8 +198,9 @@ def _validate_optimization_configuration(
203
198
optimization_combination , rule_set = _OptimizationContainer .VLLM
204
199
)
205
200
)
201
+ print ("fsdafas" )
206
202
except ValueError as vllm_compare_error :
207
- if trt_compare_error == "Compilation must be provided with Quantization" :
203
+ if str ( trt_compare_error ) == "Compilation must be provided with Quantization" :
208
204
joint_error_msg = f"""
209
205
Optimization cannot be performed for the following reasons:
210
206
- Optimizations that use { trt_compare_error } and vice-versa for GPU instances.
0 commit comments