Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional unit testing for run-to-run bitwise reproducibility
Currently, we have tests that verify that the deterministic algorithms for scan and reduce (available via the det and par__det_nosync execution policies) produce the same results when run twice in a row within the same test executable. This change adds new bitwise reproducibility testing that is performed across multiple test executable runs. To do this, the test executable must be run twice. On the first run, we hash all the inputs and outputs to/from the deterministic function calls, and store those hashes in an SQLite database. We also insert information about the ROCm version, rocThrust version, and GPU architecture, into the database, since the results the deterministic algorithms produce are allowed to vary if any those factors change. On the second run, we hash the inputs/output again and check to see if a row matching them (plus the ROCm version, rocThrust version etc.) exists in the database. This change: - Adds SQLite as a dependency in the CMake files. SQLite code is public domain. - Adds a library called CRCpp as a dependency in the CMake files. This library provides a checksum algorithm that we can use for hashing. It uses a BSD 3-clause license. - Add the database-based testing to the existing reproducibility tests in test/test_reproducibility.cpp - Adds classes for database creation/manipulation and building hashes in tests/bitwise_repro/ Because the run-to-run testing accesses a disk-based database file, it's pretty slow, so I've disabled it by default. To turn it on, you must define an environment variable called ROCTHRUST_BWR_PATH and set it to the path to the SQLite database file to use for the testing. If the database does not exist, to generate it, you must also define an environment variable called ROCTHRUST_BWR_GENERATE and set it to 1. This creates the database file given by ROCTHRUST_BWR_PATH and inserts data into it as the run-to-run reproducibility tests are executed (the tests will all pass in this case). If you want to take an existing database and update it for a new ROCm version/rocThrust version/GPU architecture, you can set ROCTHRUST_BWR_GENERATE=1 and point ROCTHRUST_BWR_PATH to the existing database file.
- Loading branch information