@@ -236,3 +236,71 @@ def test_check_torchair_supported(self):
236
236
for model_type , expected_output in test_cases :
237
237
self .assertEqual (_check_torchair_supported (model_type ),
238
238
expected_output )
239
+
240
+ @_clean_up_ascend_config
241
+ def test_ascend_config_load_error (self ):
242
+ test_vllm_config = VllmConfig ()
243
+ # graph_batch_sizes should be list.
244
+ with self .assertRaises (TypeError ):
245
+ test_vllm_config .additional_config = {
246
+ "torchair_graph_config" : {
247
+ "graph_batch_sizes" : "fake_size" ,
248
+ },
249
+ "refresh" : True
250
+ }
251
+ init_ascend_config (test_vllm_config )
252
+
253
+ # use_cached_graph should not be enabled without torchair graph mode
254
+ with self .assertRaises (RuntimeError ):
255
+ test_vllm_config .additional_config = {
256
+ "torchair_graph_config" : {
257
+ "enabled" : False ,
258
+ "use_cached_graph" : True ,
259
+ },
260
+ "refresh" : True
261
+ }
262
+ init_ascend_config (test_vllm_config )
263
+
264
+ # graph_batch_sizes_init should not be enabled without torchair graph mode
265
+ with self .assertRaises (RuntimeError ):
266
+ test_vllm_config .additional_config = {
267
+ "torchair_graph_config" : {
268
+ "enabled" : False ,
269
+ "graph_batch_sizes_init" : True ,
270
+ },
271
+ "refresh" : True
272
+ }
273
+ init_ascend_config (test_vllm_config )
274
+
275
+ # enable_multistream_mla should not be enabled without torchair graph mode
276
+ with self .assertRaises (RuntimeError ):
277
+ test_vllm_config .additional_config = {
278
+ "torchair_graph_config" : {
279
+ "enabled" : False ,
280
+ "enable_multistream_mla" : True ,
281
+ },
282
+ "refresh" : True
283
+ }
284
+ init_ascend_config (test_vllm_config )
285
+
286
+ # enable_multistream_moe should not be enabled without torchair graph mode
287
+ with self .assertRaises (RuntimeError ):
288
+ test_vllm_config .additional_config = {
289
+ "torchair_graph_config" : {
290
+ "enabled" : False ,
291
+ "enable_multistream_moe" : True ,
292
+ },
293
+ "refresh" : True
294
+ }
295
+ init_ascend_config (test_vllm_config )
296
+
297
+ # enable_kv_nz should not be enabled without torchair graph mode
298
+ with self .assertRaises (RuntimeError ):
299
+ test_vllm_config .additional_config = {
300
+ "torchair_graph_config" : {
301
+ "enabled" : False ,
302
+ "enable_kv_nz" : True ,
303
+ },
304
+ "refresh" : True
305
+ }
306
+ init_ascend_config (test_vllm_config )
0 commit comments