This document outlines the comprehensive testing strategy for hipDNN, covering unit tests(white box testing), integration tests (black box testing, api tests, and end to end tests), and performance/benchmarking.
Please refer to the coding standards in Coding Style and Naming Guidelines to see test naming conventions we follow.
White box tests focus on internal implementation details of hipDNN components.
| Component | Location | Purpose | GPU Testing | Environments |
|---|---|---|---|---|
| Backend | backend/tests/ |
Test internal implementation of hipDNN backend | Minimal/None | Windows & Linux |
| Frontend | frontend/tests/ |
Test internal implementation of hipDNN frontend | Minimal/None | Windows & Linux |
| SDK | sdk/tests/ |
Test internal implementation of hipDNN SDK | Minimal/None expected | Windows & Linux |
| Plugin | plugins/<name>/tests/ |
Test internal implementation of specific plugin | Minimal & fast | Windows & Linux |
Note: If a test depends on the GPU then it needs to be marked with SKIP_IF_NO_DEVICE() so tests run and pass correctly on CPU only machines.
- Descriptors
- Plugin system
- Error handling
- Backend utilities
- Handle
- Graph extensions
- Attribute
- Node
- Graph construction & flow
- Frontend utilities
- Plugins
- Data objects
- Logging
- SDK utilities
- Reference implementations
- TBD based on plugin implementation
- See the recommended implementation in Plugin Development
- Mocking: Use GMOCK for mocking dependencies
- Execution: Fast execution required
- Isolation: Use stubbed/mocked implementations for dependencies
- GPU Operations: Must be marked with
SKIP_IF_NO_DEVICE() - Coverage: Each component should maintain >80% code coverage
Black box tests validate the public API without knowledge of internal implementation. These are a type of integration test.
| Attribute | Details |
|---|---|
| Location | tests/backend/ |
| Purpose | Validate API of hipDNN backend works as expected |
| Requirements | • Test only public interfaces from backend/include/• Use stubbed plugins for controlled testing • Fast running • GPU operations marked with SKIP_IF_NO_DEVICE() |
| Environments | Windows & supported Linux distros |
| Frequency | Run on each PR |
- Descriptor APIs (create, get/set properties, destroy)
- Engine API
- Engine config API
- Engine heuristic API
- Execution plan API
- Handle API
- Variant pack API
- Graph API
- Graph extension API for serialized graph structures
- Backend execute API
- Plugin management extension API
- Logging extension API
Integration tests validate end-to-end functionality across components.
| Test Type | Location | Purpose | GPU Required | Test Speed | Environments |
|---|---|---|---|---|---|
| Frontend-Backend | tests/frontend/ |
Validate end-to-end hipDNN functionality | No - mark GPU ops with SKIP_IF_NO_DEVICE() |
Fast | Windows & Linux |
| Plugin Integration | plugins/<name>/integration_tests/ |
Validate end-to-end graph support for plugin | Yes - required for validation | Can be slower | Windows & Linux |
- Use fake plugins for controlled behavior
- No accuracy/solution validation (stubbed)
- Test graph creation and execution API
- Test backend descriptor creation from frontend
- Test execution flow validation
- Validate correctness and graph support
- Each plugin maintains its own test suite
- Test on all ASICs supported by the plugin
- Target: 80% overall coverage
- Component Target: Each sub-section should be above 80% individually
- Enforcement: Coverage must remain above 80% for PRs to be accepted
Tests must work in the following environments:
| Environment Type | Supported Methods |
|---|---|
| CLI Build Environment | ninja check, ninja check_ctest |
| IDE | Visual Studio Code and extensions like TestMate |
| Artifacts | • Installed testing artifacts • Running built test executables |
| Operating System | • Windows • Supported Linux distros |
Tip
ninja unit-check runs fast, isolated unit and API tests.
ninja integration-check runs slower, end-to-end integration tests.
- Without GPU: All GPU tests must be skippable (warnings, not errors)
- With GPU: Tests should detect and utilize available GPU resources
- Platform Support: Windows & supported Linux distributions
For each PR, the latest commit must pass every CI pipeline listed in the Test Plan.
See the Roadmap for status of the upcoming performance benchmarking project, which will track performance of hipDNN and installed plugins across a broad set of graphs.