CubeK Reduce
Implements a wide variety of reduction algorithms across multiple instruction sets and hardware targets for efficient tensor reduction.
Running Tests
Important Environment Variables
Test behavior is controlled by the shared CUBE_TEST_MODE env var (see cubek-test-utils).
CUBE_TEST_MODE=Correct(default): numerical errors fail the test; compilation / hardware-incompatibility errors are accepted.CUBE_TEST_MODE=Strict: both numerical and compilation errors fail the test. Useful to surface tests that are silently skipped on your hardware.CUBE_TEST_MODE=PrintAll[:<filter>]/PrintFail[:<filter>]: print tensor elements; seecubek-test-utilsdocs.
Important Feature Flags
heavy: enables theCubereduction-routine strategy tests. They are part of the base suite on GPU backends (thecargo test-cudaand friends aliases passheavy), but too slow to run on CPU.extended: impliesheavy, and adds the full breadth of thereduce_dimmatrix: both dtypes, both output-vectorization settings, both forced plane dims, every shape configuration and the wholeksweep. Meant for large-coverage runs (before a release, for instance), so the base suite keeps one point per collapsed axis and one shape per layout class. CI never compiles theextendedtier while testing, socargo clippy -p cubek-reduce --tests --features extendedguards it separately.full: impliesextended, and enables the benchmark catalogue.
Examples
# Light suite on CUDA
# Base GPU suite: light matrix plus the Cube-strategy tests
# Full `reduce_dim` matrix
# Fail on any silently-skipped tests
CUBE_TEST_MODE=Strict