@@ -54,11 +54,12 @@ def test_run_with_ascend_config():
54
54
# torchair graph only works with deepseek. The e2e test should be added
55
55
# in multicard test with deepseek models.
56
56
"enabled" : False ,
57
- "use_cached_graph" : True ,
58
- "graph_batch_sizes" : [1 , 2 , 4 , 8 ],
57
+ "use_cached_graph" : False ,
58
+ "graph_batch_sizes" : [],
59
59
"graph_batch_sizes_init" : False ,
60
- "enable_multistream_moe" : True ,
61
- "enable_multistream_mla" : True ,
60
+ "enable_multistream_moe" : False ,
61
+ "enable_multistream_mla" : False ,
62
+ "enable_view_optimize" : False ,
62
63
},
63
64
"ascend_scheduler_config" : {
64
65
"enabled" : True ,
@@ -73,13 +74,12 @@ def test_run_with_ascend_config():
73
74
ascend_config = get_ascend_config ()
74
75
75
76
assert not ascend_config .torchair_graph_config .enabled
76
- assert ascend_config .torchair_graph_config .use_cached_graph
77
- assert ascend_config .torchair_graph_config .graph_batch_sizes == [
78
- 1 , 2 , 4 , 8
79
- ]
77
+ assert not ascend_config .torchair_graph_config .use_cached_graph
78
+ assert ascend_config .torchair_graph_config .graph_batch_sizes == []
80
79
assert not ascend_config .torchair_graph_config .graph_batch_sizes_init
81
- assert ascend_config .torchair_graph_config .enable_multistream_mla
82
- assert ascend_config .torchair_graph_config .enable_multistream_moe
80
+ assert not ascend_config .torchair_graph_config .enable_multistream_mla
81
+ assert not ascend_config .torchair_graph_config .enable_multistream_moe
82
+ assert not ascend_config .torchair_graph_config .enable_view_optimize
83
83
assert ascend_config .ascend_scheduler_config .enabled
84
84
assert ascend_config .ascend_scheduler_config .enable_chunked_prefill
85
85
@@ -142,6 +142,58 @@ def test_ascend_config_load_error():
142
142
additional_config = input_additional_config_fake_3 ):
143
143
pass
144
144
145
+ # use_cached_graph should not be enabled without torchair graph mode
146
+ with pytest .raises (RuntimeError ):
147
+ input_additional_config_fake_4 = {
148
+ "torchair_graph_config" : {
149
+ "enabled" : False ,
150
+ "use_cached_graph" : True ,
151
+ },
152
+ }
153
+ with VllmRunner ("facebook/opt-125m" ,
154
+ enforce_eager = True ,
155
+ additional_config = input_additional_config_fake_4 ):
156
+ pass
157
+
158
+ # graph_batch_sizes_init should not be enabled without torchair graph mode
159
+ with pytest .raises (RuntimeError ):
160
+ input_additional_config_fake_5 = {
161
+ "torchair_graph_config" : {
162
+ "enabled" : False ,
163
+ "graph_batch_sizes_init" : True ,
164
+ },
165
+ }
166
+ with VllmRunner ("facebook/opt-125m" ,
167
+ enforce_eager = True ,
168
+ additional_config = input_additional_config_fake_5 ):
169
+ pass
170
+
171
+ # enable_multistream_mla should not be enabled without torchair graph mode
172
+ with pytest .raises (RuntimeError ):
173
+ input_additional_config_fake_6 = {
174
+ "torchair_graph_config" : {
175
+ "enabled" : False ,
176
+ "enable_multistream_mla" : True ,
177
+ },
178
+ }
179
+ with VllmRunner ("facebook/opt-125m" ,
180
+ enforce_eager = True ,
181
+ additional_config = input_additional_config_fake_6 ):
182
+ pass
183
+
184
+ # enable_multistream_moe should not be enabled without torchair graph mode
185
+ with pytest .raises (RuntimeError ):
186
+ input_additional_config_fake_7 = {
187
+ "torchair_graph_config" : {
188
+ "enabled" : False ,
189
+ "enable_multistream_moe" : True ,
190
+ },
191
+ }
192
+ with VllmRunner ("facebook/opt-125m" ,
193
+ enforce_eager = True ,
194
+ additional_config = input_additional_config_fake_7 ):
195
+ pass
196
+
145
197
146
198
@_clean_up_ascend_config
147
199
def test_check_ascend_config_v0 ():
@@ -168,9 +220,7 @@ def test_ascend_config_refresh():
168
220
input_additional_config = {
169
221
"torchair_graph_config" : {
170
222
"enabled" : False ,
171
- "use_cached_graph" : True ,
172
- "graph_batch_sizes" : [1 , 2 , 4 , 8 ],
173
- "graph_batch_sizes_init" : False ,
223
+ "enable_view_optimize" : False
174
224
},
175
225
"refresh" : True ,
176
226
}
@@ -180,9 +230,4 @@ def test_ascend_config_refresh():
180
230
additional_config = input_additional_config ):
181
231
ascend_config = get_ascend_config ()
182
232
183
- assert not ascend_config .torchair_graph_config .enabled
184
- assert ascend_config .torchair_graph_config .use_cached_graph
185
- assert ascend_config .torchair_graph_config .graph_batch_sizes == [
186
- 1 , 2 , 4 , 8
187
- ]
188
- assert not ascend_config .torchair_graph_config .graph_batch_sizes_init
233
+ assert not ascend_config .torchair_graph_config .enable_view_optimize
0 commit comments