-
Notifications
You must be signed in to change notification settings - Fork 294
[hipDNN] Migrate golden reference system into integration tests #7480
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
Open
bghimireamd
wants to merge
6
commits into
develop
Choose a base branch
from
users/bghimire/ALMIOPEN-1944/migrate-golden-ref-to-integration-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d1ae7c9
[hipDNN] ALMIOPEN-1944 Migrate golden reference system into integrati…
bghimireamd 2447dfc
[hipDNN] ALMIOPEN-1944 Remove golden ref originals from test_sdk
bghimireamd e5d3101
[hipDNN] ALMIOPEN-1944 Move reference data and generation scripts to …
bghimireamd bf8d268
[hipDNN] ALMIOPEN-1944 Guard install of reference data for standalone…
bghimireamd eb47cac
[hipDNN] ALMIOPEN-1944 Update pre-commit exclusion for relocated refe…
bghimireamd 7405baf
[hipDNN] ALMIOPEN-1944 Add .gitattributes to protect binary reference…
bghimireamd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
dnn-providers/integration-tests/hipdnn_reference_data/.gitattributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.bin binary |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...ation-tests/src/integration_tests/batchnorm/IntegrationGoldenRefBatchnormFwdInference.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| // Copyright © Advanced Micro Devices, Inc., or its affiliates. | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| #ifndef HIPDNN_FLATBUFFERS_SDK_SKIP_JSON_LIB | ||
|
|
||
| #include <gtest/gtest.h> | ||
|
|
||
| #include <hipdnn_data_sdk/types.hpp> | ||
| #include <hipdnn_test_sdk/utilities/TestTolerances.hpp> | ||
|
|
||
| #include "harness/GoldenReferenceCpu.hpp" | ||
|
|
||
| using namespace hipdnn_integration_tests; | ||
| using namespace hipdnn_data_sdk::types; | ||
| using namespace hipdnn_test_sdk::utilities; | ||
|
|
||
| template <class T> | ||
| class TestCpuBatchnormFwdInferenceGoldenReference : public TestGoldenReferenceCpu | ||
| { | ||
| public: | ||
| void testSuite() | ||
| { | ||
| return goldenReferenceTestSuite(batchnorm::getToleranceInference<T>(), | ||
| batchnorm::getToleranceInference<T>()); | ||
| } | ||
| }; | ||
|
|
||
| class TestCpuBatchnormFwdInferenceGoldenReferenceNchwFp32 | ||
| : public TestCpuBatchnormFwdInferenceGoldenReference<float> | ||
| { | ||
| }; | ||
|
|
||
| class TestCpuBatchnormFwdInferenceGoldenReferenceNchwFp16 | ||
| : public TestCpuBatchnormFwdInferenceGoldenReference<half> | ||
| { | ||
| }; | ||
|
|
||
| class TestCpuBatchnormFwdInferenceGoldenReferenceNchwBfp16 | ||
| : public TestCpuBatchnormFwdInferenceGoldenReference<bfloat16> | ||
| { | ||
| }; | ||
|
|
||
| class TestCpuBatchnormFwdInferenceGoldenReferenceNcdhwFp32 | ||
| : public TestCpuBatchnormFwdInferenceGoldenReference<float> | ||
| { | ||
| }; | ||
|
|
||
| // Nchw Fp32------------ | ||
| TEST_P(TestCpuBatchnormFwdInferenceGoldenReferenceNchwFp32, Correctness) | ||
| { | ||
| testSuite(); | ||
| } | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(, | ||
| TestCpuBatchnormFwdInferenceGoldenReferenceNchwFp32, | ||
| getGoldenReferenceParams("BatchnormFwdInference/nchw/fp32")); | ||
|
|
||
| // Nchw Fp16------------ | ||
| TEST_P(TestCpuBatchnormFwdInferenceGoldenReferenceNchwFp16, Correctness) | ||
| { | ||
| testSuite(); | ||
| } | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(, | ||
| TestCpuBatchnormFwdInferenceGoldenReferenceNchwFp16, | ||
| getGoldenReferenceParams("BatchnormFwdInference/nchw/fp16")); | ||
|
|
||
| // Nchw Bfp16------------ | ||
| TEST_P(TestCpuBatchnormFwdInferenceGoldenReferenceNchwBfp16, Correctness) | ||
| { | ||
| testSuite(); | ||
| } | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(, | ||
| TestCpuBatchnormFwdInferenceGoldenReferenceNchwBfp16, | ||
| getGoldenReferenceParams("BatchnormFwdInference/nchw/bfp16")); | ||
|
|
||
| // Ncdhw Fp32------------ | ||
| TEST_P(TestCpuBatchnormFwdInferenceGoldenReferenceNcdhwFp32, Correctness) | ||
| { | ||
| testSuite(); | ||
| } | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(, | ||
| TestCpuBatchnormFwdInferenceGoldenReferenceNcdhwFp32, | ||
| getGoldenReferenceParams("BatchnormFwdInference/ncdhw/fp32")); | ||
|
|
||
| #endif // HIPDNN_FLATBUFFERS_SDK_SKIP_JSON_LIB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,12 +114,18 @@ set(HIPDNN_TEST_REFERENCE_DIR "${CMAKE_BINARY_DIR}/lib/hipdnn_reference_data" | |
| set(HIPDNN_TEST_REFERENCE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" | ||
| CACHE INTERNAL "Install directory for test reference data" | ||
| ) | ||
| file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/hipdnn_reference_data/" | ||
| DESTINATION ${HIPDNN_TEST_REFERENCE_DIR} | ||
| ) # Copies only on calls to cmake | ||
| install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/hipdnn_reference_data" | ||
| DESTINATION ${HIPDNN_TEST_REFERENCE_INSTALL_DIR} | ||
| ) | ||
| set(_hipdnn_ref_data_src | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this belong here anymore? should it just be in the integration-tests project? |
||
| "${CMAKE_SOURCE_DIR}/dnn-providers/integration-tests/hipdnn_reference_data") | ||
| if(EXISTS "${_hipdnn_ref_data_src}") | ||
| file(COPY "${_hipdnn_ref_data_src}/" | ||
| DESTINATION ${HIPDNN_TEST_REFERENCE_DIR} | ||
| ) | ||
| endif() | ||
| if(EXISTS "${HIPDNN_TEST_REFERENCE_DIR}") | ||
| install(DIRECTORY "${HIPDNN_TEST_REFERENCE_DIR}" | ||
| DESTINATION ${HIPDNN_TEST_REFERENCE_INSTALL_DIR} | ||
| ) | ||
| endif() | ||
|
|
||
| # Migrate HIP_DNN_BUILD_BACKEND -> HIPDNN_BUILD_BACKEND | ||
| if(DEFINED HIP_DNN_BUILD_BACKEND) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably mention this only copies at configure time.