Commit 0bb390b
authored
[UnitTest][NVPTX] Avoid cascading failures from CUDA postproc (#15136)
Prior to this commit, the tests in
`test_tir_transform_inject_ptx_async_copy.py` registered the
`"tvm_callback_cuda_postproc"` function during pytest collection, and
used a global variable to disable its functionality outside of the
tests in this file. This had two major issues. First, if any other
test also installs a postproc function, these postproc function
required by the NVPTX tests would be overwritten. Second, if one of
the NTPTX tests fails, the global variable controlling the postproc
function would not be reset, causing any subsequent CUDA-related tests
to also fail.
This commit updates these NVPTX tests to conditionally install the
postproc function, to de-register it after the test instead of
disabling its functionality, and to de-register it regardless of the
test result.
This issue was initially found when debugging
#15103, when a failure in
`test_tir_transform_inject_ptx_async_copy.py::test_cp_async_in_if_then_else`
caused failures in 32 unrelated tests ([CI
link](https://ci.tlcpack.ai/blue/organizations/jenkins/tvm-gpu/detail/PR-15103/7/tests)).1 parent c928852 commit 0bb390b
1 file changed
Lines changed: 51 additions & 46 deletions
Lines changed: 51 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
351 | 354 | | |
352 | 355 | | |
353 | 356 | | |
354 | | - | |
355 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
356 | 393 | | |
| 394 | + | |
357 | 395 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
373 | 401 | | |
374 | 402 | | |
375 | 403 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 404 | + | |
384 | 405 | | |
385 | 406 | | |
386 | 407 | | |
| |||
422 | 443 | | |
423 | 444 | | |
424 | 445 | | |
| 446 | + | |
425 | 447 | | |
426 | 448 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | 449 | | |
432 | 450 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 451 | + | |
441 | 452 | | |
442 | 453 | | |
443 | 454 | | |
| |||
887 | 898 | | |
888 | 899 | | |
889 | 900 | | |
| 901 | + | |
890 | 902 | | |
891 | 903 | | |
892 | 904 | | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | 905 | | |
898 | 906 | | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
| 907 | + | |
0 commit comments