Commit 22d8a8d
committed
[UnitTest][NVPTX] Avoid cascading failures from CUDA postproc
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
apache#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 f14c61f commit 22d8a8d
File tree
1 file changed
+36
-47
lines changed- tests/python/unittest
1 file changed
+36
-47
lines changedLines changed: 36 additions & 47 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 | + | |
356 | 362 | | |
| 363 | + | |
| 364 | + | |
357 | 365 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | 366 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 367 | + | |
373 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
374 | 379 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
383 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
384 | 389 | | |
385 | 390 | | |
386 | 391 | | |
| |||
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
424 | | - | |
| 429 | + | |
| 430 | + | |
425 | 431 | | |
426 | 432 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | 433 | | |
432 | 434 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 435 | + | |
441 | 436 | | |
442 | 437 | | |
443 | 438 | | |
| |||
886 | 881 | | |
887 | 882 | | |
888 | 883 | | |
889 | | - | |
| 884 | + | |
| 885 | + | |
890 | 886 | | |
891 | 887 | | |
892 | 888 | | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | 889 | | |
898 | 890 | | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
| 891 | + | |
0 commit comments