Skip to content
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

Test suite - Error code detection and display #483

Draft
wants to merge 20 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
23682d8
experimental changes to detect error and print in the end in image t…
sampath1117 Sep 4, 2024
2aabd27
Error handling added for host side
Dineshbabu-Ravichandran Sep 30, 2024
94abc0f
Error detection implemented on HIP SIDE
Dineshbabu-Ravichandran Oct 1, 2024
a2792df
Voxel test suite changes
Dineshbabu-Ravichandran Oct 3, 2024
6c66dd8
Merge branch 'develop' into db/error_detection
Dineshbabu-Ravichandran Oct 3, 2024
36ac096
Changed variable name to camelCase
Dineshbabu-Ravichandran Oct 3, 2024
464660e
Changes in srcpath
Dineshbabu-Ravichandran Oct 4, 2024
82c2079
Changes in Voxel test suite for nonQA case
Dineshbabu-Ravichandran Oct 4, 2024
e871711
Merge branch 'develop' into db/error_detection
Dineshbabu-Ravichandran Nov 19, 2024
3e30b4d
Consolidated the repeated code and move it as common code
Nov 20, 2024
8da8695
Minor changes based on review commands
Nov 20, 2024
d49dcc8
Modification for bitDepth in voxel host
Nov 21, 2024
ec1aa9b
Merge pull request #350 from Dineshbabu-Ravichandran/db/error_detection
r-abishek Nov 26, 2024
3c3ab66
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Nov 26, 2024
bb0bc94
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Nov 27, 2024
9efa567
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Nov 29, 2024
cd90609
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Dec 2, 2024
74e541a
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Dec 2, 2024
873798f
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Dec 9, 2024
c405efc
Merge branch 'develop' into ar/test_suite_mods_8
kiritigowda Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion utilities/test_suite/HIP/Tensor_voxel_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ int main(int argc, char * argv[])
inputBitDepth = atoi(argv[10]);
string scriptPath = argv[11];

bool nonQACase = (testCase == 6);

if ((layoutType < 0) || (layoutType > 2))
{
fprintf(stdout, "\nUsage: %s <header file> <data file> <layoutType = 0 - PKD3/ 1 - PLN3/ 2 - PLN1>\n", argv[0]);
Expand Down Expand Up @@ -465,7 +467,7 @@ int main(int argc, char * argv[])
/*Compare the output of the function with golden outputs only if
1.QA Flag is set
2.input bit depth 2 (F32)*/
if(qaFlag && inputBitDepth == 2)
if(qaFlag && inputBitDepth == 2 && !(nonQACase))
compare_output(outputF32, oBufferSize, testCaseName, layoutType, descriptorPtr3D, (RpptRoiXyzwhd *)roiGenericSrcPtr, dstPath, scriptPath);
else
{
Expand Down
19 changes: 14 additions & 5 deletions utilities/test_suite/HIP/runAudioTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
buildFolderPath = os.getcwd()
caseMin = 0
caseMax = 7
errorLog = []

# Get a list of log files based on a flag for preserving output
def get_log_file_list():
Expand Down Expand Up @@ -73,31 +74,33 @@ def generate_performance_reports(RESULTS_DIR):

def run_unit_test_cmd(srcPath, case, numRuns, testType, batchSize, outFilePath):
print("\n./Tensor_audio_hip " + srcPath + " " + str(case) + " " + str(numRuns) + " " + str(testType) + " " + str(numRuns) + " " + str(batchSize))
result = subprocess.Popen([buildFolderPath + "/build/Tensor_audio_hip", srcPath, str(case), str(testType), str(numRuns), str(batchSize), outFilePath, scriptPath], stdout=subprocess.PIPE) # nosec
stdout_data, stderr_data = result.communicate()
print(stdout_data.decode())
result = subprocess.Popen([buildFolderPath + "/build/Tensor_audio_hip", srcPath, str(case), str(testType), str(numRuns), str(batchSize), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
log_detected(result, errorLog, audioAugmentationMap[int(case)][0], get_bit_depth(int(2)), "HIP")
print("------------------------------------------------------------------------------------------")

def run_performance_test_cmd(loggingFolder, srcPath, case, numRuns, testType, batchSize, outFilePath):
with open(loggingFolder + "/Tensor_audio_hip_raw_performance_log.txt", "a") as logFile:
print("./Tensor_audio_hip " + srcPath + " " + str(case) + " " + str(numRuns) + " " + str(testType) + " " + str(numRuns) + " " + str(batchSize))
process = subprocess.Popen([buildFolderPath + "/build/Tensor_audio_hip", srcPath, str(case), str(testType), str(numRuns), str(batchSize), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # nosec
process = subprocess.Popen([buildFolderPath + "/build/Tensor_audio_hip", srcPath, str(case), str(testType), str(numRuns), str(batchSize), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
read_from_subprocess_and_write_to_log(process, logFile)
log_detected(process, errorLog, audioAugmentationMap[int(case)][0], get_bit_depth(int(2)), "HIP")
print("------------------------------------------------------------------------------------------")

def run_performance_test_with_profiler_cmd(loggingFolder, srcPath, case, numRuns, testType, batchSize, outFilePath):
if not os.path.isdir(outFilePath + "/case_" + case):
os.mkdir(outFilePath + "/case_" + case)
with open(loggingFolder + "/Tensor_audio_hip_raw_performance_log.txt", "a") as logFile:
print("\nrocprof --basenames on --timestamp on --stats -o " + outFilePath + "/case_" + str(case) + "/output_case" + str(case) + ".csv ./Tensor_audio_hip " + srcPath + " " + str(case) + " " + str(numRuns) + " " + str(testType) + " " + str(numRuns) + " " + str(batchSize))
process = subprocess.Popen([ 'rocprof', '--basenames', 'on', '--timestamp', 'on', '--stats', '-o', outFilePath + "/case_" + case + "/output_case" + case + ".csv", "./Tensor_audio_hip", srcPath, str(case), str(testType), str(numRuns), str(batchSize), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # nosec
process = subprocess.Popen([ 'rocprof', '--basenames', 'on', '--timestamp', 'on', '--stats', '-o', outFilePath + "/case_" + case + "/output_case" + case + ".csv", "./Tensor_audio_hip", srcPath, str(case), str(testType), str(numRuns), str(batchSize), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
while True:
output = process.stdout.readline()
if not output and process.poll() is not None:
break
print(output.strip())
output_str = output.decode('utf-8')
logFile.write(output_str)

log_detected(process, errorLog, audioAugmentationMap[int(case)][0], get_bit_depth(int(2)), "HIP")
print("------------------------------------------------------------------------------------------")

def run_test(loggingFolder, srcPath, case, numRuns, testType, batchSize, outFilePath, profilingOption = "NO"):
Expand Down Expand Up @@ -296,3 +299,9 @@ def rpp_test_suite_parser_and_validator():
CONSOLIDATED_FILE + "\n")
except IOError:
print("Unable to open results in " + CONSOLIDATED_FILE)

if errorLog:
print("\n---------------------------------- Error log - Tensor_audio_hip ----------------------------------\n")
for error in errorLog:
print(error)
print("-----------------------------------------------------------------------------------------------")
18 changes: 13 additions & 5 deletions utilities/test_suite/HIP/runMiscTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
buildFolderPath = os.getcwd()
caseMin = 0
caseMax = 2
errorLog = []

# Get a list of log files based on a flag for preserving output
def get_log_file_list():
Expand Down Expand Up @@ -75,25 +76,26 @@ def generate_performance_reports(RESULTS_DIR):

def run_unit_test_cmd(numDims, case, numRuns, testType, toggle, batchSize, outFilePath, additionalArg):
print("\n./Tensor_misc_hip " + str(case) + " " + str(testType) + " " + str(toggle) + " " + str(numDims) + " " + str(batchSize) + " " + str(numRuns) + " " + str(additionalArg))
result = subprocess.Popen([buildFolderPath + "/build/Tensor_misc_hip", str(case), str(testType), str(toggle), str(numDims), str(batchSize), str(numRuns), str(additionalArg), outFilePath, scriptPath], stdout=subprocess.PIPE) # nosec
stdout_data, stderr_data = result.communicate()
print(stdout_data.decode())
result = subprocess.Popen([buildFolderPath + "/build/Tensor_misc_hip", str(case), str(testType), str(toggle), str(numDims), str(batchSize), str(numRuns), str(additionalArg), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
log_detected(result, errorLog, miscAugmentationMap[int(case)][0], get_bit_depth(int(2)), get_misc_func_name(int(case), numDims, additionalArg))
print("------------------------------------------------------------------------------------------")

def run_performance_test_cmd(loggingFolder, numDims, case, numRuns, testType, toggle, batchSize, outFilePath, additionalArg):
with open(loggingFolder + "/Tensor_misc_hip_raw_performance_log.txt", "a") as logFile:
logFile.write("./Tensor_misc_hip " + str(case) + " " + str(testType) + " " + str(toggle) + " " + str(numDims) + " " + str(batchSize) + " " + str(numRuns) + " " + str(additionalArg) + "\n")
process = subprocess.Popen([buildFolderPath + "/build/Tensor_misc_hip", str(case), str(testType), str(toggle), str(numDims), str(batchSize), str(numRuns), str(additionalArg), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # nosec
process = subprocess.Popen([buildFolderPath + "/build/Tensor_misc_hip", str(case), str(testType), str(toggle), str(numDims), str(batchSize), str(numRuns), str(additionalArg), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
read_from_subprocess_and_write_to_log(process, logFile)
log_detected(process, errorLog, miscAugmentationMap[int(case)][0], get_bit_depth(int(2)), get_misc_func_name(int(case), numDims, additionalArg))

def run_performance_test_with_profiler_cmd(loggingFolder, numDims, case, numRuns, testType, toggle, batchSize, outFilePath, additionalArg):
if not os.path.exists(outFilePath + "/case_" + str(case)):
os.mkdir(outFilePath + "/case_" + str(case))

with open(loggingFolder + "/Tensor_misc_hip_raw_performance_log.txt", "a") as logFile:
logFile.write("\nrocprof --basenames on --timestamp on --stats -o " + outFilePath + "/case_" + str(case) + "/output_case" + str(case) + ".csv ./Tensor_misc_hip " + str(case) + " " + str(testType) + " " + str(toggle) + " " + str(numDims) + " " + str(batchSize) + " " + str(numRuns) + " " + str(additionalArg) + "\n")
process = subprocess.Popen(['rocprof', '--basenames', 'on', '--timestamp', 'on', '--stats', '-o', outFilePath + "/case_" + str(case) + "/output_case" + str(case) + ".csv", "./Tensor_misc_hip", str(case), str(testType), str(toggle), str(numDims), str(batchSize), str(numRuns), str(additionalArg), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # nosec
process = subprocess.Popen(['rocprof', '--basenames', 'on', '--timestamp', 'on', '--stats', '-o', outFilePath + "/case_" + str(case) + "/output_case" + str(case) + ".csv", "./Tensor_misc_hip", str(case), str(testType), str(toggle), str(numDims), str(batchSize), str(numRuns), str(additionalArg), outFilePath, scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
read_from_subprocess_and_write_to_log(process, logFile)
log_detected(process, errorLog, miscAugmentationMap[int(case)][0], get_bit_depth(int(2)), get_misc_func_name(int(case), numDims, additionalArg))
print("------------------------------------------------------------------------------------------")

def run_test(loggingFolder, numDims, case, numRuns, testType, toggle, batchSize, outFilePath, additionalArg, profilingOption = 'NO'):
Expand Down Expand Up @@ -286,3 +288,9 @@ def rpp_test_suite_parser_and_validator():

for logFile in logFileList:
print_performance_tests_summary(logFile, functionalityGroupList, numRuns)

if errorLog:
print("\n---------------------------------- Error log - Tensor_misc_hip ----------------------------------\n")
for error in errorLog:
print(error)
print("-----------------------------------------------------------------------------------------------")
Loading