[NFC] FileCheck tests check all overloads#354
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test 66f2f8c |
numba_cuda/numba/cuda/testing.py
Outdated
| check_prefixes=check_prefixes, | ||
| **extra_filecheck_options, | ||
| ir_contents = self._getIRContent(ir_producer.inspect_asm(), signature) | ||
| assert ir_contents |
There was a problem hiding this comment.
Hitting a bare assert is usually not the nicest debug experience. What is this guarding against?
There was a problem hiding this comment.
That the IR given to us by the user was not empty - Are assertions in the assert methods of a test case still used to indicate a violated precondition, and self.fail/skip is used to indicate the result of the assertion represented by the method? Assuming so, I just added messages to these assertions. Please let me know if you had something else in mind.
Now we've switched over to pytest, it might be nice to add an option with https://docs.pytest.org/en/stable/reference/reference.html#pytest.hookspec.pytest_addoption so that user can run e.g.: I don't think the name of the file should be hardcoded - perhaps file names could be derived from the name of the test case (and potentially suffixed with a numeric index if there is a name clash due to things like subtests? |
I love this suggestion. I added it in the latest revision, so now the failing IR and checks are dumped to files like this: |
23ddaab to
67642ed
Compare
|
/ok to test 67642ed |
|
/ok to test 67642ed |
|
/ok to test 49a007a |
One idea of separating them from one test run from another is placing the dump files in a folder named I think isolation is necessary when |
I like that idea! Feel free to let me know what's most intuitive and I'll do it. If I had to guess, I think the workflow will look like this:
I don't envision myself needing to keep multiple directories with IR dumps from failing tests. I think a directory with a timestamp in the name would be a great way to accomplish that though. |
|
@ashermancinelli The workflow sounds right. I think my original language is misleading as "second level interval" is not referring to multiple directories. I meant using second as the smallest time interval may not be sufficient as |
|
Okay, the IR is now dumped in this format on error: It is very verbose, but we will be unlikely to see collisions. Thanks for the review @isVoid! |
|
/ok to test 10e93cc |
On failure, IR is dumped to a directory based on the current date and time and the file is based on the test name. This way, the IR is preserved between failures and multiple failures in parallel in different tests do not cause collisions.
10e93cc to
d41fb5e
Compare
|
/ok to test d41fb5e |
|
/ok to test b0bed24 |
| _ = ir_file.write(ir_content + "\n") | ||
| _ = checks_file.write(check_patterns) |
There was a problem hiding this comment.
I'm a little confused here: if you don't want the return value, why assign it?
|
I forgot to mention - I think the dumps for subtests will still overwrite each other if they don't form part of the test's |
- [NFC] FileCheck tests check all overloads (NVIDIA#354) - [REVIEW][NFC] Vendor in serialize to allow for future CUDA-specific refactoring and changes (NVIDIA#349) - Vendor in usecases used in testing (NVIDIA#359) - Add thirdparty tests of numba extensions (NVIDIA#348) - Support running tests in parallel (NVIDIA#350) - Add more debuginfo tests (NVIDIA#358) - [REVIEW][NFC] Vendor in the Cache, CacheImpl used by CUDACache and CUDACacheImpl to allow for future CUDA-specific refactoring and changes (NVIDIA#334) - [NFC] Vendor in Dispatcher as CUDADispatcher to allow for future CUDA-specific customization (NVIDIA#338) - Vendor in BaseNativeLowering and BaseLower for CUDA-specific customizations (NVIDIA#329) - [REVIEW] Vendor in the CompilerBase used by CUDACompiler to allow for future CUDA-specific refactoring and changes (NVIDIA#322) - Vendor in Codegen and CodeLibrary for CUDA-specific customization (NVIDIA#327) - Disable tests that deadlock due to NVIDIA#317 (NVIDIA#356) - FIX: Add type check for shape elements in DeviceNDArrayBase constructor (NVIDIA#352) - Merge pull request NVIDIA#265 from lakshayg/fp16-support - Add performance warning - Fix tests - Create and register low++ bindings for float16 - Create typing/target registries for float16 - Replace Numbast generated lower_casts - Replace Numbast generated operators - Alias __half to numba.core.types.float16 - Generate fp16 bindings using numbast - Remove existing fp16 logic - [REVIEW][NFC] Vendor in the utils and cgutils to allow for future CUDA-specific refactoring and changes (NVIDIA#340) - [RFC,TESTING] Add filecheck test infrastructure (NVIDIA#342) - Migrate test infra to pytest (NVIDIA#347) - Add .vscode to gitignore (NVIDIA#344) - [NFC] Add dev dependencies to project config (NVIDIA#341) - Allow Inspection of Link-Time Optimized PTX (NVIDIA#326) - [NFC] Vendor in DIBuilder used by CUDADIBuilder (NVIDIA#332) - Add guidance on setting up pre-commit (NVIDIA#339) - [Refactor][NFC] Vendor in MinimalCallConv (NVIDIA#333) - [Refactor][NFC] Vendor in BaseCallConv (NVIDIA#324) - [REVIEW] Vendor in CompileResult as CUDACompileResult to allow for future CUDA-specific customizations (NVIDIA#325)
- [NFC] FileCheck tests check all overloads (#354) - [REVIEW][NFC] Vendor in serialize to allow for future CUDA-specific refactoring and changes (#349) - Vendor in usecases used in testing (#359) - Add thirdparty tests of numba extensions (#348) - Support running tests in parallel (#350) - Add more debuginfo tests (#358) - [REVIEW][NFC] Vendor in the Cache, CacheImpl used by CUDACache and CUDACacheImpl to allow for future CUDA-specific refactoring and changes (#334) - [NFC] Vendor in Dispatcher as CUDADispatcher to allow for future CUDA-specific customization (#338) - Vendor in BaseNativeLowering and BaseLower for CUDA-specific customizations (#329) - [REVIEW] Vendor in the CompilerBase used by CUDACompiler to allow for future CUDA-specific refactoring and changes (#322) - Vendor in Codegen and CodeLibrary for CUDA-specific customization (#327) - Disable tests that deadlock due to #317 (#356) - FIX: Add type check for shape elements in DeviceNDArrayBase constructor (#352) - Merge pull request #265 from lakshayg/fp16-support - Add performance warning - Fix tests - Create and register low++ bindings for float16 - Create typing/target registries for float16 - Replace Numbast generated lower_casts - Replace Numbast generated operators - Alias __half to numba.core.types.float16 - Generate fp16 bindings using numbast - Remove existing fp16 logic - [REVIEW][NFC] Vendor in the utils and cgutils to allow for future CUDA-specific refactoring and changes (#340) - [RFC,TESTING] Add filecheck test infrastructure (#342) - Migrate test infra to pytest (#347) - Add .vscode to gitignore (#344) - [NFC] Add dev dependencies to project config (#341) - Allow Inspection of Link-Time Optimized PTX (#326) - [NFC] Vendor in DIBuilder used by CUDADIBuilder (#332) - Add guidance on setting up pre-commit (#339) - [Refactor][NFC] Vendor in MinimalCallConv (#333) - [Refactor][NFC] Vendor in BaseCallConv (#324) - [REVIEW] Vendor in CompileResult as CUDACompileResult to allow for future CUDA-specific customizations (#325)
TODO:
conftest.py.