cudnn-frontend icon indicating copy to clipboard operation
cudnn-frontend copied to clipboard

CUDNN_FRONTEND_BUILD_UNIT_TESTS option is broken

Open iskunk opened this issue 1 year ago • 2 comments

When I configure with -DCUDNN_FRONTEND_BUILD_UNIT_TESTS=ON, I get

CMake Error at CMakeLists.txt:49 (add_subdirectory):
  The source directory

    /path/to/cudnn-frontend/1.1.0/test

  does not contain a CMakeLists.txt file.

Is the test/ directory supposed to have some content that comes from somewhere else?

iskunk avatar Feb 19 '24 21:02 iskunk

Hi @iskunk ,

Thanks for reporting this. At this point the UNIT_TESTS are internally being used to test. Hence we do not support that switch publicly. Rather we have tests in the samples/cpp folder which are user facing and more informative.

Let us know, if you have any particular need for UNIT_TESTS and/or any samples that you would like to be added.

Thanks

Anerudhan avatar Feb 20 '24 06:02 Anerudhan

In that case, I would suggest naming the switch something like CUDNN_FRONTEND_BUILD_INTERNAL_TESTS, along with appropriate description/comment verbiage, to make clear that it is not intended for use outside of Nvidia. It is common for OSS projects to provide unit tests, and an option to build/run them, so the current situation looks like an oversight to a third party.

Assuming that the samples program is intended to be the test suite for external users, I would also suggest adding this bit to samples/CMakeLists.txt:

add_custom_target(test COMMAND samples "\\*")

This way, running make test will invoke the test suite, per convention, returning an error if anything fails. (AFAICT, passing in a literal asterisk is how one requests all tests to be run? Please correct me if not.)

iskunk avatar Feb 20 '24 21:02 iskunk