-
Notifications
You must be signed in to change notification settings - Fork 5
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
RPP Test Suite Upgrade - CSV to Binary Conversion #222
RPP Test Suite Upgrade - CSV to Binary Conversion #222
Conversation
HazarathKumarM
commented
Jan 24, 2024
- merge golden outputs as a single binary file instead off multiple CSV files
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.
@HazarathKumarM Please address comments.
outputTempRef = refOutput + imageCnt * refOutputSize; | ||
int height = dstImgSizes[imageCnt].height; | ||
int width = dstImgSizes[imageCnt].width; | ||
int matched_idx = 0; |
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.
This variable alone is in snake case
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.
Done
std::cerr << "File is empty"; | ||
|
||
fseek(fp, 0, SEEK_SET); | ||
Rpp8u *binary_content = (Rpp8u *)malloc(fsize); |
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.
Where is the free? Also please check if we already know the size 150x150x3 or something, can we allocate static?
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.
for some cases we don't have PLN1 support , for that cases we will be allocating more memory if we follow the static allocation
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 be fine i feel
The size of 3x150x150x3 is less than a MB
compare_outputs_pkd(output, refOutput, dstDescPtr, dstImgSizes, refOutputHeight, refOutputWidth, refOutputSize, fileMatch); | ||
compare_outputs_pkd(output, binary_content, dstDescPtr, dstImgSizes, refOutputHeight, refOutputWidth, refOutputSize, fileMatch); | ||
else if(dstDescPtr->layout == RpptLayout::NCHW && dstDescPtr->c == 3) | ||
compare_outputs_pln3(output, binary_content, dstDescPtr, dstImgSizes, refOutputHeight, refOutputWidth, refOutputSize, fileMatch); |
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.
camelCase consistency
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.
Done
std::cerr << "File is empty"; | ||
|
||
fseek(fp, 0, SEEK_SET); | ||
Rpp64u *binary_content = (Rpp64u *)malloc(fsize); |
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.
free?
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.
Done
|
||
int fileMatch = 0; | ||
int matched_values = 0; | ||
if(srcDescPtr->c == 1) | ||
{ | ||
for(int i = 0; i < srcDescPtr->n; i++) | ||
for(int i = 0, j = srcDescPtr->n * 4; i < srcDescPtr->n; i++,j++) |
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.
formatting - space after comma
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.
Done
void compare_outputs_pln3(Rpp32f* output, Rpp32f* refOutput, int &fileMatch, RpptGenericDescPtr descriptorPtr3D, RpptRoiXyzwhd *roiGenericSrcPtr) | ||
{ | ||
Rpp32f *rowTemp, *rowTempRef, *outVal, *outRefVal, *outputTemp, *outputTempRef, *outputTempChn, *outputTempRefChn, *depthTemp, *depthTempRef; | ||
for(int Cnt = 0; Cnt < descriptorPtr3D->dims[0]; Cnt++) |
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.
formatting - Small c.
cnt or count.
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.
Done
@sampath1117 Please do a round of review and ensure tests passing |
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.
@HazarathKumarM
Please address review comments
@@ -950,7 +950,7 @@ void compare_outputs_pln(Rpp8u* output, Rpp8u* refOutput, RpptDescPtr dstDescPtr | |||
outputTempRef = refOutput + imageCnt * refOutputSize; | |||
int height = dstImgSizes[imageCnt].height; | |||
int width = dstImgSizes[imageCnt].width; | |||
int matched_idx = 0; | |||
int matchedIdx = 0; |
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.
Need not have the channel loop for PLN1 variant at L957, since now
PLN3 is decoupled
I think PKD3 and PLN1 can be combined in single function?
Please check
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.
Done
for(int j = 0; j < width; j++) | ||
{ | ||
outVal = rowTemp + j; | ||
outRefVal = rowTempRef + j * 3 ; |
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.
Remove space before semicolon at L1004
Also better to add a comment that reference output is PLN3 and test suite output is in PKD3 for better clarity?
@r-abishek Please share your thoughts also on this
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.
Done
@@ -997,6 +1034,8 @@ inline void compare_output(T* output, string funcName, RpptDescPtr srcDescPtr, R | |||
func += dataType[dstDescPtr->dataType]; | |||
} | |||
|
|||
std::string binFile = func + "Tensor"; | |||
|
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.
Remove the additional space at L1038
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.
Done
return; | ||
} | ||
FILE *fp; | ||
fp = fopen(refFile.c_str(), "rb"); |
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.
Try adding a small helper function for reading the data from binary file, instead of readding same code
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.
Done
|
||
int fileMatch = 0; | ||
int matched_values = 0; | ||
if(srcDescPtr->c == 1) | ||
{ | ||
for(int i = 0; i < srcDescPtr->n; i++) | ||
for(int i = 0, j = srcDescPtr->n * 4; i < srcDescPtr->n; i++, j++) |
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.
why do we need to add j counter in this loop?
It is only for PLN1 right
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.
removed the j loop counter and updated the pointer instead
status += "PASSED"; | ||
} | ||
else | ||
{ | ||
std::cerr << "FAILED! " << fileMatch << "/" << srcDescPtr->n << " outputs are matching with reference outputs" << std::endl; | ||
std::cout << "FAILED! " << fileMatch << "/" << srcDescPtr->n << " outputs are matching with reference outputs" << std::endl; |
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.
is there any reason for changing cout to cerr?
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.
If we use cerr the summary is printed before the cpp code printing time log to the console
std::cerr << "File is empty"; | ||
|
||
fseek(fp, 0, SEEK_SET); | ||
Rpp8u *binaryContent = (Rpp8u *)malloc(fsize); |
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.
We can try doing a static allocation as abishek said, but read the data
which is of size fsize only
Instead of dynamically allocating for every variant, better to static allocate as abishek said
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.
Done
int depthStride = descriptorPtr3D->strides[2]; | ||
int rowStride = descriptorPtr3D->strides[3]; | ||
int channelStride = descriptorPtr3D->strides[1]; | ||
int matchedIdx = 0; | ||
|
||
for(int c = 0; c < descriptorPtr3D->dims[1]; c++) |
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.
Same comment as before
Need not require dims[1] loop for PLN1
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.
Done
@r-abishek I have tested the code from my end |
…#222) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.1 to 0.24.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](ROCm/rocm-docs-core@v0.24.1...v0.24.2) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump rocm-docs-core from 0.24.0 to 0.24.1 in /docs/.sphinx (r-abishek#219) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.0 to 0.24.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](ROCm/rocm-docs-core@v0.24.0...v0.24.1) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core from 0.24.1 to 0.24.2 in /docs/.sphinx (r-abishek#222) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.1 to 0.24.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](ROCm/rocm-docs-core@v0.24.1...v0.24.2) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core from 0.24.2 to 0.25.0 in /docs/.sphinx (r-abishek#225) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.2 to 0.25.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](ROCm/rocm-docs-core@v0.24.2...v0.25.0) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core from 0.25.0 to 0.26.0 in /docs/.sphinx (r-abishek#228) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.25.0 to 0.26.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](ROCm/rocm-docs-core@v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ENABLE ASAN packaging RPP (r-abishek#227) * ENABLE ASAN packaging RPP * Add LICENSE File to RPP Package * Update README.md Pre-reqs * RPP Doxygen Update 2 (r-abishek#226) * Remove rpp core * Doxygen fixes for rpp.h * Update enum values per line to 1 * Doxygen fixes for rppdefs.h * Doxygen fixes for rppi.h * Doxygen fixes for rppt.h * Doxygen fixes for rppversion.h * Rename Filter struct to GenericFilter to avoid Doxygen autoreference * Add deprecated docs for image ops * Doxygen fixes for all rppi headers * Doxygen fixes for all rppt headers, and replace \ingroup with \addtogroup * Change deprecation note - "To be deprecated" * Add \deprecated flag * Minor fix * Add output samples for doxygen * Add doxygen input * Fix docs for brightness * Add correct image path to Doxyfile * Add input/output images for brightness * Fix doxygen for brightness, blend and gamma correction * Change to add "Sample" to docs * Fix doxygen for color_cast, color_jitter, color_twist * Fix all doxygen docs for color augmentations * Fix doxygen for filter funcs * doxygen fixes for data exchange ops * Add sample second input to docs * Add more sample ouputs for doxygen docs * Fix doxygen docs for gridmask and spatter * Fix docs for swap_channels * Fix doxygen docs for snp, shot and gaussian noise * Fix doxygen docs for blend and non linear blend * Fix doxygen docs for statistical ops * remove boost library * cmake fix * code cleanup * suppress nodiscard attribute error * filesystem modification * filesystem modification * code cleanup * data type fix --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: arvindcheru <90783369+arvindcheru@users.noreply.github.com> Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com> Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com>