Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting test cases from mock tests to proper tests for testZfpCuda4d<datatype> #235

Open
JanLJL opened this issue Jul 2, 2024 · 3 comments

Comments

@JanLJL
Copy link

JanLJL commented Jul 2, 2024

Hi,

I enhanced ZFP to also support 4D arrays for CUDA and would like to open a PR soon to merge this into the main project.
However, I see when running the tests (built with -DBUILD_TESTING_FULL=ON ) that for the 4D case, the test suite seems to run mock tests for the CUDA 4D cases and assert 0x0 due to the fact this functionality wasn't implemented previously.

I don't have much experience with GoogleTest and find the whole structure of the tests a bit confusing, can you point me to the right files/lines of code I have to adjust so the tests are testing against the actual checksum?

Thanks and best,
Jan

@lindstro
Copy link
Member

lindstro commented Jul 2, 2024

@JanLJL Thanks for your contribution. Let me begin by pointing out that we're in the midst of making significant changes to the CUDA (and HIP) implementation on the staging branch, so we likely would have to manually merge any PR you submit now by extracting the relevant extensions to 4D. It may make sense to hold off until the staging branch is in better shape. This branch will eventually be merged into develop (hopefully in the next couple of months); maybe then we'll be in a better position to pick up your work.

I should also point out that the work on staging will additionally support the fixed-precision and fixed-accuracy variable-rate compression modes; I assume what you have now supports only the fixed-rate mode. We'd have to look at how much extra work would be required to support the 4D variable-rate modes.

Regarding testing, which should not be impacted at all by the work being done on staging, CUDA tests use the cmocka framework, not GoogleTest. You'll find the no-op test here:

#if DIMS == 4
static void
_catFunc3(given_Cuda_, DIM_INT_STR, Array_when_ZfpCompressDecompress_expect_BitstreamUntouchedAndReturnsZero)(void **state)
{
runCompressDecompressNoopTest(state, zfp_mode_fixed_rate);
}
#endif

You'll also need changes here:

There are also dimension-specific source files testCuda4d*.c in https://github.com/LLNL/zfp/tree/develop/tests/src/endtoend.

Some of the test code has been written to be dimension and execution policy independent, so hopefully adding proper 4D CUDA tests could be done fairly painlessly. But it's been long enough since I worked on those tests that I'm not sure how much effort is involved.

There's also a new testexec test on staging, which performs additional compression tests of the various execution policies using the serial policy as ground truth. Currently only 1D-3D are supported, though the generalization should be trivial.

@JanLJL
Copy link
Author

JanLJL commented Jul 9, 2024

Hi Peter,
thanks for the extensive answer!
I'm a bit surprised you mentioned the staging branch because the last commit there is from March 2023, so more than a year ago; is there any way to work with the most current version of ZFP for GPUs to test performance?

@lindstro
Copy link
Member

lindstro commented Jul 9, 2024

I'm hoping to push some more recent work but am reluctant to do so until the code compiles and runs. Currently, the code is in a broken state, which is not very helpful to you. I'm hoping to get to that point in the next couple of weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants