diff --git a/.gitignore b/.gitignore index 9945a9dc..c707d054 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ hiptensor-version.hpp # Generated source file test/*/configs/*.hpp +test/*/configs/*/*.hpp # Precompiled Headers *.gch diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt index 57bf8be3..ae2c30b9 100644 --- a/library/src/CMakeLists.txt +++ b/library/src/CMakeLists.txt @@ -2,7 +2,7 @@ # # MIT License # - # Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + # Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,7 +24,7 @@ # ############################################################################### -find_package( composable_kernel 1.0.0 REQUIRED PATHS /opt/rocm /opt/rocm/ck $ENV{CK_DIR}/lib/cmake COMPONENTS device_contraction_operations device_reduction_operations device_other_operations) +find_package( composable_kernel 1.0.0 REQUIRED PATHS $ENV{CK_DIR}/lib/cmake /opt/rocm /opt/rocm/ck COMPONENTS device_contraction_operations device_reduction_operations device_other_operations) rocm_package_add_dependencies("composable_kernel >= 1.0.0" COMPONENT tests) set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -80,6 +80,7 @@ set(HIPTENSOR_CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/data_types.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hip_device.cpp ${CMAKE_CURRENT_SOURCE_DIR}/handle.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hiptensor_options.cpp ) add_hiptensor_component(hiptensor_core ${HIPTENSOR_CORE_SOURCES}) diff --git a/library/src/contraction/hiptensor_contraction.cpp b/library/src/contraction/hiptensor_contraction.cpp index 21c28757..2e90ccba 100644 --- a/library/src/contraction/hiptensor_contraction.cpp +++ b/library/src/contraction/hiptensor_contraction.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,6 +33,8 @@ #include "hip_device.hpp" #include "logger.hpp" +#include "hiptensor_options.hpp" + // Convert between vectors of void ptrs stored in opaque API objects // to vectors of ContractionSolution ptrs with simple cast. inline auto toContractionSolutionVec(std::vector const& v) @@ -747,6 +749,9 @@ hiptensorStatus_t hiptensorContraction(const hiptensorHandle_t* handle, // Perform contraction with timing if LOG_LEVEL_PERF_TRACE if(logger->getLogMask() & HIPTENSOR_LOG_LEVEL_PERF_TRACE) { + using hiptensor::HiptensorOptions; + auto& options = HiptensorOptions::instance(); + std::tie(errorCode, time) = (*cSolution)(alpha, A, B, @@ -771,8 +776,8 @@ hiptensorStatus_t hiptensorContraction(const hiptensorHandle_t* handle, stream, // stream id true, // time_kernel 0, // log_level - 0, // cold_niters - 1, // nrepeat + options->coldRuns(), // cold_niters + options->hotRuns(), // nrepeat }); if(errorCode == HIPTENSOR_STATUS_SUCCESS) diff --git a/library/src/data_types.cpp b/library/src/data_types.cpp index b17de958..9b69b9f1 100644 --- a/library/src/data_types.cpp +++ b/library/src/data_types.cpp @@ -350,6 +350,111 @@ namespace hiptensor return "HIP_TYPE_NONE"; } } + + std::string opTypeToString(hiptensorOperator_t opType) + { + if(opType == HIPTENSOR_OP_IDENTITY) + { + return "HIPTENSOR_OP_IDENTITY"; + } + else if(opType == HIPTENSOR_OP_SQRT) + { + return "HIPTENSOR_OP_SQRT"; + } + else if(opType == HIPTENSOR_OP_ADD) + { + return "HIPTENSOR_OP_ADD"; + } + else if(opType == HIPTENSOR_OP_MUL) + { + return "HIPTENSOR_OP_MUL"; + } + else if(opType == HIPTENSOR_OP_MAX) + { + return "HIPTENSOR_OP_MAX"; + } + else if(opType == HIPTENSOR_OP_MIN) + { + return "HIPTENSOR_OP_MIN"; + } + else + { + return "HIPTENSOR_OP_UNKNOWN"; + } + } + + std::string algoTypeToString(hiptensorAlgo_t algoType) + { + if(algoType == HIPTENSOR_ALGO_ACTOR_CRITIC) + { + return "HIPTENSOR_ALGO_ACTOR_CRITIC"; + } + else if(algoType == HIPTENSOR_ALGO_DEFAULT) + { + return "HIPTENSOR_ALGO_DEFAULT"; + } + else if(algoType == HIPTENSOR_ALGO_DEFAULT_PATIENT) + { + return "HIPTENSOR_ALGO_DEFAULT_PATIENT"; + } + else + { + return "HIPTENSOR_ALGO_UNKNOWN"; + } + } + + std::string logLevelToString(hiptensorLogLevel_t logLevel) + { + if(logLevel == HIPTENSOR_LOG_LEVEL_OFF) + { + return "HIPTENSOR_LOG_LEVEL_OFF"; + } + else if(logLevel == HIPTENSOR_LOG_LEVEL_ERROR) + { + return "HIPTENSOR_LOG_LEVEL_ERROR"; + } + else if(logLevel == HIPTENSOR_LOG_LEVEL_PERF_TRACE) + { + return "HIPTENSOR_LOG_LEVEL_PERF_TRACE"; + } + else if(logLevel == HIPTENSOR_LOG_LEVEL_PERF_HINT) + { + return "HIPTENSOR_LOG_LEVEL_PERF_HINT"; + } + else if(logLevel == HIPTENSOR_LOG_LEVEL_HEURISTICS_TRACE) + { + return "HIPTENSOR_LOG_LEVEL_HEURISTICS_TRACE"; + } + else if(logLevel == HIPTENSOR_LOG_LEVEL_API_TRACE) + { + return "HIPTENSOR_LOG_LEVEL_API_TRACE"; + } + else + { + return "HIPTENSOR_LOG_LEVEL_UNKNOWN"; + } + } + + std::string workSizePrefToString(hiptensorWorksizePreference_t workSize) + { + if(workSize == HIPTENSOR_WORKSPACE_MIN) + { + return "HIPTENSOR_WORKSPACE_MIN"; + } + else if(workSize == HIPTENSOR_WORKSPACE_RECOMMENDED) + { + return "HIPTENSOR_WORKSPACE_RECOMMENDED"; + } + else if(workSize == HIPTENSOR_WORKSPACE_MAX) + { + return "HIPTENSOR_WORKSPACE_MAX"; + } + else + { + return "HIPTENSOR_WORKSPACE_UNKNOWN"; + } + } + } // namespace hiptensor bool operator==(hipDataType hipType, hiptensorComputeType_t computeType) diff --git a/library/src/hiptensor_options.cpp b/library/src/hiptensor_options.cpp new file mode 100644 index 00000000..a1af562d --- /dev/null +++ b/library/src/hiptensor_options.cpp @@ -0,0 +1,184 @@ +/******************************************************************************* + * + * MIT License + * + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "hiptensor_options.hpp" +#include + +namespace hiptensor +{ + HiptensorOptions::HiptensorOptions() + : mOstream() + , mOmitSkipped(false) + , mOmitFailed(false) + , mOmitPassed(false) + , mOmitCout(false) + , mUsingDefaultParams(true) + , mValidate(true) + , mHotRuns(1) + , mColdRuns(0) + , mInputFilename("") + , mOutputFilename("") + { + } + + void HiptensorOptions::setOstream(std::string file) + { + mOstream.initializeStream(file); + } + + void HiptensorOptions::setOmits(int mask) + { + if(mask & 1) + { + mOmitSkipped = true; + } + else + { + mOmitSkipped = false; + } + + if(mask & 2) + { + mOmitFailed = true; + } + else + { + mOmitFailed = false; + } + + if(mask & 4) + { + mOmitPassed = true; + } + else + { + mOmitPassed = false; + } + + if(mask & 8) + { + mOmitCout = true; + } + else + { + mOmitCout = false; + } + } + + void HiptensorOptions::setDefaultParams(bool val) + { + mUsingDefaultParams = val; + } + + void HiptensorOptions::setValidation(std::string val) + { + std::transform(val.begin(), val.end(), val.begin(), ::toupper); + if(val.compare("ON") == 0) + { + mValidate = true; + } + else if(val.compare("OFF") == 0) + { + mValidate = false; + } + } + + void HiptensorOptions::setHotRuns(int runs) + { + mHotRuns = runs; + } + + void HiptensorOptions::setColdRuns(int runs) + { + mColdRuns = runs; + } + + void HiptensorOptions::setInputYAMLFilename(std::string file) + { + mInputFilename = file; + } + + void HiptensorOptions::setOutputStreamFilename(std::string file) + { + mOutputFilename = file; + } + + HiptensorOStream& HiptensorOptions::ostream() + { + return mOstream; + } + + bool HiptensorOptions::omitSkipped() + { + return mOmitSkipped; + } + + bool HiptensorOptions::omitFailed() + { + return mOmitFailed; + } + + bool HiptensorOptions::omitPassed() + { + return mOmitPassed; + } + + bool HiptensorOptions::omitCout() + { + return mOmitCout; + } + + bool HiptensorOptions::usingDefaultConfig() + { + return mUsingDefaultParams; + } + + bool HiptensorOptions::performValidation() + { + return mValidate; + } + + int32_t HiptensorOptions::hotRuns() + { + return mHotRuns; + } + + int32_t HiptensorOptions::coldRuns() + { + return mColdRuns; + } + + std::string HiptensorOptions::inputFilename() + { + return mInputFilename; + } + + std::string HiptensorOptions::outputFilename() + { + return mOutputFilename; + } + +} // namespace hiptensor diff --git a/library/src/include/data_types.hpp b/library/src/include/data_types.hpp index 59e70f2a..452fda8f 100644 --- a/library/src/include/data_types.hpp +++ b/library/src/include/data_types.hpp @@ -110,6 +110,10 @@ namespace hiptensor std::string computeTypeToString(hiptensorComputeType_t computeType); std::string hipTypeToString(hipDataType hipType); + std::string opTypeToString(hiptensorOperator_t opType); + std::string algoTypeToString(hiptensorAlgo_t algoType); + std::string logLevelToString(hiptensorLogLevel_t); + std::string workSizePrefToString(hiptensorWorksizePreference_t workSize); } // namespace hiptensor bool operator==(hipDataType hipType, hiptensorComputeType_t computeType); diff --git a/test/llvm/hiptensor_options.hpp b/library/src/include/hiptensor_options.hpp similarity index 78% rename from test/llvm/hiptensor_options.hpp rename to library/src/include/hiptensor_options.hpp index 71886c3c..de250a0a 100644 --- a/test/llvm/hiptensor_options.hpp +++ b/library/src/include/hiptensor_options.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,16 +49,27 @@ namespace hiptensor HiptensorOptions(HiptensorOptions&&) = default; ~HiptensorOptions() = default; - void parseOptions(int argc, char** argv); + void setOstream(std::string file); void setOmits(int mask); + void setDefaultParams(bool val); + void setValidation(std::string val); + void setHotRuns(int runs); + void setColdRuns(int runs); + void setInputYAMLFilename(std::string file); + void setOutputStreamFilename(std::string file); HiptensorOStream& ostream(); - bool omitSkipped(); - bool omitFailed(); - bool omitPassed(); - bool omitCout(); - bool usingDefaultConfig(); + bool omitSkipped(); + bool omitFailed(); + bool omitPassed(); + bool omitCout(); + bool usingDefaultConfig(); + bool performValidation(); + + int32_t hotRuns(); + int32_t coldRuns(); + std::string inputFilename(); std::string outputFilename(); @@ -67,6 +78,9 @@ namespace hiptensor bool mOmitSkipped, mOmitFailed, mOmitPassed, mOmitCout; bool mUsingDefaultParams; + bool mValidate; + + int32_t mHotRuns, mColdRuns; std::string mInputFilename, mOutputFilename; }; diff --git a/test/hiptensor_ostream.hpp b/library/src/include/hiptensor_ostream.hpp similarity index 97% rename from test/hiptensor_ostream.hpp rename to library/src/include/hiptensor_ostream.hpp index 982e058e..c3cb873c 100644 --- a/test/hiptensor_ostream.hpp +++ b/library/src/include/hiptensor_ostream.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/library/src/permutation/hiptensor_permutation.cpp b/library/src/permutation/hiptensor_permutation.cpp index aae18d46..be3186c6 100644 --- a/library/src/permutation/hiptensor_permutation.cpp +++ b/library/src/permutation/hiptensor_permutation.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,10 +25,12 @@ *******************************************************************************/ #include +#include "logger.hpp" #include "permutation_solution.hpp" #include "permutation_solution_instances.hpp" #include "permutation_solution_registry.hpp" -#include "logger.hpp" + +#include "hiptensor_options.hpp" inline auto toPermutationSolutionVec( std::unordered_map const& map) @@ -172,20 +174,15 @@ hiptensorStatus_t hiptensorPermutation(const hiptensorHandle_t* handle // Extract the solutions to the candidates vector. auto candidates = toPermutationSolutionVec(solnQ.solutions()); - int nDims = descA->mLengths.size(); - auto ADataType = descA->mType; - auto BDataType = descB->mType; - auto AOp = descA->mUnaryOp; - auto BOp = descB->mUnaryOp; + int nDims = descA->mLengths.size(); + auto ADataType = descA->mType; + auto BDataType = descB->mType; + auto AOp = descA->mUnaryOp; + auto BOp = descB->mUnaryOp; // Query permutation solutions for the correct permutation operation and type - auto solutionQ = hiptensor::PermutationSolutionRegistry::Query{candidates} - .query(nDims, - ADataType, - BDataType, - AOp, - BOp, - hiptensor::PermutationOpId_t::SCALE); + auto solutionQ = hiptensor::PermutationSolutionRegistry::Query{candidates}.query( + nDims, ADataType, BDataType, AOp, BOp, hiptensor::PermutationOpId_t::SCALE); if(solutionQ.solutionCount() == 0) { @@ -204,8 +201,8 @@ hiptensorStatus_t hiptensorPermutation(const hiptensorHandle_t* handle bool canRun = false; for(int i = 0; i < candidates.size(); i++) { - hiptensor::PermutationSolution *pSolution = candidates[i]; - canRun = pSolution->initArgs(alpha, + hiptensor::PermutationSolution* pSolution = candidates[i]; + canRun = pSolution->initArgs(alpha, A, B, descA->mLengths, @@ -221,21 +218,24 @@ hiptensorStatus_t hiptensorPermutation(const hiptensorHandle_t* handle // Perform permutation with timing if LOG_LEVEL_PERF_TRACE if(logger->getLogMask() & HIPTENSOR_LOG_LEVEL_PERF_TRACE) { + using hiptensor::HiptensorOptions; + auto& options = HiptensorOptions::instance(); + auto time = (*pSolution)(StreamConfig{ stream, // stream id true, // time_kernel 0, // log_level - 0, // cold_niters - 1, // nrepeat + options->coldRuns(), // cold_niters + options->hotRuns(), // nrepeat }); if(time < 0) { return HIPTENSOR_STATUS_CK_ERROR; } - int n = pSolution->problemDim(); - auto flops = std::size_t(2) * n; - auto bytes = pSolution->problemBytes(); + int n = pSolution->problemDim(); + auto flops = std::size_t(2) * n; + auto bytes = pSolution->problemBytes(); hiptensor::PerfMetrics metrics = { pSolution->uid(), // id @@ -247,13 +247,13 @@ hiptensorStatus_t hiptensorPermutation(const hiptensorHandle_t* handle // log perf metrics (not name/id) snprintf(msg, - sizeof(msg), - "KernelId: %lu KernelName: %s, %0.3f ms, %0.3f TFlops, %0.3f GB/s", - metrics.mKernelUid, - metrics.mKernelName.c_str(), - metrics.mAvgTimeMs, - metrics.mTflops, - metrics.mBandwidth); + sizeof(msg), + "KernelId: %lu KernelName: %s, %0.3f ms, %0.3f TFlops, %0.3f GB/s", + metrics.mKernelUid, + metrics.mKernelName.c_str(), + metrics.mAvgTimeMs, + metrics.mTflops, + metrics.mBandwidth); logger->logPerformanceTrace("hiptensorPermutation", msg); } // Perform permutation without timing @@ -271,9 +271,9 @@ hiptensorStatus_t hiptensorPermutation(const hiptensorHandle_t* handle auto errorCode = HIPTENSOR_STATUS_INTERNAL_ERROR; snprintf(msg, - sizeof(msg), - "Selected kernel is unable to solve the problem (%s)", - hiptensorGetErrorString(errorCode)); + sizeof(msg), + "Selected kernel is unable to solve the problem (%s)", + hiptensorGetErrorString(errorCode)); logger->logError("hiptensorPermutation", msg); return errorCode; } diff --git a/library/src/reduction/hiptensor_reduction.cpp b/library/src/reduction/hiptensor_reduction.cpp index 384bc5ba..f4f85cf7 100644 --- a/library/src/reduction/hiptensor_reduction.cpp +++ b/library/src/reduction/hiptensor_reduction.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,6 +49,8 @@ #include "reduction_solution_instances.hpp" #include "reduction_solution_registry.hpp" +#include "hiptensor_options.hpp" + using namespace ck; using namespace ck::tensor_operation::device; @@ -306,6 +308,9 @@ hiptensorStatus_t hiptensorReduction(const hiptensorHandle_t* handle, for(auto [_, pSolution] : solutionQ.solutions()) { + using hiptensor::HiptensorOptions; + auto& options = HiptensorOptions::instance(); + // Perform reduction with timing if LOG_LEVEL_PERF_TRACE auto streamConfig = (logger->getLogMask() & HIPTENSOR_LOG_LEVEL_PERF_TRACE) ? @@ -313,8 +318,8 @@ hiptensorStatus_t hiptensorReduction(const hiptensorHandle_t* handle, stream, // stream id true, // time_kernel 0, // log_level - 0, // cold_niters - 1, // nrepeat + options->coldRuns(), // cold_niters + options->hotRuns(), // nrepeat }: StreamConfig{stream, false}; auto [isSupported, time] = (*pSolution)(descA->mLengths, diff --git a/scripts/performance/BenchmarkContraction.sh b/scripts/performance/BenchmarkContraction.sh new file mode 100755 index 00000000..9c91d045 --- /dev/null +++ b/scripts/performance/BenchmarkContraction.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# Copyright (C) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. + +set -eux + +# ensure this script is in the cwd +cd "$(dirname "${BASH_SOURCE[0]}")" + +output_dir=hiptensor-benchmarks +build_dir=../../build/bin/ +config_dir=../../test/01_contraction/configs/bench + +cold_runs=1 +hot_runs=5 + +validate=OFF + +if [ -d "$build_dir" ]; then + # setup output directory for benchmarks + mkdir -p "$output_dir" + + tests=("bilinear_contraction_test_m1n1k1" + "bilinear_contraction_test_m2n2k2" + "bilinear_contraction_test_m3n3k3" + "bilinear_contraction_test_m4n4k4" + "bilinear_contraction_test_m5n5k5" + "bilinear_contraction_test_m6n6k6" + "complex_bilinear_contraction_test_m1n1k1" + "complex_bilinear_contraction_test_m2n2k2" + "complex_bilinear_contraction_test_m3n3k3" + "complex_bilinear_contraction_test_m4n4k4" + "complex_bilinear_contraction_test_m5n5k5" + "complex_bilinear_contraction_test_m6n6k6" + "scale_contraction_test_m1n1k1" + "scale_contraction_test_m2n2k2" + "scale_contraction_test_m3n3k3" + "scale_contraction_test_m4n4k4" + "scale_contraction_test_m5n5k5" + "scale_contraction_test_m6n6k6" + "complex_scale_contraction_test_m1n1k1" + "complex_scale_contraction_test_m2n2k2" + "complex_scale_contraction_test_m3n3k3" + "complex_scale_contraction_test_m4n4k4" + "complex_scale_contraction_test_m5n5k5" + "complex_scale_contraction_test_m6n6k6") + + configs=("bilinear_test_params_rank1.yaml" + "bilinear_test_params_rank2.yaml" + "bilinear_test_params_rank3.yaml" + "bilinear_test_params_rank4.yaml" + "bilinear_test_params_rank5.yaml" + "bilinear_test_params_rank6.yaml" + "complex_bilinear_test_params_rank1.yaml" + "complex_bilinear_test_params_rank2.yaml" + "complex_bilinear_test_params_rank3.yaml" + "complex_bilinear_test_params_rank4.yaml" + "complex_bilinear_test_params_rank5.yaml" + "complex_bilinear_test_params_rank6.yaml" + "scale_test_params_rank1.yaml" + "scale_test_params_rank2.yaml" + "scale_test_params_rank3.yaml" + "scale_test_params_rank4.yaml" + "scale_test_params_rank5.yaml" + "scale_test_params_rank6.yaml" + "complex_scale_test_params_rank1.yaml" + "complex_scale_test_params_rank2.yaml" + "complex_scale_test_params_rank3.yaml" + "complex_scale_test_params_rank4.yaml" + "complex_scale_test_params_rank5.yaml" + "complex_scale_test_params_rank6.yaml") + + arrayLength=${#tests[@]} + + # run benchmarks + for (( i=0; i<${arrayLength}; i++ )); do + if [[ -e $build_dir && ! -L $build_dir/${tests[$i]} ]]; then + $build_dir${tests[$i]} -y $config_dir/${configs[$i]} \ + -o $output_dir${tests[$i]}".csv" --cold_runs $cold_runs --hot_runs $hot_runs -v $validate + fi + done +fi + diff --git a/scripts/performance/BenchmarkPermutation.sh b/scripts/performance/BenchmarkPermutation.sh new file mode 100755 index 00000000..81e27bc0 --- /dev/null +++ b/scripts/performance/BenchmarkPermutation.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Copyright (C) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. + +set -eux + +# ensure this script is in the cwd +cd "$(dirname "${BASH_SOURCE[0]}")" + +output_dir=hiptensor-benchmarks +build_dir=../../build/bin/ +config_dir=../../test/02_permutation/configs/bench + +cold_runs=1 +hot_runs=5 + +validate=OFF + +if [ -d "$build_dir" ]; then + # setup output directory for benchmarks + mkdir -p "$output_dir" + + tests=("rank2_permutation_test" + "rank3_permutation_test" + "rank4_permutation_test" + "rank5_permutation_test" + "rank6_permutation_test") + + configs=("rank2_test_params.yaml" + "rank3_test_params.yaml" + "rank4_test_params.yaml" + "rank5_test_params.yaml" + "rank6_test_params.yaml") + + arrayLength=${#tests[@]} + + # run benchmarks + for (( i=0; i<${arrayLength}; i++ )); do + if [[ -e $build_dir && ! -L $build_dir/${tests[$i]} ]]; then + $build_dir${tests[$i]} -y $config_dir/${configs[$i]} \ + -o $output_dir${tests[$i]}".csv" --cold_runs $cold_runs --hot_runs $hot_runs -v $validate + fi + done +fi + diff --git a/scripts/performance/BenchmarkReduction.sh b/scripts/performance/BenchmarkReduction.sh new file mode 100755 index 00000000..4ebb9b20 --- /dev/null +++ b/scripts/performance/BenchmarkReduction.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Copyright (C) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. + +set -eux + +# ensure this script is in the cwd +cd "$(dirname "${BASH_SOURCE[0]}")" + +output_dir=hiptensor-benchmarks +build_dir=../../build/bin/ +config_dir=../../test/03_reduction/configs/bench + +cold_runs=1 +hot_runs=5 + +validate=OFF + +if [ -d "$build_dir" ]; then + # setup output directory for benchmarks + mkdir -p "$output_dir" + + tests=("rank2_reduction_test" + "rank3_reduction_test" + "rank4_reduction_test" + "rank5_reduction_test" + "rank6_reduction_test") + + configs=("rank2_test_params.yaml" + "rank3_test_params.yaml" + "rank4_test_params.yaml" + "rank5_test_params.yaml" + "rank6_test_params.yaml") + + arrayLength=${#tests[@]} + + # run benchmarks + for (( i=0; i<${arrayLength}; i++ )); do + if [[ -e $build_dir && ! -L $build_dir/${tests[$i]} ]]; then + $build_dir${tests[$i]} -y $config_dir/${configs[$i]} \ + -o $output_dir${tests[$i]}".csv" --cold_runs $cold_runs --hot_runs $hot_runs -v $validate + fi + done +fi + diff --git a/test/00_unit/yaml_test.cpp b/test/00_unit/yaml_test.cpp index 78ceeb16..9ac05e74 100644 --- a/test/00_unit/yaml_test.cpp +++ b/test/00_unit/yaml_test.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ namespace hiptensor static constexpr hipDataType NONE_TYPE = (hipDataType)31; struct ContractionTestParams { - using TestTypesT = std::vector; + using DataTypesT = std::vector; using AlgorithmT = hiptensorAlgo_t; using OperatorT = hiptensorOperator_t; @@ -59,7 +59,7 @@ namespace hiptensor using BetaT = std::vector; //Data types of input and output tensors - std::vector mDataTypes; + std::vector mDataTypes; std::vector mAlgorithms; std::vector mOperators; std::vector mWorkSizePrefs; diff --git a/test/01_contraction/CMakeLists.txt b/test/01_contraction/CMakeLists.txt index 483fc246..0653b3d9 100644 --- a/test/01_contraction/CMakeLists.txt +++ b/test/01_contraction/CMakeLists.txt @@ -2,7 +2,7 @@ # # MIT License # - # Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + # Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,117 +23,117 @@ # THE SOFTWARE. # ############################################################################### -set(ContractionCommonSources ${HIPTENSOR_COMMON_TEST_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/contraction_resource.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/contraction_test.cpp) + set(ContractionCommonSources ${HIPTENSOR_COMMON_TEST_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/contraction_resource.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/contraction_test.cpp) # Bilinear M1N1K1 tests set (BilinearContractionTestSources ${ContractionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/bilinear_contraction_test.cpp) -set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/bilinear_test_params_rank1.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/bilinear_contraction_test.cpp) +set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/bilinear_test_params_rank1.yaml) add_hiptensor_test(bilinear_contraction_test_m1n1k1 ${BilinearContractionTestConfig} ${BilinearContractionTestSources}) # Bilinear M2N2K2 tests -set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/bilinear_test_params_rank2.yaml) +set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/bilinear_test_params_rank2.yaml) add_hiptensor_test(bilinear_contraction_test_m2n2k2 ${BilinearContractionTestConfig} ${BilinearContractionTestSources}) # Bilinear M3N3K3 tests -set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/bilinear_test_params_rank3.yaml) +set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/bilinear_test_params_rank3.yaml) add_hiptensor_test(bilinear_contraction_test_m3n3k3 ${BilinearContractionTestConfig} ${BilinearContractionTestSources}) # Bilinear M4N4K4 tests -set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/bilinear_test_params_rank4.yaml) +set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/bilinear_test_params_rank4.yaml) add_hiptensor_test(bilinear_contraction_test_m4n4k4 ${BilinearContractionTestConfig} ${BilinearContractionTestSources}) # Bilinear M5N5K5 tests -set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/bilinear_test_params_rank5.yaml) +set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/bilinear_test_params_rank5.yaml) add_hiptensor_test(bilinear_contraction_test_m5n5k5 ${BilinearContractionTestConfig} ${BilinearContractionTestSources}) # Bilinear M6N6K6 tests -set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/bilinear_test_params_rank6.yaml) +set (BilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/bilinear_test_params_rank6.yaml) add_hiptensor_test(bilinear_contraction_test_m6n6k6 ${BilinearContractionTestConfig} ${BilinearContractionTestSources}) # Complex Bilinear M1N1K1 tests set (ComplexBilinearContractionTestSources ${ContractionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/complex_bilinear_contraction_test.cpp) -set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_bilinear_test_params_rank1.yaml) +${CMAKE_CURRENT_SOURCE_DIR}/complex_bilinear_contraction_test.cpp) +set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_bilinear_test_params_rank1.yaml) add_hiptensor_test(complex_bilinear_contraction_test_m1n1k1 ${ComplexBilinearContractionTestConfig} ${ComplexBilinearContractionTestSources}) # Complex Bilinear M2N2K2 tests -set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_bilinear_test_params_rank2.yaml) +set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_bilinear_test_params_rank2.yaml) add_hiptensor_test(complex_bilinear_contraction_test_m2n2k2 ${ComplexBilinearContractionTestConfig} ${ComplexBilinearContractionTestSources}) # Complex Bilinear M3N3K3 tests -set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_bilinear_test_params_rank3.yaml) +set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_bilinear_test_params_rank3.yaml) add_hiptensor_test(complex_bilinear_contraction_test_m3n3k3 ${ComplexBilinearContractionTestConfig} ${ComplexBilinearContractionTestSources}) # Complex Bilinear M4N4K4 tests -set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_bilinear_test_params_rank4.yaml) +set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_bilinear_test_params_rank4.yaml) add_hiptensor_test(complex_bilinear_contraction_test_m4n4k4 ${ComplexBilinearContractionTestConfig} ${ComplexBilinearContractionTestSources}) # Complex Bilinear M5N5K5 tests -set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_bilinear_test_params_rank5.yaml) +set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_bilinear_test_params_rank5.yaml) add_hiptensor_test(complex_bilinear_contraction_test_m5n5k5 ${ComplexBilinearContractionTestConfig} ${ComplexBilinearContractionTestSources}) # Complex Bilinear M6N6K6 tests -set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_bilinear_test_params_rank6.yaml) +set (ComplexBilinearContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_bilinear_test_params_rank6.yaml) add_hiptensor_test(complex_bilinear_contraction_test_m6n6k6 ${ComplexBilinearContractionTestConfig} ${ComplexBilinearContractionTestSources}) # Scale M2N2K2 tests set (ScaleContractionTestSources ${ContractionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/scale_contraction_test.cpp) -set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/scale_test_params_rank1.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/scale_contraction_test.cpp) +set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/scale_test_params_rank1.yaml) add_hiptensor_test(scale_contraction_test_m1n1k1 ${ScaleContractionTestConfig} ${ScaleContractionTestSources}) # Scale M2N2K2 tests -set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/scale_test_params_rank2.yaml) +set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/scale_test_params_rank2.yaml) add_hiptensor_test(scale_contraction_test_m2n2k2 ${ScaleContractionTestConfig} ${ScaleContractionTestSources}) # Scale M3N3K3 tests -set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/scale_test_params_rank3.yaml) +set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/scale_test_params_rank3.yaml) add_hiptensor_test(scale_contraction_test_m3n3k3 ${ScaleContractionTestConfig} ${ScaleContractionTestSources}) # Scale M4N4K4 tests -set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/scale_test_params_rank4.yaml) +set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/scale_test_params_rank4.yaml) add_hiptensor_test(scale_contraction_test_m4n4k4 ${ScaleContractionTestConfig} ${ScaleContractionTestSources}) # Scale M5N5K5 tests -set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/scale_test_params_rank5.yaml) +set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/scale_test_params_rank5.yaml) add_hiptensor_test(scale_contraction_test_m5n5k5 ${ScaleContractionTestConfig} ${ScaleContractionTestSources}) # Scale M6N6K6 tests -set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/scale_test_params_rank6.yaml) +set (ScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/scale_test_params_rank6.yaml) add_hiptensor_test(scale_contraction_test_m6n6k6 ${ScaleContractionTestConfig} ${ScaleContractionTestSources}) # Complex Scale M1N1K1 tests set (ComplexScaleContractionTestSources ${ContractionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/complex_scale_contraction_test.cpp) -set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_scale_test_params_rank1.yaml) +${CMAKE_CURRENT_SOURCE_DIR}/complex_scale_contraction_test.cpp) +set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_scale_test_params_rank1.yaml) add_hiptensor_test(complex_scale_contraction_test_m1n1k1 ${ComplexScaleContractionTestConfig} ${ComplexScaleContractionTestSources}) # Complex Scale M2N2K2 tests -set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_scale_test_params_rank2.yaml) +set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_scale_test_params_rank2.yaml) add_hiptensor_test(complex_scale_contraction_test_m2n2k2 ${ComplexScaleContractionTestConfig} ${ComplexScaleContractionTestSources}) # Complex Scale M3N3K3 tests -set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_scale_test_params_rank3.yaml) +set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_scale_test_params_rank3.yaml) add_hiptensor_test(complex_scale_contraction_test_m3n3k3 ${ComplexScaleContractionTestConfig} ${ComplexScaleContractionTestSources}) # Complex Scale M4N4K4 tests -set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_scale_test_params_rank4.yaml) +set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_scale_test_params_rank4.yaml) add_hiptensor_test(complex_scale_contraction_test_m4n4k4 ${ComplexScaleContractionTestConfig} ${ComplexScaleContractionTestSources}) # Complex Scale M5N5K5 tests -set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_scale_test_params_rank5.yaml) +set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_scale_test_params_rank5.yaml) add_hiptensor_test(complex_scale_contraction_test_m5n5k5 ${ComplexScaleContractionTestConfig} ${ComplexScaleContractionTestSources}) # Complex Scale M6N6K6 tests -set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/complex_scale_test_params_rank6.yaml) +set (ComplexScaleContractionTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/complex_scale_test_params_rank6.yaml) add_hiptensor_test(complex_scale_contraction_test_m6n6k6 ${ComplexScaleContractionTestConfig} ${ComplexScaleContractionTestSources}) # Contraction mode tests set (ContractionModeTestSources ${ContractionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/contraction_mode_test.cpp) +${CMAKE_CURRENT_SOURCE_DIR}/contraction_mode_test.cpp) set (ContractionModeTestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/mode_test_params.yaml) add_hiptensor_test(contraction_mode_test ${ContractionModeTestConfig} ${ContractionModeTestSources}) diff --git a/test/01_contraction/configs/bench/bilinear_test_params_rank1.yaml b/test/01_contraction/configs/bench/bilinear_test_params_rank1.yaml new file mode 100644 index 00000000..b24ce5eb --- /dev/null +++ b/test/01_contraction/configs/bench/bilinear_test_params_rank1.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[128, 128], [128, 128], [128, 128]] + - [[256, 111], [64, 111], [256, 64]] + - [[139, 256], [141, 256], [139, 141]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/bench/bilinear_test_params_rank2.yaml b/test/01_contraction/configs/bench/bilinear_test_params_rank2.yaml new file mode 100644 index 00000000..38a97d95 --- /dev/null +++ b/test/01_contraction/configs/bench/bilinear_test_params_rank2.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4], [3, 4, 3, 4], [5, 6, 3, 4]] + - [[4, 3, 6, 5], [4, 3, 6, 5], [4, 3, 4, 3]] + - [[4, 8, 9, 1], [2, 4, 9, 1], [4, 8, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/bench/bilinear_test_params_rank3.yaml b/test/01_contraction/configs/bench/bilinear_test_params_rank3.yaml new file mode 100644 index 00000000..70ebdc30 --- /dev/null +++ b/test/01_contraction/configs/bench/bilinear_test_params_rank3.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4, 3, 4], [2, 3, 4, 4, 3, 4], [5, 6, 3, 2, 3, 4]] + - [[4, 3, 6, 5, 1, 3], [1, 2, 4, 5, 1, 3], [4, 3, 6, 1, 2, 4]] + - [[4, 2, 3, 1, 2, 4], [2, 4, 3, 1, 2, 4], [4, 2, 3, 2, 4, 3]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/bench/bilinear_test_params_rank4.yaml b/test/01_contraction/configs/bench/bilinear_test_params_rank4.yaml new file mode 100644 index 00000000..f51275c3 --- /dev/null +++ b/test/01_contraction/configs/bench/bilinear_test_params_rank4.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2], [2, 3, 4, 3, 4, 3, 4, 2], [5, 6, 3, 1, 2, 3, 4, 3]] + - [[4, 3, 6, 2, 5, 1, 3, 3], [1, 2, 4, 1, 5, 1, 3, 3], [4, 3, 6, 2, 1, 2, 4, 1]] + - [[4, 2, 3, 3, 1, 2, 4, 5], [2, 4, 3, 6, 1, 2, 4, 5], [4, 2, 3, 3, 2, 4, 3, 6]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/bench/bilinear_test_params_rank5.yaml b/test/01_contraction/configs/bench/bilinear_test_params_rank5.yaml new file mode 100644 index 00000000..adfde5c5 --- /dev/null +++ b/test/01_contraction/configs/bench/bilinear_test_params_rank5.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/bench/bilinear_test_params_rank6.yaml b/test/01_contraction/configs/bench/bilinear_test_params_rank6.yaml new file mode 100644 index 00000000..e9efa018 --- /dev/null +++ b/test/01_contraction/configs/bench/bilinear_test_params_rank6.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 3, 3, 1, 4, 2, 3, 4, 2, 3, 1, 2], [2, 3, 4, 3, 4, 2, 3, 4, 2, 3, 1, 2], [5, 3, 3, 1, 4, 2, 2, 3, 4, 3, 4, 2]] + - [[4, 3, 3, 2, 1, 2, 5, 1, 3, 3, 3, 2], [1, 2, 4, 1, 3, 2, 5, 1, 3, 3, 3, 2], [4, 3, 3, 2, 1, 2, 1, 2, 4, 1, 3, 2]] + - [[3, 2, 3, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 3, 3, 1, 4, 1, 2, 4, 5, 3, 5], [3, 2, 3, 3, 4, 3, 2, 4, 3, 3, 1, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/bench/complex_bilinear_test_params_rank1.yaml b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank1.yaml new file mode 100644 index 00000000..4779b8b1 --- /dev/null +++ b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank1.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[64, 64], [64, 64], [64, 64]] + - [[113, 64], [119, 64], [113, 119]] + - [[51, 65], [17, 65], [51, 17]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/bench/complex_bilinear_test_params_rank2.yaml b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank2.yaml new file mode 100644 index 00000000..afef1a6a --- /dev/null +++ b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank2.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 6, 1], [2, 3, 6, 1], [5, 6, 2, 3]] + - [[4, 3, 3, 3], [1, 2, 3, 3], [4, 3, 1, 2]] + - [[6, 2, 5, 6], [2, 4, 5, 6], [6, 2, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/bench/complex_bilinear_test_params_rank3.yaml b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank3.yaml new file mode 100644 index 00000000..4aa74a7e --- /dev/null +++ b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank3.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 1, 4, 3, 6, 1], [2, 3, 4, 3, 6, 1], [5, 1, 4, 2, 3, 4]] + - [[4, 2, 1, 5, 3, 3], [1, 1, 3, 5, 3, 3], [4, 2, 1, 1, 1, 3]] + - [[6, 3, 4, 1, 5, 6], [2, 6, 1, 1, 5, 6], [6, 3, 4, 2, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/bench/complex_bilinear_test_params_rank4.yaml b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank4.yaml new file mode 100644 index 00000000..6128827b --- /dev/null +++ b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank4.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 3, 1, 4, 3, 2, 6, 1], [2, 4, 3, 4, 3, 2, 6, 1], [5, 3, 1, 4, 2, 4, 3, 4]] + - [[3, 6, 2, 1, 1, 3, 3, 3], [2, 4, 1, 3, 1, 3, 3, 3], [3, 6, 2, 1, 2, 4, 1, 3]] + - [[6, 3, 3, 4, 1, 4, 5, 6], [2, 3, 6, 1, 1, 4, 5, 6], [6, 3, 3, 4, 2, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/bench/complex_bilinear_test_params_rank5.yaml b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank5.yaml new file mode 100644 index 00000000..2e8cf460 --- /dev/null +++ b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank5.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/bench/complex_bilinear_test_params_rank6.yaml b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank6.yaml new file mode 100644 index 00000000..6135de29 --- /dev/null +++ b/test/01_contraction/configs/bench/complex_bilinear_test_params_rank6.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 3, 3, 3, 4, 2, 3, 4, 2, 3, 3, 2], [2, 3, 4, 2, 4, 2, 3, 4, 2, 3, 3, 2], [5, 3, 3, 3, 4, 2, 2, 3, 4, 2, 4, 2]] + - [[4, 3, 3, 2, 3, 2, 5, 1, 3, 2, 3, 2], [3, 2, 4, 1, 3, 2, 5, 1, 3, 2, 3, 2], [4, 3, 3, 2, 3, 2, 3, 2, 4, 1, 3, 2]] + - [[3, 2, 2, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 2, 3, 3, 4, 1, 2, 4, 5, 3, 5], [3, 2, 2, 3, 4, 3, 2, 4, 2, 3, 3, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/bench/complex_scale_test_params_rank1.yaml b/test/01_contraction/configs/bench/complex_scale_test_params_rank1.yaml new file mode 100644 index 00000000..91e7d002 --- /dev/null +++ b/test/01_contraction/configs/bench/complex_scale_test_params_rank1.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[96, 96], [96, 96], [96, 96]] + - [[57, 64], [123, 64], [57, 123]] + - [[111, 69], [113, 69], [111, 113]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/bench/complex_scale_test_params_rank2.yaml b/test/01_contraction/configs/bench/complex_scale_test_params_rank2.yaml new file mode 100644 index 00000000..67d35023 --- /dev/null +++ b/test/01_contraction/configs/bench/complex_scale_test_params_rank2.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 4], [3, 4, 3, 4], [5, 6, 3, 4]] + - [[4, 3, 6, 5], [4, 3, 6, 5], [4, 3, 4, 3]] + - [[4, 2, 9, 1], [2, 4, 9, 1], [4, 2, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/bench/complex_scale_test_params_rank3.yaml b/test/01_contraction/configs/bench/complex_scale_test_params_rank3.yaml new file mode 100644 index 00000000..90965dec --- /dev/null +++ b/test/01_contraction/configs/bench/complex_scale_test_params_rank3.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 4, 3, 4], [2, 3, 4, 4, 3, 4], [5, 6, 3, 2, 3, 4]] + - [[4, 3, 6, 5, 1, 3], [1, 2, 4, 5, 1, 3], [4, 3, 6, 1, 2, 4]] + - [[4, 2, 3, 1, 2, 4], [2, 4, 3, 1, 2, 4], [4, 2, 3, 2, 4, 3]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/bench/complex_scale_test_params_rank4.yaml b/test/01_contraction/configs/bench/complex_scale_test_params_rank4.yaml new file mode 100644 index 00000000..44bf152f --- /dev/null +++ b/test/01_contraction/configs/bench/complex_scale_test_params_rank4.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2], [2, 3, 4, 3, 4, 3, 4, 2], [5, 6, 3, 1, 2, 3, 4, 3]] + - [[4, 3, 6, 2, 5, 1, 3, 3], [1, 2, 4, 1, 5, 1, 3, 3], [4, 3, 6, 2, 1, 2, 4, 1]] + - [[4, 2, 3, 3, 1, 2, 4, 5], [2, 4, 3, 6, 1, 2, 4, 5], [4, 2, 3, 3, 2, 4, 3, 6]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/bench/complex_scale_test_params_rank5.yaml b/test/01_contraction/configs/bench/complex_scale_test_params_rank5.yaml new file mode 100644 index 00000000..0ec0a5cc --- /dev/null +++ b/test/01_contraction/configs/bench/complex_scale_test_params_rank5.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/bench/complex_scale_test_params_rank6.yaml b/test/01_contraction/configs/bench/complex_scale_test_params_rank6.yaml new file mode 100644 index 00000000..b5ac45e0 --- /dev/null +++ b/test/01_contraction/configs/bench/complex_scale_test_params_rank6.yaml @@ -0,0 +1,30 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 3, 3, 1, 4, 2, 3, 4, 2, 3, 1, 2], [2, 3, 4, 3, 4, 2, 3, 4, 2, 3, 1, 2], [5, 3, 3, 1, 4, 2, 2, 3, 4, 3, 4, 2]] + - [[4, 3, 3, 2, 1, 2, 5, 1, 3, 3, 3, 2], [1, 2, 4, 1, 3, 2, 5, 1, 3, 3, 3, 2], [4, 3, 3, 2, 1, 2, 1, 2, 4, 1, 3, 2]] + - [[3, 2, 3, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 3, 3, 1, 4, 1, 2, 4, 5, 3, 5], [3, 2, 3, 3, 4, 3, 2, 4, 3, 3, 1, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/bench/scale_test_params_rank1.yaml b/test/01_contraction/configs/bench/scale_test_params_rank1.yaml new file mode 100644 index 00000000..9113e669 --- /dev/null +++ b/test/01_contraction/configs/bench/scale_test_params_rank1.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[66, 66], [66, 66], [66, 66]] + - [[256, 111], [64, 111], [256, 64]] + - [[3, 55], [71, 55], [3, 71]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/bench/scale_test_params_rank2.yaml b/test/01_contraction/configs/bench/scale_test_params_rank2.yaml new file mode 100644 index 00000000..90aa8afb --- /dev/null +++ b/test/01_contraction/configs/bench/scale_test_params_rank2.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4], [3, 4, 3, 4], [5, 6, 3, 4]] + - [[4, 3, 6, 5], [4, 3, 6, 5], [4, 3, 4, 3]] + - [[4, 1, 9, 1], [2, 4, 9, 1], [4, 1, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/bench/scale_test_params_rank3.yaml b/test/01_contraction/configs/bench/scale_test_params_rank3.yaml new file mode 100644 index 00000000..9344b186 --- /dev/null +++ b/test/01_contraction/configs/bench/scale_test_params_rank3.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4, 3, 4], [2, 3, 4, 4, 3, 4], [5, 6, 3, 2, 3, 4]] + - [[4, 3, 6, 5, 1, 3], [7, 2, 4, 5, 1, 3], [4, 3, 6, 7, 2, 4]] + - [[4, 1, 3, 1, 2, 4], [2, 4, 3, 1, 2, 4], [4, 1, 3, 2, 4, 3]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/bench/scale_test_params_rank4.yaml b/test/01_contraction/configs/bench/scale_test_params_rank4.yaml new file mode 100644 index 00000000..caf4297d --- /dev/null +++ b/test/01_contraction/configs/bench/scale_test_params_rank4.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 7, 4, 3, 4, 2], [2, 3, 4, 3, 4, 3, 4, 2], [5, 6, 3, 7, 2, 3, 4, 3]] + - [[4, 3, 6, 2, 5, 1, 3, 3], [7, 2, 4, 1, 5, 1, 3, 3], [4, 3, 6, 2, 7, 2, 4, 1]] + - [[4, 2, 3, 3, 1, 2, 4, 5], [2, 4, 3, 6, 1, 2, 4, 5], [4, 2, 3, 3, 2, 4, 3, 6]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/bench/scale_test_params_rank5.yaml b/test/01_contraction/configs/bench/scale_test_params_rank5.yaml new file mode 100644 index 00000000..491a396d --- /dev/null +++ b/test/01_contraction/configs/bench/scale_test_params_rank5.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/bench/scale_test_params_rank6.yaml b/test/01_contraction/configs/bench/scale_test_params_rank6.yaml new file mode 100644 index 00000000..6751f85a --- /dev/null +++ b/test/01_contraction/configs/bench/scale_test_params_rank6.yaml @@ -0,0 +1,35 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 3, 3, 1, 4, 2, 3, 4, 2, 3, 1, 2], [2, 3, 4, 3, 4, 2, 3, 4, 2, 3, 1, 2], [5, 3, 3, 1, 4, 2, 2, 3, 4, 3, 4, 2]] + - [[4, 3, 3, 2, 1, 2, 5, 1, 3, 3, 3, 2], [1, 2, 4, 1, 3, 2, 5, 1, 3, 3, 3, 2], [4, 3, 3, 2, 1, 2, 1, 2, 4, 1, 3, 2]] + - [[3, 2, 3, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 3, 3, 1, 4, 1, 2, 4, 5, 3, 5], [3, 2, 3, 3, 4, 3, 2, 4, 3, 3, 1, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/bilinear_test_params_rank1.yaml b/test/01_contraction/configs/extended/bilinear_test_params_rank1.yaml similarity index 100% rename from test/01_contraction/configs/bilinear_test_params_rank1.yaml rename to test/01_contraction/configs/extended/bilinear_test_params_rank1.yaml diff --git a/test/01_contraction/configs/bilinear_test_params_rank2.yaml b/test/01_contraction/configs/extended/bilinear_test_params_rank2.yaml similarity index 100% rename from test/01_contraction/configs/bilinear_test_params_rank2.yaml rename to test/01_contraction/configs/extended/bilinear_test_params_rank2.yaml diff --git a/test/01_contraction/configs/bilinear_test_params_rank3.yaml b/test/01_contraction/configs/extended/bilinear_test_params_rank3.yaml similarity index 100% rename from test/01_contraction/configs/bilinear_test_params_rank3.yaml rename to test/01_contraction/configs/extended/bilinear_test_params_rank3.yaml diff --git a/test/01_contraction/configs/bilinear_test_params_rank4.yaml b/test/01_contraction/configs/extended/bilinear_test_params_rank4.yaml similarity index 100% rename from test/01_contraction/configs/bilinear_test_params_rank4.yaml rename to test/01_contraction/configs/extended/bilinear_test_params_rank4.yaml diff --git a/test/01_contraction/configs/bilinear_test_params_rank5.yaml b/test/01_contraction/configs/extended/bilinear_test_params_rank5.yaml similarity index 100% rename from test/01_contraction/configs/bilinear_test_params_rank5.yaml rename to test/01_contraction/configs/extended/bilinear_test_params_rank5.yaml diff --git a/test/01_contraction/configs/bilinear_test_params_rank6.yaml b/test/01_contraction/configs/extended/bilinear_test_params_rank6.yaml similarity index 100% rename from test/01_contraction/configs/bilinear_test_params_rank6.yaml rename to test/01_contraction/configs/extended/bilinear_test_params_rank6.yaml diff --git a/test/01_contraction/configs/complex_bilinear_test_params_rank1.yaml b/test/01_contraction/configs/extended/complex_bilinear_test_params_rank1.yaml similarity index 100% rename from test/01_contraction/configs/complex_bilinear_test_params_rank1.yaml rename to test/01_contraction/configs/extended/complex_bilinear_test_params_rank1.yaml diff --git a/test/01_contraction/configs/complex_bilinear_test_params_rank2.yaml b/test/01_contraction/configs/extended/complex_bilinear_test_params_rank2.yaml similarity index 100% rename from test/01_contraction/configs/complex_bilinear_test_params_rank2.yaml rename to test/01_contraction/configs/extended/complex_bilinear_test_params_rank2.yaml diff --git a/test/01_contraction/configs/complex_bilinear_test_params_rank3.yaml b/test/01_contraction/configs/extended/complex_bilinear_test_params_rank3.yaml similarity index 100% rename from test/01_contraction/configs/complex_bilinear_test_params_rank3.yaml rename to test/01_contraction/configs/extended/complex_bilinear_test_params_rank3.yaml diff --git a/test/01_contraction/configs/complex_bilinear_test_params_rank4.yaml b/test/01_contraction/configs/extended/complex_bilinear_test_params_rank4.yaml similarity index 100% rename from test/01_contraction/configs/complex_bilinear_test_params_rank4.yaml rename to test/01_contraction/configs/extended/complex_bilinear_test_params_rank4.yaml diff --git a/test/01_contraction/configs/complex_bilinear_test_params_rank5.yaml b/test/01_contraction/configs/extended/complex_bilinear_test_params_rank5.yaml similarity index 100% rename from test/01_contraction/configs/complex_bilinear_test_params_rank5.yaml rename to test/01_contraction/configs/extended/complex_bilinear_test_params_rank5.yaml diff --git a/test/01_contraction/configs/complex_bilinear_test_params_rank6.yaml b/test/01_contraction/configs/extended/complex_bilinear_test_params_rank6.yaml similarity index 100% rename from test/01_contraction/configs/complex_bilinear_test_params_rank6.yaml rename to test/01_contraction/configs/extended/complex_bilinear_test_params_rank6.yaml diff --git a/test/01_contraction/configs/complex_scale_test_params_rank1.yaml b/test/01_contraction/configs/extended/complex_scale_test_params_rank1.yaml similarity index 100% rename from test/01_contraction/configs/complex_scale_test_params_rank1.yaml rename to test/01_contraction/configs/extended/complex_scale_test_params_rank1.yaml diff --git a/test/01_contraction/configs/complex_scale_test_params_rank2.yaml b/test/01_contraction/configs/extended/complex_scale_test_params_rank2.yaml similarity index 100% rename from test/01_contraction/configs/complex_scale_test_params_rank2.yaml rename to test/01_contraction/configs/extended/complex_scale_test_params_rank2.yaml diff --git a/test/01_contraction/configs/complex_scale_test_params_rank3.yaml b/test/01_contraction/configs/extended/complex_scale_test_params_rank3.yaml similarity index 100% rename from test/01_contraction/configs/complex_scale_test_params_rank3.yaml rename to test/01_contraction/configs/extended/complex_scale_test_params_rank3.yaml diff --git a/test/01_contraction/configs/complex_scale_test_params_rank4.yaml b/test/01_contraction/configs/extended/complex_scale_test_params_rank4.yaml similarity index 100% rename from test/01_contraction/configs/complex_scale_test_params_rank4.yaml rename to test/01_contraction/configs/extended/complex_scale_test_params_rank4.yaml diff --git a/test/01_contraction/configs/complex_scale_test_params_rank5.yaml b/test/01_contraction/configs/extended/complex_scale_test_params_rank5.yaml similarity index 100% rename from test/01_contraction/configs/complex_scale_test_params_rank5.yaml rename to test/01_contraction/configs/extended/complex_scale_test_params_rank5.yaml diff --git a/test/01_contraction/configs/complex_scale_test_params_rank6.yaml b/test/01_contraction/configs/extended/complex_scale_test_params_rank6.yaml similarity index 100% rename from test/01_contraction/configs/complex_scale_test_params_rank6.yaml rename to test/01_contraction/configs/extended/complex_scale_test_params_rank6.yaml diff --git a/test/01_contraction/configs/scale_test_params_rank1.yaml b/test/01_contraction/configs/extended/scale_test_params_rank1.yaml similarity index 100% rename from test/01_contraction/configs/scale_test_params_rank1.yaml rename to test/01_contraction/configs/extended/scale_test_params_rank1.yaml diff --git a/test/01_contraction/configs/scale_test_params_rank2.yaml b/test/01_contraction/configs/extended/scale_test_params_rank2.yaml similarity index 100% rename from test/01_contraction/configs/scale_test_params_rank2.yaml rename to test/01_contraction/configs/extended/scale_test_params_rank2.yaml diff --git a/test/01_contraction/configs/scale_test_params_rank3.yaml b/test/01_contraction/configs/extended/scale_test_params_rank3.yaml similarity index 100% rename from test/01_contraction/configs/scale_test_params_rank3.yaml rename to test/01_contraction/configs/extended/scale_test_params_rank3.yaml diff --git a/test/01_contraction/configs/scale_test_params_rank4.yaml b/test/01_contraction/configs/extended/scale_test_params_rank4.yaml similarity index 100% rename from test/01_contraction/configs/scale_test_params_rank4.yaml rename to test/01_contraction/configs/extended/scale_test_params_rank4.yaml diff --git a/test/01_contraction/configs/scale_test_params_rank5.yaml b/test/01_contraction/configs/extended/scale_test_params_rank5.yaml similarity index 100% rename from test/01_contraction/configs/scale_test_params_rank5.yaml rename to test/01_contraction/configs/extended/scale_test_params_rank5.yaml diff --git a/test/01_contraction/configs/scale_test_params_rank6.yaml b/test/01_contraction/configs/extended/scale_test_params_rank6.yaml similarity index 100% rename from test/01_contraction/configs/scale_test_params_rank6.yaml rename to test/01_contraction/configs/extended/scale_test_params_rank6.yaml diff --git a/test/01_contraction/configs/validation/bilinear_test_params_rank1.yaml b/test/01_contraction/configs/validation/bilinear_test_params_rank1.yaml new file mode 100644 index 00000000..2a003fe6 --- /dev/null +++ b/test/01_contraction/configs/validation/bilinear_test_params_rank1.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[128, 128], [128, 128], [128, 128]] + - [[256, 111], [64, 111], [256, 64]] + - [[139, 256], [141, 256], [139, 141]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/validation/bilinear_test_params_rank2.yaml b/test/01_contraction/configs/validation/bilinear_test_params_rank2.yaml new file mode 100644 index 00000000..a14a5e77 --- /dev/null +++ b/test/01_contraction/configs/validation/bilinear_test_params_rank2.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4], [3, 4, 3, 4], [5, 6, 3, 4]] + - [[4, 3, 6, 5], [4, 3, 6, 5], [4, 3, 4, 3]] + - [[4, 8, 9, 1], [2, 4, 9, 1], [4, 8, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/validation/bilinear_test_params_rank3.yaml b/test/01_contraction/configs/validation/bilinear_test_params_rank3.yaml new file mode 100644 index 00000000..d90aaf7f --- /dev/null +++ b/test/01_contraction/configs/validation/bilinear_test_params_rank3.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4, 3, 4], [2, 3, 4, 4, 3, 4], [5, 6, 3, 2, 3, 4]] + - [[4, 3, 6, 5, 1, 3], [1, 2, 4, 5, 1, 3], [4, 3, 6, 1, 2, 4]] + - [[4, 2, 3, 1, 2, 4], [2, 4, 3, 1, 2, 4], [4, 2, 3, 2, 4, 3]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/validation/bilinear_test_params_rank4.yaml b/test/01_contraction/configs/validation/bilinear_test_params_rank4.yaml new file mode 100644 index 00000000..77a346da --- /dev/null +++ b/test/01_contraction/configs/validation/bilinear_test_params_rank4.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2], [2, 3, 4, 3, 4, 3, 4, 2], [5, 6, 3, 1, 2, 3, 4, 3]] + - [[4, 3, 6, 2, 5, 1, 3, 3], [1, 2, 4, 1, 5, 1, 3, 3], [4, 3, 6, 2, 1, 2, 4, 1]] + - [[4, 2, 3, 3, 1, 2, 4, 5], [2, 4, 3, 6, 1, 2, 4, 5], [4, 2, 3, 3, 2, 4, 3, 6]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/validation/bilinear_test_params_rank5.yaml b/test/01_contraction/configs/validation/bilinear_test_params_rank5.yaml new file mode 100644 index 00000000..c0e49263 --- /dev/null +++ b/test/01_contraction/configs/validation/bilinear_test_params_rank5.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/validation/bilinear_test_params_rank6.yaml b/test/01_contraction/configs/validation/bilinear_test_params_rank6.yaml new file mode 100644 index 00000000..ab3d110f --- /dev/null +++ b/test/01_contraction/configs/validation/bilinear_test_params_rank6.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 3, 3, 1, 4, 2, 3, 4, 2, 3, 1, 2], [2, 3, 4, 3, 4, 2, 3, 4, 2, 3, 1, 2], [5, 3, 3, 1, 4, 2, 2, 3, 4, 3, 4, 2]] + - [[4, 3, 3, 2, 1, 2, 5, 1, 3, 3, 3, 2], [1, 2, 4, 1, 3, 2, 5, 1, 3, 3, 3, 2], [4, 3, 3, 2, 1, 2, 1, 2, 4, 1, 3, 2]] + - [[3, 2, 3, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 3, 3, 1, 4, 1, 2, 4, 5, 3, 5], [3, 2, 3, 3, 4, 3, 2, 4, 3, 3, 1, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/validation/complex_bilinear_test_params_rank1.yaml b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank1.yaml new file mode 100644 index 00000000..62a26b85 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank1.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[64, 64], [64, 64], [64, 64]] + - [[113, 64], [119, 64], [113, 119]] + - [[51, 65], [17, 65], [51, 17]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/validation/complex_bilinear_test_params_rank2.yaml b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank2.yaml new file mode 100644 index 00000000..3fe41c26 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank2.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 6, 1], [2, 3, 6, 1], [5, 6, 2, 3]] + - [[4, 3, 3, 3], [1, 2, 3, 3], [4, 3, 1, 2]] + - [[6, 2, 5, 6], [2, 4, 5, 6], [6, 2, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/validation/complex_bilinear_test_params_rank3.yaml b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank3.yaml new file mode 100644 index 00000000..d80f24dc --- /dev/null +++ b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank3.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 1, 4, 3, 6, 1], [2, 3, 4, 3, 6, 1], [5, 1, 4, 2, 3, 4]] + - [[4, 2, 1, 5, 3, 3], [1, 1, 3, 5, 3, 3], [4, 2, 1, 1, 1, 3]] + - [[6, 3, 4, 1, 5, 6], [2, 6, 1, 1, 5, 6], [6, 3, 4, 2, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/validation/complex_bilinear_test_params_rank4.yaml b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank4.yaml new file mode 100644 index 00000000..134b7de7 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank4.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 3, 1, 4, 3, 2, 6, 1], [2, 4, 3, 4, 3, 2, 6, 1], [5, 3, 1, 4, 2, 4, 3, 4]] + - [[3, 6, 2, 1, 1, 3, 3, 3], [2, 4, 1, 3, 1, 3, 3, 3], [3, 6, 2, 1, 2, 4, 1, 3]] + - [[6, 3, 3, 4, 1, 4, 5, 6], [2, 3, 6, 1, 1, 4, 5, 6], [6, 3, 3, 4, 2, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/validation/complex_bilinear_test_params_rank5.yaml b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank5.yaml new file mode 100644 index 00000000..bbe5a912 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank5.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/validation/complex_bilinear_test_params_rank6.yaml b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank6.yaml new file mode 100644 index 00000000..11236f86 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_bilinear_test_params_rank6.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 3, 3, 3, 4, 2, 3, 4, 2, 3, 3, 2], [2, 3, 4, 2, 4, 2, 3, 4, 2, 3, 3, 2], [5, 3, 3, 3, 4, 2, 2, 3, 4, 2, 4, 2]] + - [[4, 3, 3, 2, 3, 2, 5, 1, 3, 2, 3, 2], [3, 2, 4, 1, 3, 2, 5, 1, 3, 2, 3, 2], [4, 3, 3, 2, 3, 2, 3, 2, 4, 1, 3, 2]] + - [[3, 2, 2, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 2, 3, 3, 4, 1, 2, 4, 5, 3, 5], [3, 2, 2, 3, 4, 3, 2, 4, 2, 3, 3, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/validation/complex_scale_test_params_rank1.yaml b/test/01_contraction/configs/validation/complex_scale_test_params_rank1.yaml new file mode 100644 index 00000000..65563868 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_scale_test_params_rank1.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[96, 96], [96, 96], [96, 96]] + - [[57, 64], [123, 64], [57, 123]] + - [[111, 69], [113, 69], [111, 113]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/validation/complex_scale_test_params_rank2.yaml b/test/01_contraction/configs/validation/complex_scale_test_params_rank2.yaml new file mode 100644 index 00000000..9031f322 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_scale_test_params_rank2.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 4], [3, 4, 3, 4], [5, 6, 3, 4]] + - [[4, 3, 6, 5], [4, 3, 6, 5], [4, 3, 4, 3]] + - [[4, 2, 9, 1], [2, 4, 9, 1], [4, 2, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/validation/complex_scale_test_params_rank3.yaml b/test/01_contraction/configs/validation/complex_scale_test_params_rank3.yaml new file mode 100644 index 00000000..bef116ec --- /dev/null +++ b/test/01_contraction/configs/validation/complex_scale_test_params_rank3.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 4, 3, 4], [2, 3, 4, 4, 3, 4], [5, 6, 3, 2, 3, 4]] + - [[4, 3, 6, 5, 1, 3], [1, 2, 4, 5, 1, 3], [4, 3, 6, 1, 2, 4]] + - [[4, 2, 3, 1, 2, 4], [2, 4, 3, 1, 2, 4], [4, 2, 3, 2, 4, 3]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/validation/complex_scale_test_params_rank4.yaml b/test/01_contraction/configs/validation/complex_scale_test_params_rank4.yaml new file mode 100644 index 00000000..1c334f4c --- /dev/null +++ b/test/01_contraction/configs/validation/complex_scale_test_params_rank4.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2], [2, 3, 4, 3, 4, 3, 4, 2], [5, 6, 3, 1, 2, 3, 4, 3]] + - [[4, 3, 6, 2, 5, 1, 3, 3], [1, 2, 4, 1, 5, 1, 3, 3], [4, 3, 6, 2, 1, 2, 4, 1]] + - [[4, 2, 3, 3, 1, 2, 4, 5], [2, 4, 3, 6, 1, 2, 4, 5], [4, 2, 3, 3, 2, 4, 3, 6]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/validation/complex_scale_test_params_rank5.yaml b/test/01_contraction/configs/validation/complex_scale_test_params_rank5.yaml new file mode 100644 index 00000000..7873ea1c --- /dev/null +++ b/test/01_contraction/configs/validation/complex_scale_test_params_rank5.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/validation/complex_scale_test_params_rank6.yaml b/test/01_contraction/configs/validation/complex_scale_test_params_rank6.yaml new file mode 100644 index 00000000..fe25f401 --- /dev/null +++ b/test/01_contraction/configs/validation/complex_scale_test_params_rank6.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_C_32F, HIP_C_32F, NONE_TYPE, HIP_C_32F, HIP_C_32F ] + - [ HIP_C_64F, HIP_C_64F, NONE_TYPE, HIP_C_64F, HIP_C_64F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0, 0] + - [1, 1] + - [1.1, 1.2] +Betas: + - [2, 2] + - [0, 0] + - [2.2, 2.3] +Lengths: + - [[5, 3, 3, 1, 4, 2, 3, 4, 2, 3, 1, 2], [2, 3, 4, 3, 4, 2, 3, 4, 2, 3, 1, 2], [5, 3, 3, 1, 4, 2, 2, 3, 4, 3, 4, 2]] + - [[4, 3, 3, 2, 1, 2, 5, 1, 3, 3, 3, 2], [1, 2, 4, 1, 3, 2, 5, 1, 3, 3, 3, 2], [4, 3, 3, 2, 1, 2, 1, 2, 4, 1, 3, 2]] + - [[3, 2, 3, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 3, 3, 1, 4, 1, 2, 4, 5, 3, 5], [3, 2, 3, 3, 4, 3, 2, 4, 3, 3, 1, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/configs/validation/scale_test_params_rank1.yaml b/test/01_contraction/configs/validation/scale_test_params_rank1.yaml new file mode 100644 index 00000000..5e91faa2 --- /dev/null +++ b/test/01_contraction/configs/validation/scale_test_params_rank1.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[66, 66], [66, 66], [66, 66]] + - [[256, 111], [64, 111], [256, 64]] + - [[3, 55], [71, 55], [3, 71]] +Strides: + - [] +Modes: + - [[0, 1], [2, 1], [0, 2]] +... diff --git a/test/01_contraction/configs/validation/scale_test_params_rank2.yaml b/test/01_contraction/configs/validation/scale_test_params_rank2.yaml new file mode 100644 index 00000000..747b3faa --- /dev/null +++ b/test/01_contraction/configs/validation/scale_test_params_rank2.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4], [3, 4, 3, 4], [5, 6, 3, 4]] + - [[4, 3, 6, 5], [4, 3, 6, 5], [4, 3, 4, 3]] + - [[4, 1, 9, 1], [2, 4, 9, 1], [4, 1, 2, 4]] +Strides: + - [] +Modes: + - [[0, 1, 4, 5], [2, 3, 4, 5], [0, 1, 2, 3]] +... diff --git a/test/01_contraction/configs/validation/scale_test_params_rank3.yaml b/test/01_contraction/configs/validation/scale_test_params_rank3.yaml new file mode 100644 index 00000000..e33db922 --- /dev/null +++ b/test/01_contraction/configs/validation/scale_test_params_rank3.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 4, 3, 4], [2, 3, 4, 4, 3, 4], [5, 6, 3, 2, 3, 4]] + - [[4, 3, 6, 5, 1, 3], [7, 2, 4, 5, 1, 3], [4, 3, 6, 7, 2, 4]] + - [[4, 1, 3, 1, 2, 4], [2, 4, 3, 1, 2, 4], [4, 1, 3, 2, 4, 3]] +Strides: + - [] +Modes: + - [[0, 1, 2, 6, 7, 8], [3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5]] +... diff --git a/test/01_contraction/configs/validation/scale_test_params_rank4.yaml b/test/01_contraction/configs/validation/scale_test_params_rank4.yaml new file mode 100644 index 00000000..cca5ae2e --- /dev/null +++ b/test/01_contraction/configs/validation/scale_test_params_rank4.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 7, 4, 3, 4, 2], [2, 3, 4, 3, 4, 3, 4, 2], [5, 6, 3, 7, 2, 3, 4, 3]] + - [[4, 3, 6, 2, 5, 1, 3, 3], [7, 2, 4, 1, 5, 1, 3, 3], [4, 3, 6, 2, 7, 2, 4, 1]] + - [[4, 2, 3, 3, 1, 2, 4, 5], [2, 4, 3, 6, 1, 2, 4, 5], [4, 2, 3, 3, 2, 4, 3, 6]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 8, 9, 10, 11], [4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3, 4, 5, 6, 7]] +... diff --git a/test/01_contraction/configs/validation/scale_test_params_rank5.yaml b/test/01_contraction/configs/validation/scale_test_params_rank5.yaml new file mode 100644 index 00000000..a87efa04 --- /dev/null +++ b/test/01_contraction/configs/validation/scale_test_params_rank5.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 6, 3, 1, 4, 3, 4, 2, 6, 1], [2, 3, 4, 3, 4, 3, 4, 2, 6, 1], [5, 6, 3, 1, 4, 2, 3, 4, 3, 4]] + - [[4, 3, 6, 2, 1, 5, 1, 3, 3, 3], [1, 2, 4, 1, 3, 5, 1, 3, 3, 3], [4, 3, 6, 2, 1, 1, 2, 4, 1, 3]] + - [[6, 2, 3, 3, 4, 1, 2, 4, 5, 6], [2, 4, 3, 6, 1, 1, 2, 4, 5, 6], [6, 2, 3, 3, 4, 2, 4, 3, 6, 1]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 10, 11, 12, 13, 14], [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] +... diff --git a/test/01_contraction/configs/validation/scale_test_params_rank6.yaml b/test/01_contraction/configs/validation/scale_test_params_rank6.yaml new file mode 100644 index 00000000..3d6b17a1 --- /dev/null +++ b/test/01_contraction/configs/validation/scale_test_params_rank6.yaml @@ -0,0 +1,37 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F, NONE_TYPE, HIP_R_16F, HIP_R_32F ] + - [ HIP_R_16BF, HIP_R_16BF, NONE_TYPE, HIP_R_16BF, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_32F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16F ] + - [ HIP_R_32F, HIP_R_32F, NONE_TYPE, HIP_R_32F, HIP_R_16BF ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_64F ] + - [ HIP_R_64F, HIP_R_64F, NONE_TYPE, HIP_R_64F, HIP_R_32F ] +Algorithm Types: + - HIPTENSOR_ALGO_DEFAULT + - HIPTENSOR_ALGO_DEFAULT_PATIENT + - HIPTENSOR_ALGO_ACTOR_CRITIC +Operators: + - HIPTENSOR_OP_IDENTITY +Worksize Prefs: + - HIPTENSOR_WORKSPACE_RECOMMENDED + - HIPTENSOR_WORKSPACE_MIN + - HIPTENSOR_WORKSPACE_MAX +Alphas: + - [0] + - [1] + - [1] +Betas: + - [2] + - [0] + - [2] +Lengths: + - [[5, 3, 3, 1, 4, 2, 3, 4, 2, 3, 1, 2], [2, 3, 4, 3, 4, 2, 3, 4, 2, 3, 1, 2], [5, 3, 3, 1, 4, 2, 2, 3, 4, 3, 4, 2]] + - [[4, 3, 3, 2, 1, 2, 5, 1, 3, 3, 3, 2], [1, 2, 4, 1, 3, 2, 5, 1, 3, 3, 3, 2], [4, 3, 3, 2, 1, 2, 1, 2, 4, 1, 3, 2]] + - [[3, 2, 3, 3, 4, 3, 1, 2, 4, 5, 3, 5], [2, 4, 3, 3, 1, 4, 1, 2, 4, 5, 3, 5], [3, 2, 3, 3, 4, 3, 2, 4, 3, 3, 1, 4]] +Strides: + - [] +Modes: + - [[0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17], [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]] +... diff --git a/test/01_contraction/contraction_test.cpp b/test/01_contraction/contraction_test.cpp index 631e6cd4..f58e53d8 100644 --- a/test/01_contraction/contraction_test.cpp +++ b/test/01_contraction/contraction_test.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,7 @@ #include #include "data_types.hpp" -#include "llvm/hiptensor_options.hpp" +#include "hiptensor_options.hpp" #include "contraction/contraction_cpu_reference.hpp" #include "contraction_test.hpp" @@ -34,7 +34,8 @@ namespace hiptensor { - /*static*/ std::stringstream ContractionTest::sAPILogBuff = std::stringstream(); + /*static*/ bool ContractionTest::mHeaderPrinted = false; + /*static*/ std::stringstream ContractionTest::sAPILogBuff = std::stringstream(); static void logMessage(int32_t logLevel, const char* funcName /*=""*/, const char* msg /*=""*/) { @@ -78,6 +79,8 @@ namespace hiptensor mRunFlag = true; mValidationResult = false; mMaxRelativeError = 0.0; + + mElapsedTimeMs = mTotalGFlops = mMeasuredTFlopsPerSec = mTotalBytes = 0.0; } ContractionResource* ContractionTest::getResource() const @@ -85,13 +88,131 @@ namespace hiptensor return DataStorage::instance().get(); } + std::ostream& ContractionTest::printHeader(std::ostream& stream /* = std::cout */) const + { + return stream << "TypeA, TypeB, TypeC, " << "TypeD, TypeCompute, " + << "Algorithm, Operator, " << "WorkSizePreference, LogLevel, " + << "Lengths, Strides, Modes, Alpha," << "Beta, elapsedMs, " + << "Problem Size(GFlops), " << "TFlops/s, " << "TotalBytes, " << "Result" + << std::endl; + } + + std::ostream& ContractionTest::printKernel(std::ostream& stream) const + { + auto param = Base::GetParam(); + auto testType = std::get<0>(param); + auto algorithm = std::get<1>(param); + auto operatorType = std::get<2>(param); + auto workSizePref = std::get<3>(param); + auto logLevel = std::get<4>(param); + auto lengths = std::get<5>(param); + auto strides = std::get<6>(param); + auto modes = std::get<7>(param); + auto alpha = std::get<8>(param); + auto beta = std::get<9>(param); + + stream << hipTypeToString(testType[0]) << ", " << hipTypeToString(testType[1]) << ", " + << hipTypeToString(testType[2]) << ", " << hipTypeToString(testType[3]) << ", " + << computeTypeToString(convertToComputeType(testType[4])) << ", " + << algoTypeToString(algorithm) << ", " << opTypeToString(operatorType) << ", " + << workSizePrefToString(workSizePref) << ", " << logLevelToString(logLevel) << ", ["; + + for(int i = 0; i < lengths.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << "["; + for(int j = 0; j < lengths[i].size(); j++) + { + if(j != 0) + { + stream << ", "; + } + stream << lengths[i][j]; + } + stream << "]"; + } + stream << "], ["; + + if(!strides.empty()) + { + for(int i = 0; i < strides.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << "["; + for(int j = 0; j < strides[i].size(); j++) + { + if(j != 0) + { + stream << ", "; + } + stream << strides[i][j]; + } + stream << "]"; + } + } + stream << "], ["; + + if(!modes.empty()) + { + for(int i = 0; i < modes.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << "["; + for(int j = 0; j < modes[i].size(); j++) + { + if(j != 0) + { + stream << ", "; + } + stream << modes[i][j]; + } + stream << "]"; + } + } + stream << "], " << alpha << ", " << beta << ", "; + + if(!mRunFlag) + { + stream << "n/a" << ", " << "n/a" << ", " << "n/a" << ", " << "n/a" << ", " << "SKIPPED" + << std::endl; + } + else + { + + stream << mElapsedTimeMs << ", " << mTotalGFlops << ", " << mMeasuredTFlopsPerSec + << ", " << mTotalBytes << ", "; + + auto& testOptions = HiptensorOptions::instance(); + + if(testOptions->performValidation()) + { + stream << ((bool)mValidationResult ? "PASSED" : "FAILED") << std::endl; + } + else + { + stream << "BENCH" << std::endl; + } + } + + return stream; + } + void ContractionTest::SetUp() { // reset API log buffer sAPILogBuff.str(std::string()); auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto algorithm = std::get<1>(param); auto operatorType = std::get<2>(param); auto workSizePref = std::get<3>(param); @@ -102,7 +223,7 @@ namespace hiptensor auto alpha = std::get<8>(param); auto beta = std::get<9>(param); - EXPECT_EQ(testType.size(), 5); + EXPECT_EQ(dataTypes.size(), 5); //Check the format of lengths, strides and Modes(Max support is 6D across M,N,K dimensions) EXPECT_TRUE(lengths.size() == 3); // Tensors A, B, C/D @@ -123,12 +244,12 @@ namespace hiptensor } // Separate compute type from test types - auto computeType = convertToComputeType(testType[4]); + auto computeType = convertToComputeType(dataTypes[4]); - auto ADataType = testType[0]; - auto BDataType = testType[1]; - auto CDataType = testType[2]; - auto DDataType = testType[3]; + auto ADataType = dataTypes[0]; + auto BDataType = dataTypes[1]; + auto CDataType = dataTypes[2]; + auto DDataType = dataTypes[3]; EXPECT_TRUE((ADataType == HIP_R_16F) || (ADataType == HIP_R_16BF) || (ADataType == HIP_R_32F) || (ADataType == HIP_R_64F) @@ -413,20 +534,21 @@ namespace hiptensor void ContractionTest::reportResults(std::ostream& stream, hipDataType DDataType, hiptensorComputeType_t computeType, + bool omitHeader, bool omitSkipped, bool omitFailed, bool omitPassed) const { + if(!omitHeader) + { + printHeader(stream); + } + // Conditionally print outputs if((mRunFlag || !omitSkipped) && (mValidationResult || !omitFailed) && (!mValidationResult || !omitPassed)) { - if(mPrintTypes) - { - ContractionTest::sAPILogBuff - << "TypeA/B/C/D: " << hipTypeToString(DDataType) - << ", ComputeType: " << computeTypeToString(computeType) << std::endl; - } + printKernel(stream); stream << ContractionTest::sAPILogBuff.str(); @@ -620,7 +742,7 @@ namespace hiptensor void ContractionTest::RunKernel() { auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto algorithm = std::get<1>(param); auto operatorType = std::get<2>(param); auto workSizePref = std::get<3>(param); @@ -633,12 +755,12 @@ namespace hiptensor if(mRunFlag) { - auto ADataType = testType[0]; - auto BDataType = testType[1]; - auto CDataType = testType[2]; - auto DDataType = testType[3]; + auto ADataType = dataTypes[0]; + auto BDataType = dataTypes[1]; + auto CDataType = dataTypes[2]; + auto DDataType = dataTypes[3]; - auto computeType = convertToComputeType(testType[4]); + auto computeType = convertToComputeType(dataTypes[4]); /* * `alpha` and `beta` are void pointer. hiptensor uses readVal to load the value of alpha. @@ -658,6 +780,11 @@ namespace hiptensor auto resource = getResource(); + hipEvent_t startEvent, stopEvent; + CHECK_HIP_ERROR(hipEventCreate(&startEvent)); + CHECK_HIP_ERROR(hipEventCreate(&stopEvent)); + CHECK_HIP_ERROR(hipEventRecord(startEvent)); + CHECK_HIPTENSOR_ERROR(hiptensorContraction(handle, &plan, (void*)&alphaBuf, @@ -670,102 +797,153 @@ namespace hiptensor worksize, 0 /* stream */)); - CHECK_HIPTENSOR_ERROR(hiptensorContractionReference(&plan, - (void*)&alphaBuf, - resource->hostA().get(), - resource->hostB().get(), - (void*)&betaBuf, - resource->hostC().get(), - resource->hostD().get(), - a_ms_ks.mLengths, - a_ms_ks.mStrides, - desc.mTensorMode[0], - b_ns_ks.mLengths, - b_ns_ks.mStrides, - desc.mTensorMode[1], - d_ms_ns.mLengths, - d_ms_ns.mStrides, - desc.mTensorMode[2], - d_ms_ns.mLengths, - d_ms_ns.mStrides, - desc.mTensorMode[2], - ADataType, - BDataType, - CDataType, - DDataType, - workspace)); - - size_t elementsCD = std::accumulate(d_ms_ns.mLengths.begin(), - d_ms_ns.mLengths.end(), - size_t{1}, - std::multiplies()); - - int sizeD = elementsCD * hipDataTypeSize(DDataType); - auto reference = resource->allocDevice(sizeD); - resource->copyData(reference, resource->hostD(), sizeD); + CHECK_HIP_ERROR(hipEventRecord(stopEvent)); + CHECK_HIP_ERROR(hipEventSynchronize(stopEvent)) - // Compute tolerance based on compute type - auto dimension = a_ms_ks.mLengths.size() / 2; - auto nelems_k = std::accumulate(a_ms_ks.mLengths.begin() + dimension, - a_ms_ks.mLengths.end(), - size_t{1}, - std::multiplies()); + auto timeMs = 0.0f; + CHECK_HIP_ERROR(hipEventElapsedTime(&timeMs, startEvent, stopEvent)); - auto eps = getEpsilon(computeType == HIPTENSOR_COMPUTE_64F ? HIPTENSOR_COMPUTE_64F - : HIPTENSOR_COMPUTE_32F); - double tolerance = 2 * nelems_k * eps; + size_t totalLength = std::accumulate(d_ms_ns.mLengths.begin(), + d_ms_ns.mLengths.end(), + size_t(1), + std::multiplies()); - // use the same default tolerance value as CK - if(computeType == HIPTENSOR_COMPUTE_16BF || DDataType == HIP_R_16BF) - { - const double epsilon = std::pow(2, -7); - tolerance += epsilon * 2; - } - else if(computeType == HIPTENSOR_COMPUTE_16F || DDataType == HIP_R_16F) + uint32_t hops = desc.mTensorMode[2].size() / 2; + auto iter = std::find(desc.mTensorMode[0].cbegin(), + desc.mTensorMode[0].cend(), + desc.mTensorMode[2][desc.mTensorMode[2].size() - 1]); + if(iter != desc.mTensorMode[0].cend()) { - const double epsilon = std::pow(2, -10); - tolerance += epsilon * 2; + auto offset = std::distance(desc.mTensorMode[0].cbegin(), iter); + totalLength *= std::accumulate(a_ms_ks.mLengths.begin() + offset, + a_ms_ks.mLengths.begin() + offset + hops, + size_t(1), + std::multiplies()); } - if(DDataType == HIP_R_16F) - { - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel<_Float16>((_Float16*)resource->deviceD().get(), - (_Float16*)reference.get(), - elementsCD, - computeType, - tolerance); - } - else if(DDataType == HIP_R_16BF) - { - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel( - (hip_bfloat16*)resource->deviceD().get(), - (hip_bfloat16*)reference.get(), - elementsCD, - computeType, - tolerance); - } - else if(DDataType == HIP_R_32F || DDataType == HIP_C_32F) - { - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel((float*)resource->deviceD().get(), - (float*)reference.get(), - elementsCD, - computeType, - tolerance); - } - else if(DDataType == HIP_R_64F || DDataType == HIP_C_64F) + mElapsedTimeMs = float64_t(timeMs); + mTotalGFlops = 2.0 * totalLength; + mMeasuredTFlopsPerSec = mTotalGFlops / mElapsedTimeMs; + + size_t sizeA = std::accumulate(a_ms_ks.mLengths.begin(), + a_ms_ks.mLengths.end(), + hipDataTypeSize(ADataType), + std::multiplies()); + + size_t sizeB = std::accumulate(b_ns_ks.mLengths.begin(), + b_ns_ks.mLengths.end(), + hipDataTypeSize(BDataType), + std::multiplies()); + + size_t sizeD = std::accumulate(d_ms_ns.mLengths.begin(), + d_ms_ns.mLengths.end(), + hipDataTypeSize(DDataType), + std::multiplies()); + + mTotalBytes = sizeA + sizeB + sizeD; + mTotalBytes += (betaBuf.mReal != 0.0) ? sizeD : 0; + mTotalBytes /= (1e9 * mElapsedTimeMs); + + CHECK_HIP_ERROR(hipEventDestroy(startEvent)); + CHECK_HIP_ERROR(hipEventDestroy(stopEvent)); + + auto& testOptions = HiptensorOptions::instance(); + + if(testOptions->performValidation()) { - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel((double*)resource->deviceD().get(), - (double*)reference.get(), - elementsCD, - computeType, - tolerance); - } + CHECK_HIPTENSOR_ERROR(hiptensorContractionReference(&plan, + (void*)&alphaBuf, + resource->hostA().get(), + resource->hostB().get(), + (void*)&betaBuf, + resource->hostC().get(), + resource->hostD().get(), + a_ms_ks.mLengths, + a_ms_ks.mStrides, + desc.mTensorMode[0], + b_ns_ks.mLengths, + b_ns_ks.mStrides, + desc.mTensorMode[1], + d_ms_ns.mLengths, + d_ms_ns.mStrides, + desc.mTensorMode[2], + d_ms_ns.mLengths, + d_ms_ns.mStrides, + desc.mTensorMode[2], + ADataType, + BDataType, + CDataType, + DDataType, + workspace)); + + auto reference = resource->allocDevice(sizeD); + resource->copyData(reference, resource->hostD(), sizeD); + + // Compute tolerance based on compute type + auto dimension = a_ms_ks.mLengths.size() / 2; + auto nelems_k = std::accumulate(a_ms_ks.mLengths.begin() + dimension, + a_ms_ks.mLengths.end(), + size_t{1}, + std::multiplies()); + + size_t elementsCD = sizeD / hipDataTypeSize(ADataType); + + auto eps = getEpsilon(computeType == HIPTENSOR_COMPUTE_64F ? HIPTENSOR_COMPUTE_64F + : HIPTENSOR_COMPUTE_32F); + double tolerance = 2 * nelems_k * eps; + + // use the same default tolerance value as CK + if(computeType == HIPTENSOR_COMPUTE_16BF || DDataType == HIP_R_16BF) + { + const double epsilon = std::pow(2, -7); + tolerance += epsilon * 2; + } + else if(computeType == HIPTENSOR_COMPUTE_16F || DDataType == HIP_R_16F) + { + const double epsilon = std::pow(2, -10); + tolerance += epsilon * 2; + } - EXPECT_TRUE(mValidationResult) << "Max relative error: " << mMaxRelativeError; + if(DDataType == HIP_R_16F) + { + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel<_Float16>((_Float16*)resource->deviceD().get(), + (_Float16*)reference.get(), + elementsCD, + computeType, + tolerance); + } + else if(DDataType == HIP_R_16BF) + { + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel( + (hip_bfloat16*)resource->deviceD().get(), + (hip_bfloat16*)reference.get(), + elementsCD, + computeType, + tolerance); + } + else if(DDataType == HIP_R_32F || DDataType == HIP_C_32F) + { + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel((float*)resource->deviceD().get(), + (float*)reference.get(), + elementsCD, + computeType, + tolerance); + } + else if(DDataType == HIP_R_64F || DDataType == HIP_C_64F) + { + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel((double*)resource->deviceD().get(), + (double*)reference.get(), + elementsCD, + computeType, + tolerance); + } + + EXPECT_TRUE(mValidationResult) << "Max relative error: " << mMaxRelativeError; + } // if (testOptions->performValidation()) using Options = hiptensor::HiptensorOptions; auto& loggingOptions = Options::instance(); @@ -775,6 +953,7 @@ namespace hiptensor reportResults(std::cout, DDataType, computeType, + mHeaderPrinted, loggingOptions->omitSkipped(), loggingOptions->omitFailed(), loggingOptions->omitPassed()); @@ -785,10 +964,17 @@ namespace hiptensor reportResults(loggingOptions->ostream().fstream(), DDataType, computeType, + mHeaderPrinted, loggingOptions->omitSkipped(), loggingOptions->omitFailed(), loggingOptions->omitPassed()); } + + // Print the header only once + if(!mHeaderPrinted) + { + mHeaderPrinted = true; + } } } diff --git a/test/01_contraction/contraction_test.hpp b/test/01_contraction/contraction_test.hpp index f0fb93c8..d68c7f86 100644 --- a/test/01_contraction/contraction_test.hpp +++ b/test/01_contraction/contraction_test.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ #include +#include "common.hpp" #include "contraction_resource.hpp" #include "contraction_test_params.hpp" @@ -44,7 +45,7 @@ namespace hiptensor static void logMessage(int32_t logLevel, const char* funcName = "", const char* msg = ""); class ContractionTest - : public ::testing::TestWithParam -#include "llvm/hiptensor_options.hpp" +#include "hiptensor_options.hpp" #include "llvm/yaml_parser.hpp" #ifdef HIPTENSOR_TEST_YAML_INCLUDE diff --git a/test/01_contraction/contraction_test_params.hpp b/test/01_contraction/contraction_test_params.hpp index 3967b60c..5393d3d5 100644 --- a/test/01_contraction/contraction_test_params.hpp +++ b/test/01_contraction/contraction_test_params.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,6 +33,7 @@ #include #include +#include "common.hpp" #include "utils.hpp" namespace hiptensor @@ -40,7 +41,7 @@ namespace hiptensor struct ContractionTestParams { - using TestTypesT = std::vector; + using DataTypesT = std::vector; using AlgorithmT = hiptensorAlgo_t; using OperatorT = hiptensorOperator_t; @@ -54,7 +55,7 @@ namespace hiptensor using BetaT = std::vector; public: - std::vector& dataTypes() + std::vector& dataTypes() { return mDataTypes; } @@ -120,7 +121,7 @@ namespace hiptensor private: //Data types of input and output tensors - std::vector mDataTypes; + std::vector mDataTypes; std::vector mAlgorithms; std::vector mOperators; std::vector mWorkSizePrefs; diff --git a/test/02_permutation/CMakeLists.txt b/test/02_permutation/CMakeLists.txt index 270c354f..d8909a20 100644 --- a/test/02_permutation/CMakeLists.txt +++ b/test/02_permutation/CMakeLists.txt @@ -2,7 +2,7 @@ # # MIT License # - # Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + # Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,43 +23,43 @@ # THE SOFTWARE. # ############################################################################### -set(PermutationCommonSources ${HIPTENSOR_COMMON_TEST_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/permutation_resource.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/permutation_test.cpp) + set(PermutationCommonSources ${HIPTENSOR_COMMON_TEST_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/permutation_resource.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/permutation_test.cpp) # tests set (PermutationTestSources ${PermutationCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/permutation_column_major_test.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/permutation_cpu_impl_test.cpp - ) +${CMAKE_CURRENT_SOURCE_DIR}/permutation_column_major_test.cpp +${CMAKE_CURRENT_SOURCE_DIR}/permutation_cpu_impl_test.cpp +) # Rank 2 tests set (PermutationRank2TestSources ${PermutationCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank2_permutation_test.cpp) -set (PermutationRank2TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank2_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank2_permutation_test.cpp) +set (PermutationRank2TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank2_test_params.yaml) add_hiptensor_test(rank2_permutation_test ${PermutationRank2TestConfig} ${PermutationRank2TestSources}) # Rank 3 tests set (PermutationRank3TestSources ${PermutationCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank3_permutation_test.cpp) -set (PermutationRank3TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank3_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank3_permutation_test.cpp) +set (PermutationRank3TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank3_test_params.yaml) add_hiptensor_test(rank3_permutation_test ${PermutationRank3TestConfig} ${PermutationRank3TestSources}) # Rank 4 tests set (PermutationRank4TestSources ${PermutationCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank4_permutation_test.cpp) -set (PermutationRank4TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank4_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank4_permutation_test.cpp) +set (PermutationRank4TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank4_test_params.yaml) add_hiptensor_test(rank4_permutation_test ${PermutationRank4TestConfig} ${PermutationRank4TestSources}) # Rank 5 tests set (PermutationRank5TestSources ${PermutationCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank5_permutation_test.cpp) -set (PermutationRank5TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank5_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank5_permutation_test.cpp) +set (PermutationRank5TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank5_test_params.yaml) add_hiptensor_test(rank5_permutation_test ${PermutationRank5TestConfig} ${PermutationRank5TestSources}) # Rank 6 tests set (PermutationRank6TestSources ${PermutationCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank6_permutation_test.cpp) -set (PermutationRank6TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank6_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank6_permutation_test.cpp) +set (PermutationRank6TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank6_test_params.yaml) add_hiptensor_test(rank6_permutation_test ${PermutationRank6TestConfig} ${PermutationRank6TestSources}) diff --git a/test/02_permutation/configs/rank2_test_params.yaml b/test/02_permutation/configs/bench/rank2_test_params.yaml similarity index 100% rename from test/02_permutation/configs/rank2_test_params.yaml rename to test/02_permutation/configs/bench/rank2_test_params.yaml diff --git a/test/02_permutation/configs/rank3_test_params.yaml b/test/02_permutation/configs/bench/rank3_test_params.yaml similarity index 100% rename from test/02_permutation/configs/rank3_test_params.yaml rename to test/02_permutation/configs/bench/rank3_test_params.yaml diff --git a/test/02_permutation/configs/rank4_test_params.yaml b/test/02_permutation/configs/bench/rank4_test_params.yaml similarity index 100% rename from test/02_permutation/configs/rank4_test_params.yaml rename to test/02_permutation/configs/bench/rank4_test_params.yaml diff --git a/test/02_permutation/configs/rank5_test_params.yaml b/test/02_permutation/configs/bench/rank5_test_params.yaml similarity index 100% rename from test/02_permutation/configs/rank5_test_params.yaml rename to test/02_permutation/configs/bench/rank5_test_params.yaml diff --git a/test/02_permutation/configs/rank6_test_params.yaml b/test/02_permutation/configs/bench/rank6_test_params.yaml similarity index 100% rename from test/02_permutation/configs/rank6_test_params.yaml rename to test/02_permutation/configs/bench/rank6_test_params.yaml diff --git a/test/02_permutation/configs/extended/rank2_test_params.yaml b/test/02_permutation/configs/extended/rank2_test_params.yaml new file mode 100644 index 00000000..33461d71 --- /dev/null +++ b/test/02_permutation/configs/extended/rank2_test_params.yaml @@ -0,0 +1,25 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1] + - [ 5, 2] + - [ 3, 4] + - [ 15, 12] + - [ 23, 11] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1] + - [1, 0] +... diff --git a/test/02_permutation/configs/extended/rank3_test_params.yaml b/test/02_permutation/configs/extended/rank3_test_params.yaml new file mode 100644 index 00000000..366782c9 --- /dev/null +++ b/test/02_permutation/configs/extended/rank3_test_params.yaml @@ -0,0 +1,29 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1] + - [ 5, 2, 3] + - [ 5, 2, 4] + - [ 15, 12, 23] + - [ 12, 23, 11] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2] + - [0, 2, 1] + - [1, 0, 2] + - [1, 2, 0] + - [2, 1, 0] + - [2, 0, 1] +... diff --git a/test/02_permutation/configs/extended/rank4_test_params.yaml b/test/02_permutation/configs/extended/rank4_test_params.yaml new file mode 100644 index 00000000..e1caffea --- /dev/null +++ b/test/02_permutation/configs/extended/rank4_test_params.yaml @@ -0,0 +1,46 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1, 1] + - [ 5, 2, 3, 4] + - [ 5, 2, 1, 1] + - [ 15, 12, 23, 11] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2, 3] + - [0, 1, 3, 2] + - [0, 2, 1, 3] + - [0, 2, 3, 1] + - [0, 3, 2, 1] + - [0, 3, 1, 2] + - [1, 0, 2, 3] + - [1, 0, 3, 2] + - [1, 2, 0, 3] + - [1, 2, 3, 0] + - [1, 3, 2, 0] + - [1, 3, 0, 2] + - [2, 1, 0, 3] + - [2, 1, 3, 0] + - [2, 0, 1, 3] + - [2, 0, 3, 1] + - [2, 3, 0, 1] + - [2, 3, 1, 0] + - [3, 1, 2, 0] + - [3, 1, 0, 2] + - [3, 2, 1, 0] + - [3, 2, 0, 1] + - [3, 0, 2, 1] + - [3, 0, 1, 2] +... diff --git a/test/02_permutation/configs/extended/rank5_test_params.yaml b/test/02_permutation/configs/extended/rank5_test_params.yaml new file mode 100644 index 00000000..410da229 --- /dev/null +++ b/test/02_permutation/configs/extended/rank5_test_params.yaml @@ -0,0 +1,142 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1, 1, 1] + - [ 5, 2, 3, 4, 5] + - [ 5, 2, 1, 1, 2] + - [ 15, 12, 23, 11, 2] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2, 3, 4] + - [0, 1, 2, 4, 3] + - [0, 1, 3, 2, 4] + - [0, 1, 3, 4, 2] + - [0, 1, 4, 3, 2] + - [0, 1, 4, 2, 3] + - [0, 2, 1, 3, 4] + - [0, 2, 1, 4, 3] + - [0, 2, 3, 1, 4] + - [0, 2, 3, 4, 1] + - [0, 2, 4, 3, 1] + - [0, 2, 4, 1, 3] + - [0, 3, 2, 1, 4] + - [0, 3, 2, 4, 1] + - [0, 3, 1, 2, 4] + - [0, 3, 1, 4, 2] + - [0, 3, 4, 1, 2] + - [0, 3, 4, 2, 1] + - [0, 4, 2, 3, 1] + - [0, 4, 2, 1, 3] + - [0, 4, 3, 2, 1] + - [0, 4, 3, 1, 2] + - [0, 4, 1, 3, 2] + - [0, 4, 1, 2, 3] + - [1, 0, 2, 3, 4] + - [1, 0, 2, 4, 3] + - [1, 0, 3, 2, 4] + - [1, 0, 3, 4, 2] + - [1, 0, 4, 3, 2] + - [1, 0, 4, 2, 3] + - [1, 2, 0, 3, 4] + - [1, 2, 0, 4, 3] + - [1, 2, 3, 0, 4] + - [1, 2, 3, 4, 0] + - [1, 2, 4, 3, 0] + - [1, 2, 4, 0, 3] + - [1, 3, 2, 0, 4] + - [1, 3, 2, 4, 0] + - [1, 3, 0, 2, 4] + - [1, 3, 0, 4, 2] + - [1, 3, 4, 0, 2] + - [1, 3, 4, 2, 0] + - [1, 4, 2, 3, 0] + - [1, 4, 2, 0, 3] + - [1, 4, 3, 2, 0] + - [1, 4, 3, 0, 2] + - [1, 4, 0, 3, 2] + - [1, 4, 0, 2, 3] + - [2, 1, 0, 3, 4] + - [2, 1, 0, 4, 3] + - [2, 1, 3, 0, 4] + - [2, 1, 3, 4, 0] + - [2, 1, 4, 3, 0] + - [2, 1, 4, 0, 3] + - [2, 0, 1, 3, 4] + - [2, 0, 1, 4, 3] + - [2, 0, 3, 1, 4] + - [2, 0, 3, 4, 1] + - [2, 0, 4, 3, 1] + - [2, 0, 4, 1, 3] + - [2, 3, 0, 1, 4] + - [2, 3, 0, 4, 1] + - [2, 3, 1, 0, 4] + - [2, 3, 1, 4, 0] + - [2, 3, 4, 1, 0] + - [2, 3, 4, 0, 1] + - [2, 4, 0, 3, 1] + - [2, 4, 0, 1, 3] + - [2, 4, 3, 0, 1] + - [2, 4, 3, 1, 0] + - [2, 4, 1, 3, 0] + - [2, 4, 1, 0, 3] + - [3, 1, 2, 0, 4] + - [3, 1, 2, 4, 0] + - [3, 1, 0, 2, 4] + - [3, 1, 0, 4, 2] + - [3, 1, 4, 0, 2] + - [3, 1, 4, 2, 0] + - [3, 2, 1, 0, 4] + - [3, 2, 1, 4, 0] + - [3, 2, 0, 1, 4] + - [3, 2, 0, 4, 1] + - [3, 2, 4, 0, 1] + - [3, 2, 4, 1, 0] + - [3, 0, 2, 1, 4] + - [3, 0, 2, 4, 1] + - [3, 0, 1, 2, 4] + - [3, 0, 1, 4, 2] + - [3, 0, 4, 1, 2] + - [3, 0, 4, 2, 1] + - [3, 4, 2, 0, 1] + - [3, 4, 2, 1, 0] + - [3, 4, 0, 2, 1] + - [3, 4, 0, 1, 2] + - [3, 4, 1, 0, 2] + - [3, 4, 1, 2, 0] + - [4, 1, 2, 3, 0] + - [4, 1, 2, 0, 3] + - [4, 1, 3, 2, 0] + - [4, 1, 3, 0, 2] + - [4, 1, 0, 3, 2] + - [4, 1, 0, 2, 3] + - [4, 2, 1, 3, 0] + - [4, 2, 1, 0, 3] + - [4, 2, 3, 1, 0] + - [4, 2, 3, 0, 1] + - [4, 2, 0, 3, 1] + - [4, 2, 0, 1, 3] + - [4, 3, 2, 1, 0] + - [4, 3, 2, 0, 1] + - [4, 3, 1, 2, 0] + - [4, 3, 1, 0, 2] + - [4, 3, 0, 1, 2] + - [4, 3, 0, 2, 1] + - [4, 0, 2, 3, 1] + - [4, 0, 2, 1, 3] + - [4, 0, 3, 2, 1] + - [4, 0, 3, 1, 2] + - [4, 0, 1, 3, 2] + - [4, 0, 1, 2, 3] +... diff --git a/test/02_permutation/configs/extended/rank6_test_params.yaml b/test/02_permutation/configs/extended/rank6_test_params.yaml new file mode 100644 index 00000000..87a26ee7 --- /dev/null +++ b/test/02_permutation/configs/extended/rank6_test_params.yaml @@ -0,0 +1,742 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1, 1, 1, 1] + - [ 5, 2, 3, 4, 1, 2] + - [ 5, 2, 1, 1, 1, 2] + - [ 15, 12, 23, 11, 1, 2] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2, 3, 4, 5] + - [0, 1, 2, 3, 5, 4] + - [0, 1, 2, 4, 3, 5] + - [0, 1, 2, 4, 5, 3] + - [0, 1, 2, 5, 4, 3] + - [0, 1, 2, 5, 3, 4] + - [0, 1, 3, 2, 4, 5] + - [0, 1, 3, 2, 5, 4] + - [0, 1, 3, 4, 2, 5] + - [0, 1, 3, 4, 5, 2] + - [0, 1, 3, 5, 4, 2] + - [0, 1, 3, 5, 2, 4] + - [0, 1, 4, 3, 2, 5] + - [0, 1, 4, 3, 5, 2] + - [0, 1, 4, 2, 3, 5] + - [0, 1, 4, 2, 5, 3] + - [0, 1, 4, 5, 2, 3] + - [0, 1, 4, 5, 3, 2] + - [0, 1, 5, 3, 4, 2] + - [0, 1, 5, 3, 2, 4] + - [0, 1, 5, 4, 3, 2] + - [0, 1, 5, 4, 2, 3] + - [0, 1, 5, 2, 4, 3] + - [0, 1, 5, 2, 3, 4] + - [0, 2, 1, 3, 4, 5] + - [0, 2, 1, 3, 5, 4] + - [0, 2, 1, 4, 3, 5] + - [0, 2, 1, 4, 5, 3] + - [0, 2, 1, 5, 4, 3] + - [0, 2, 1, 5, 3, 4] + - [0, 2, 3, 1, 4, 5] + - [0, 2, 3, 1, 5, 4] + - [0, 2, 3, 4, 1, 5] + - [0, 2, 3, 4, 5, 1] + - [0, 2, 3, 5, 4, 1] + - [0, 2, 3, 5, 1, 4] + - [0, 2, 4, 3, 1, 5] + - [0, 2, 4, 3, 5, 1] + - [0, 2, 4, 1, 3, 5] + - [0, 2, 4, 1, 5, 3] + - [0, 2, 4, 5, 1, 3] + - [0, 2, 4, 5, 3, 1] + - [0, 2, 5, 3, 4, 1] + - [0, 2, 5, 3, 1, 4] + - [0, 2, 5, 4, 3, 1] + - [0, 2, 5, 4, 1, 3] + - [0, 2, 5, 1, 4, 3] + - [0, 2, 5, 1, 3, 4] + - [0, 3, 2, 1, 4, 5] + - [0, 3, 2, 1, 5, 4] + - [0, 3, 2, 4, 1, 5] + - [0, 3, 2, 4, 5, 1] + - [0, 3, 2, 5, 4, 1] + - [0, 3, 2, 5, 1, 4] + - [0, 3, 1, 2, 4, 5] + - [0, 3, 1, 2, 5, 4] + - [0, 3, 1, 4, 2, 5] + - [0, 3, 1, 4, 5, 2] + - [0, 3, 1, 5, 4, 2] + - [0, 3, 1, 5, 2, 4] + - [0, 3, 4, 1, 2, 5] + - [0, 3, 4, 1, 5, 2] + - [0, 3, 4, 2, 1, 5] + - [0, 3, 4, 2, 5, 1] + - [0, 3, 4, 5, 2, 1] + - [0, 3, 4, 5, 1, 2] + - [0, 3, 5, 1, 4, 2] + - [0, 3, 5, 1, 2, 4] + - [0, 3, 5, 4, 1, 2] + - [0, 3, 5, 4, 2, 1] + - [0, 3, 5, 2, 4, 1] + - [0, 3, 5, 2, 1, 4] + - [0, 4, 2, 3, 1, 5] + - [0, 4, 2, 3, 5, 1] + - [0, 4, 2, 1, 3, 5] + - [0, 4, 2, 1, 5, 3] + - [0, 4, 2, 5, 1, 3] + - [0, 4, 2, 5, 3, 1] + - [0, 4, 3, 2, 1, 5] + - [0, 4, 3, 2, 5, 1] + - [0, 4, 3, 1, 2, 5] + - [0, 4, 3, 1, 5, 2] + - [0, 4, 3, 5, 1, 2] + - [0, 4, 3, 5, 2, 1] + - [0, 4, 1, 3, 2, 5] + - [0, 4, 1, 3, 5, 2] + - [0, 4, 1, 2, 3, 5] + - [0, 4, 1, 2, 5, 3] + - [0, 4, 1, 5, 2, 3] + - [0, 4, 1, 5, 3, 2] + - [0, 4, 5, 3, 1, 2] + - [0, 4, 5, 3, 2, 1] + - [0, 4, 5, 1, 3, 2] + - [0, 4, 5, 1, 2, 3] + - [0, 4, 5, 2, 1, 3] + - [0, 4, 5, 2, 3, 1] + - [0, 5, 2, 3, 4, 1] + - [0, 5, 2, 3, 1, 4] + - [0, 5, 2, 4, 3, 1] + - [0, 5, 2, 4, 1, 3] + - [0, 5, 2, 1, 4, 3] + - [0, 5, 2, 1, 3, 4] + - [0, 5, 3, 2, 4, 1] + - [0, 5, 3, 2, 1, 4] + - [0, 5, 3, 4, 2, 1] + - [0, 5, 3, 4, 1, 2] + - [0, 5, 3, 1, 4, 2] + - [0, 5, 3, 1, 2, 4] + - [0, 5, 4, 3, 2, 1] + - [0, 5, 4, 3, 1, 2] + - [0, 5, 4, 2, 3, 1] + - [0, 5, 4, 2, 1, 3] + - [0, 5, 4, 1, 2, 3] + - [0, 5, 4, 1, 3, 2] + - [0, 5, 1, 3, 4, 2] + - [0, 5, 1, 3, 2, 4] + - [0, 5, 1, 4, 3, 2] + - [0, 5, 1, 4, 2, 3] + - [0, 5, 1, 2, 4, 3] + - [0, 5, 1, 2, 3, 4] + - [1, 0, 2, 3, 4, 5] + - [1, 0, 2, 3, 5, 4] + - [1, 0, 2, 4, 3, 5] + - [1, 0, 2, 4, 5, 3] + - [1, 0, 2, 5, 4, 3] + - [1, 0, 2, 5, 3, 4] + - [1, 0, 3, 2, 4, 5] + - [1, 0, 3, 2, 5, 4] + - [1, 0, 3, 4, 2, 5] + - [1, 0, 3, 4, 5, 2] + - [1, 0, 3, 5, 4, 2] + - [1, 0, 3, 5, 2, 4] + - [1, 0, 4, 3, 2, 5] + - [1, 0, 4, 3, 5, 2] + - [1, 0, 4, 2, 3, 5] + - [1, 0, 4, 2, 5, 3] + - [1, 0, 4, 5, 2, 3] + - [1, 0, 4, 5, 3, 2] + - [1, 0, 5, 3, 4, 2] + - [1, 0, 5, 3, 2, 4] + - [1, 0, 5, 4, 3, 2] + - [1, 0, 5, 4, 2, 3] + - [1, 0, 5, 2, 4, 3] + - [1, 0, 5, 2, 3, 4] + - [1, 2, 0, 3, 4, 5] + - [1, 2, 0, 3, 5, 4] + - [1, 2, 0, 4, 3, 5] + - [1, 2, 0, 4, 5, 3] + - [1, 2, 0, 5, 4, 3] + - [1, 2, 0, 5, 3, 4] + - [1, 2, 3, 0, 4, 5] + - [1, 2, 3, 0, 5, 4] + - [1, 2, 3, 4, 0, 5] + - [1, 2, 3, 4, 5, 0] + - [1, 2, 3, 5, 4, 0] + - [1, 2, 3, 5, 0, 4] + - [1, 2, 4, 3, 0, 5] + - [1, 2, 4, 3, 5, 0] + - [1, 2, 4, 0, 3, 5] + - [1, 2, 4, 0, 5, 3] + - [1, 2, 4, 5, 0, 3] + - [1, 2, 4, 5, 3, 0] + - [1, 2, 5, 3, 4, 0] + - [1, 2, 5, 3, 0, 4] + - [1, 2, 5, 4, 3, 0] + - [1, 2, 5, 4, 0, 3] + - [1, 2, 5, 0, 4, 3] + - [1, 2, 5, 0, 3, 4] + - [1, 3, 2, 0, 4, 5] + - [1, 3, 2, 0, 5, 4] + - [1, 3, 2, 4, 0, 5] + - [1, 3, 2, 4, 5, 0] + - [1, 3, 2, 5, 4, 0] + - [1, 3, 2, 5, 0, 4] + - [1, 3, 0, 2, 4, 5] + - [1, 3, 0, 2, 5, 4] + - [1, 3, 0, 4, 2, 5] + - [1, 3, 0, 4, 5, 2] + - [1, 3, 0, 5, 4, 2] + - [1, 3, 0, 5, 2, 4] + - [1, 3, 4, 0, 2, 5] + - [1, 3, 4, 0, 5, 2] + - [1, 3, 4, 2, 0, 5] + - [1, 3, 4, 2, 5, 0] + - [1, 3, 4, 5, 2, 0] + - [1, 3, 4, 5, 0, 2] + - [1, 3, 5, 0, 4, 2] + - [1, 3, 5, 0, 2, 4] + - [1, 3, 5, 4, 0, 2] + - [1, 3, 5, 4, 2, 0] + - [1, 3, 5, 2, 4, 0] + - [1, 3, 5, 2, 0, 4] + - [1, 4, 2, 3, 0, 5] + - [1, 4, 2, 3, 5, 0] + - [1, 4, 2, 0, 3, 5] + - [1, 4, 2, 0, 5, 3] + - [1, 4, 2, 5, 0, 3] + - [1, 4, 2, 5, 3, 0] + - [1, 4, 3, 2, 0, 5] + - [1, 4, 3, 2, 5, 0] + - [1, 4, 3, 0, 2, 5] + - [1, 4, 3, 0, 5, 2] + - [1, 4, 3, 5, 0, 2] + - [1, 4, 3, 5, 2, 0] + - [1, 4, 0, 3, 2, 5] + - [1, 4, 0, 3, 5, 2] + - [1, 4, 0, 2, 3, 5] + - [1, 4, 0, 2, 5, 3] + - [1, 4, 0, 5, 2, 3] + - [1, 4, 0, 5, 3, 2] + - [1, 4, 5, 3, 0, 2] + - [1, 4, 5, 3, 2, 0] + - [1, 4, 5, 0, 3, 2] + - [1, 4, 5, 0, 2, 3] + - [1, 4, 5, 2, 0, 3] + - [1, 4, 5, 2, 3, 0] + - [1, 5, 2, 3, 4, 0] + - [1, 5, 2, 3, 0, 4] + - [1, 5, 2, 4, 3, 0] + - [1, 5, 2, 4, 0, 3] + - [1, 5, 2, 0, 4, 3] + - [1, 5, 2, 0, 3, 4] + - [1, 5, 3, 2, 4, 0] + - [1, 5, 3, 2, 0, 4] + - [1, 5, 3, 4, 2, 0] + - [1, 5, 3, 4, 0, 2] + - [1, 5, 3, 0, 4, 2] + - [1, 5, 3, 0, 2, 4] + - [1, 5, 4, 3, 2, 0] + - [1, 5, 4, 3, 0, 2] + - [1, 5, 4, 2, 3, 0] + - [1, 5, 4, 2, 0, 3] + - [1, 5, 4, 0, 2, 3] + - [1, 5, 4, 0, 3, 2] + - [1, 5, 0, 3, 4, 2] + - [1, 5, 0, 3, 2, 4] + - [1, 5, 0, 4, 3, 2] + - [1, 5, 0, 4, 2, 3] + - [1, 5, 0, 2, 4, 3] + - [1, 5, 0, 2, 3, 4] + - [2, 1, 0, 3, 4, 5] + - [2, 1, 0, 3, 5, 4] + - [2, 1, 0, 4, 3, 5] + - [2, 1, 0, 4, 5, 3] + - [2, 1, 0, 5, 4, 3] + - [2, 1, 0, 5, 3, 4] + - [2, 1, 3, 0, 4, 5] + - [2, 1, 3, 0, 5, 4] + - [2, 1, 3, 4, 0, 5] + - [2, 1, 3, 4, 5, 0] + - [2, 1, 3, 5, 4, 0] + - [2, 1, 3, 5, 0, 4] + - [2, 1, 4, 3, 0, 5] + - [2, 1, 4, 3, 5, 0] + - [2, 1, 4, 0, 3, 5] + - [2, 1, 4, 0, 5, 3] + - [2, 1, 4, 5, 0, 3] + - [2, 1, 4, 5, 3, 0] + - [2, 1, 5, 3, 4, 0] + - [2, 1, 5, 3, 0, 4] + - [2, 1, 5, 4, 3, 0] + - [2, 1, 5, 4, 0, 3] + - [2, 1, 5, 0, 4, 3] + - [2, 1, 5, 0, 3, 4] + - [2, 0, 1, 3, 4, 5] + - [2, 0, 1, 3, 5, 4] + - [2, 0, 1, 4, 3, 5] + - [2, 0, 1, 4, 5, 3] + - [2, 0, 1, 5, 4, 3] + - [2, 0, 1, 5, 3, 4] + - [2, 0, 3, 1, 4, 5] + - [2, 0, 3, 1, 5, 4] + - [2, 0, 3, 4, 1, 5] + - [2, 0, 3, 4, 5, 1] + - [2, 0, 3, 5, 4, 1] + - [2, 0, 3, 5, 1, 4] + - [2, 0, 4, 3, 1, 5] + - [2, 0, 4, 3, 5, 1] + - [2, 0, 4, 1, 3, 5] + - [2, 0, 4, 1, 5, 3] + - [2, 0, 4, 5, 1, 3] + - [2, 0, 4, 5, 3, 1] + - [2, 0, 5, 3, 4, 1] + - [2, 0, 5, 3, 1, 4] + - [2, 0, 5, 4, 3, 1] + - [2, 0, 5, 4, 1, 3] + - [2, 0, 5, 1, 4, 3] + - [2, 0, 5, 1, 3, 4] + - [2, 3, 0, 1, 4, 5] + - [2, 3, 0, 1, 5, 4] + - [2, 3, 0, 4, 1, 5] + - [2, 3, 0, 4, 5, 1] + - [2, 3, 0, 5, 4, 1] + - [2, 3, 0, 5, 1, 4] + - [2, 3, 1, 0, 4, 5] + - [2, 3, 1, 0, 5, 4] + - [2, 3, 1, 4, 0, 5] + - [2, 3, 1, 4, 5, 0] + - [2, 3, 1, 5, 4, 0] + - [2, 3, 1, 5, 0, 4] + - [2, 3, 4, 1, 0, 5] + - [2, 3, 4, 1, 5, 0] + - [2, 3, 4, 0, 1, 5] + - [2, 3, 4, 0, 5, 1] + - [2, 3, 4, 5, 0, 1] + - [2, 3, 4, 5, 1, 0] + - [2, 3, 5, 1, 4, 0] + - [2, 3, 5, 1, 0, 4] + - [2, 3, 5, 4, 1, 0] + - [2, 3, 5, 4, 0, 1] + - [2, 3, 5, 0, 4, 1] + - [2, 3, 5, 0, 1, 4] + - [2, 4, 0, 3, 1, 5] + - [2, 4, 0, 3, 5, 1] + - [2, 4, 0, 1, 3, 5] + - [2, 4, 0, 1, 5, 3] + - [2, 4, 0, 5, 1, 3] + - [2, 4, 0, 5, 3, 1] + - [2, 4, 3, 0, 1, 5] + - [2, 4, 3, 0, 5, 1] + - [2, 4, 3, 1, 0, 5] + - [2, 4, 3, 1, 5, 0] + - [2, 4, 3, 5, 1, 0] + - [2, 4, 3, 5, 0, 1] + - [2, 4, 1, 3, 0, 5] + - [2, 4, 1, 3, 5, 0] + - [2, 4, 1, 0, 3, 5] + - [2, 4, 1, 0, 5, 3] + - [2, 4, 1, 5, 0, 3] + - [2, 4, 1, 5, 3, 0] + - [2, 4, 5, 3, 1, 0] + - [2, 4, 5, 3, 0, 1] + - [2, 4, 5, 1, 3, 0] + - [2, 4, 5, 1, 0, 3] + - [2, 4, 5, 0, 1, 3] + - [2, 4, 5, 0, 3, 1] + - [2, 5, 0, 3, 4, 1] + - [2, 5, 0, 3, 1, 4] + - [2, 5, 0, 4, 3, 1] + - [2, 5, 0, 4, 1, 3] + - [2, 5, 0, 1, 4, 3] + - [2, 5, 0, 1, 3, 4] + - [2, 5, 3, 0, 4, 1] + - [2, 5, 3, 0, 1, 4] + - [2, 5, 3, 4, 0, 1] + - [2, 5, 3, 4, 1, 0] + - [2, 5, 3, 1, 4, 0] + - [2, 5, 3, 1, 0, 4] + - [2, 5, 4, 3, 0, 1] + - [2, 5, 4, 3, 1, 0] + - [2, 5, 4, 0, 3, 1] + - [2, 5, 4, 0, 1, 3] + - [2, 5, 4, 1, 0, 3] + - [2, 5, 4, 1, 3, 0] + - [2, 5, 1, 3, 4, 0] + - [2, 5, 1, 3, 0, 4] + - [2, 5, 1, 4, 3, 0] + - [2, 5, 1, 4, 0, 3] + - [2, 5, 1, 0, 4, 3] + - [2, 5, 1, 0, 3, 4] + - [3, 1, 2, 0, 4, 5] + - [3, 1, 2, 0, 5, 4] + - [3, 1, 2, 4, 0, 5] + - [3, 1, 2, 4, 5, 0] + - [3, 1, 2, 5, 4, 0] + - [3, 1, 2, 5, 0, 4] + - [3, 1, 0, 2, 4, 5] + - [3, 1, 0, 2, 5, 4] + - [3, 1, 0, 4, 2, 5] + - [3, 1, 0, 4, 5, 2] + - [3, 1, 0, 5, 4, 2] + - [3, 1, 0, 5, 2, 4] + - [3, 1, 4, 0, 2, 5] + - [3, 1, 4, 0, 5, 2] + - [3, 1, 4, 2, 0, 5] + - [3, 1, 4, 2, 5, 0] + - [3, 1, 4, 5, 2, 0] + - [3, 1, 4, 5, 0, 2] + - [3, 1, 5, 0, 4, 2] + - [3, 1, 5, 0, 2, 4] + - [3, 1, 5, 4, 0, 2] + - [3, 1, 5, 4, 2, 0] + - [3, 1, 5, 2, 4, 0] + - [3, 1, 5, 2, 0, 4] + - [3, 2, 1, 0, 4, 5] + - [3, 2, 1, 0, 5, 4] + - [3, 2, 1, 4, 0, 5] + - [3, 2, 1, 4, 5, 0] + - [3, 2, 1, 5, 4, 0] + - [3, 2, 1, 5, 0, 4] + - [3, 2, 0, 1, 4, 5] + - [3, 2, 0, 1, 5, 4] + - [3, 2, 0, 4, 1, 5] + - [3, 2, 0, 4, 5, 1] + - [3, 2, 0, 5, 4, 1] + - [3, 2, 0, 5, 1, 4] + - [3, 2, 4, 0, 1, 5] + - [3, 2, 4, 0, 5, 1] + - [3, 2, 4, 1, 0, 5] + - [3, 2, 4, 1, 5, 0] + - [3, 2, 4, 5, 1, 0] + - [3, 2, 4, 5, 0, 1] + - [3, 2, 5, 0, 4, 1] + - [3, 2, 5, 0, 1, 4] + - [3, 2, 5, 4, 0, 1] + - [3, 2, 5, 4, 1, 0] + - [3, 2, 5, 1, 4, 0] + - [3, 2, 5, 1, 0, 4] + - [3, 0, 2, 1, 4, 5] + - [3, 0, 2, 1, 5, 4] + - [3, 0, 2, 4, 1, 5] + - [3, 0, 2, 4, 5, 1] + - [3, 0, 2, 5, 4, 1] + - [3, 0, 2, 5, 1, 4] + - [3, 0, 1, 2, 4, 5] + - [3, 0, 1, 2, 5, 4] + - [3, 0, 1, 4, 2, 5] + - [3, 0, 1, 4, 5, 2] + - [3, 0, 1, 5, 4, 2] + - [3, 0, 1, 5, 2, 4] + - [3, 0, 4, 1, 2, 5] + - [3, 0, 4, 1, 5, 2] + - [3, 0, 4, 2, 1, 5] + - [3, 0, 4, 2, 5, 1] + - [3, 0, 4, 5, 2, 1] + - [3, 0, 4, 5, 1, 2] + - [3, 0, 5, 1, 4, 2] + - [3, 0, 5, 1, 2, 4] + - [3, 0, 5, 4, 1, 2] + - [3, 0, 5, 4, 2, 1] + - [3, 0, 5, 2, 4, 1] + - [3, 0, 5, 2, 1, 4] + - [3, 4, 2, 0, 1, 5] + - [3, 4, 2, 0, 5, 1] + - [3, 4, 2, 1, 0, 5] + - [3, 4, 2, 1, 5, 0] + - [3, 4, 2, 5, 1, 0] + - [3, 4, 2, 5, 0, 1] + - [3, 4, 0, 2, 1, 5] + - [3, 4, 0, 2, 5, 1] + - [3, 4, 0, 1, 2, 5] + - [3, 4, 0, 1, 5, 2] + - [3, 4, 0, 5, 1, 2] + - [3, 4, 0, 5, 2, 1] + - [3, 4, 1, 0, 2, 5] + - [3, 4, 1, 0, 5, 2] + - [3, 4, 1, 2, 0, 5] + - [3, 4, 1, 2, 5, 0] + - [3, 4, 1, 5, 2, 0] + - [3, 4, 1, 5, 0, 2] + - [3, 4, 5, 0, 1, 2] + - [3, 4, 5, 0, 2, 1] + - [3, 4, 5, 1, 0, 2] + - [3, 4, 5, 1, 2, 0] + - [3, 4, 5, 2, 1, 0] + - [3, 4, 5, 2, 0, 1] + - [3, 5, 2, 0, 4, 1] + - [3, 5, 2, 0, 1, 4] + - [3, 5, 2, 4, 0, 1] + - [3, 5, 2, 4, 1, 0] + - [3, 5, 2, 1, 4, 0] + - [3, 5, 2, 1, 0, 4] + - [3, 5, 0, 2, 4, 1] + - [3, 5, 0, 2, 1, 4] + - [3, 5, 0, 4, 2, 1] + - [3, 5, 0, 4, 1, 2] + - [3, 5, 0, 1, 4, 2] + - [3, 5, 0, 1, 2, 4] + - [3, 5, 4, 0, 2, 1] + - [3, 5, 4, 0, 1, 2] + - [3, 5, 4, 2, 0, 1] + - [3, 5, 4, 2, 1, 0] + - [3, 5, 4, 1, 2, 0] + - [3, 5, 4, 1, 0, 2] + - [3, 5, 1, 0, 4, 2] + - [3, 5, 1, 0, 2, 4] + - [3, 5, 1, 4, 0, 2] + - [3, 5, 1, 4, 2, 0] + - [3, 5, 1, 2, 4, 0] + - [3, 5, 1, 2, 0, 4] + - [4, 1, 2, 3, 0, 5] + - [4, 1, 2, 3, 5, 0] + - [4, 1, 2, 0, 3, 5] + - [4, 1, 2, 0, 5, 3] + - [4, 1, 2, 5, 0, 3] + - [4, 1, 2, 5, 3, 0] + - [4, 1, 3, 2, 0, 5] + - [4, 1, 3, 2, 5, 0] + - [4, 1, 3, 0, 2, 5] + - [4, 1, 3, 0, 5, 2] + - [4, 1, 3, 5, 0, 2] + - [4, 1, 3, 5, 2, 0] + - [4, 1, 0, 3, 2, 5] + - [4, 1, 0, 3, 5, 2] + - [4, 1, 0, 2, 3, 5] + - [4, 1, 0, 2, 5, 3] + - [4, 1, 0, 5, 2, 3] + - [4, 1, 0, 5, 3, 2] + - [4, 1, 5, 3, 0, 2] + - [4, 1, 5, 3, 2, 0] + - [4, 1, 5, 0, 3, 2] + - [4, 1, 5, 0, 2, 3] + - [4, 1, 5, 2, 0, 3] + - [4, 1, 5, 2, 3, 0] + - [4, 2, 1, 3, 0, 5] + - [4, 2, 1, 3, 5, 0] + - [4, 2, 1, 0, 3, 5] + - [4, 2, 1, 0, 5, 3] + - [4, 2, 1, 5, 0, 3] + - [4, 2, 1, 5, 3, 0] + - [4, 2, 3, 1, 0, 5] + - [4, 2, 3, 1, 5, 0] + - [4, 2, 3, 0, 1, 5] + - [4, 2, 3, 0, 5, 1] + - [4, 2, 3, 5, 0, 1] + - [4, 2, 3, 5, 1, 0] + - [4, 2, 0, 3, 1, 5] + - [4, 2, 0, 3, 5, 1] + - [4, 2, 0, 1, 3, 5] + - [4, 2, 0, 1, 5, 3] + - [4, 2, 0, 5, 1, 3] + - [4, 2, 0, 5, 3, 1] + - [4, 2, 5, 3, 0, 1] + - [4, 2, 5, 3, 1, 0] + - [4, 2, 5, 0, 3, 1] + - [4, 2, 5, 0, 1, 3] + - [4, 2, 5, 1, 0, 3] + - [4, 2, 5, 1, 3, 0] + - [4, 3, 2, 1, 0, 5] + - [4, 3, 2, 1, 5, 0] + - [4, 3, 2, 0, 1, 5] + - [4, 3, 2, 0, 5, 1] + - [4, 3, 2, 5, 0, 1] + - [4, 3, 2, 5, 1, 0] + - [4, 3, 1, 2, 0, 5] + - [4, 3, 1, 2, 5, 0] + - [4, 3, 1, 0, 2, 5] + - [4, 3, 1, 0, 5, 2] + - [4, 3, 1, 5, 0, 2] + - [4, 3, 1, 5, 2, 0] + - [4, 3, 0, 1, 2, 5] + - [4, 3, 0, 1, 5, 2] + - [4, 3, 0, 2, 1, 5] + - [4, 3, 0, 2, 5, 1] + - [4, 3, 0, 5, 2, 1] + - [4, 3, 0, 5, 1, 2] + - [4, 3, 5, 1, 0, 2] + - [4, 3, 5, 1, 2, 0] + - [4, 3, 5, 0, 1, 2] + - [4, 3, 5, 0, 2, 1] + - [4, 3, 5, 2, 0, 1] + - [4, 3, 5, 2, 1, 0] + - [4, 0, 2, 3, 1, 5] + - [4, 0, 2, 3, 5, 1] + - [4, 0, 2, 1, 3, 5] + - [4, 0, 2, 1, 5, 3] + - [4, 0, 2, 5, 1, 3] + - [4, 0, 2, 5, 3, 1] + - [4, 0, 3, 2, 1, 5] + - [4, 0, 3, 2, 5, 1] + - [4, 0, 3, 1, 2, 5] + - [4, 0, 3, 1, 5, 2] + - [4, 0, 3, 5, 1, 2] + - [4, 0, 3, 5, 2, 1] + - [4, 0, 1, 3, 2, 5] + - [4, 0, 1, 3, 5, 2] + - [4, 0, 1, 2, 3, 5] + - [4, 0, 1, 2, 5, 3] + - [4, 0, 1, 5, 2, 3] + - [4, 0, 1, 5, 3, 2] + - [4, 0, 5, 3, 1, 2] + - [4, 0, 5, 3, 2, 1] + - [4, 0, 5, 1, 3, 2] + - [4, 0, 5, 1, 2, 3] + - [4, 0, 5, 2, 1, 3] + - [4, 0, 5, 2, 3, 1] + - [4, 5, 2, 3, 0, 1] + - [4, 5, 2, 3, 1, 0] + - [4, 5, 2, 0, 3, 1] + - [4, 5, 2, 0, 1, 3] + - [4, 5, 2, 1, 0, 3] + - [4, 5, 2, 1, 3, 0] + - [4, 5, 3, 2, 0, 1] + - [4, 5, 3, 2, 1, 0] + - [4, 5, 3, 0, 2, 1] + - [4, 5, 3, 0, 1, 2] + - [4, 5, 3, 1, 0, 2] + - [4, 5, 3, 1, 2, 0] + - [4, 5, 0, 3, 2, 1] + - [4, 5, 0, 3, 1, 2] + - [4, 5, 0, 2, 3, 1] + - [4, 5, 0, 2, 1, 3] + - [4, 5, 0, 1, 2, 3] + - [4, 5, 0, 1, 3, 2] + - [4, 5, 1, 3, 0, 2] + - [4, 5, 1, 3, 2, 0] + - [4, 5, 1, 0, 3, 2] + - [4, 5, 1, 0, 2, 3] + - [4, 5, 1, 2, 0, 3] + - [4, 5, 1, 2, 3, 0] + - [5, 1, 2, 3, 4, 0] + - [5, 1, 2, 3, 0, 4] + - [5, 1, 2, 4, 3, 0] + - [5, 1, 2, 4, 0, 3] + - [5, 1, 2, 0, 4, 3] + - [5, 1, 2, 0, 3, 4] + - [5, 1, 3, 2, 4, 0] + - [5, 1, 3, 2, 0, 4] + - [5, 1, 3, 4, 2, 0] + - [5, 1, 3, 4, 0, 2] + - [5, 1, 3, 0, 4, 2] + - [5, 1, 3, 0, 2, 4] + - [5, 1, 4, 3, 2, 0] + - [5, 1, 4, 3, 0, 2] + - [5, 1, 4, 2, 3, 0] + - [5, 1, 4, 2, 0, 3] + - [5, 1, 4, 0, 2, 3] + - [5, 1, 4, 0, 3, 2] + - [5, 1, 0, 3, 4, 2] + - [5, 1, 0, 3, 2, 4] + - [5, 1, 0, 4, 3, 2] + - [5, 1, 0, 4, 2, 3] + - [5, 1, 0, 2, 4, 3] + - [5, 1, 0, 2, 3, 4] + - [5, 2, 1, 3, 4, 0] + - [5, 2, 1, 3, 0, 4] + - [5, 2, 1, 4, 3, 0] + - [5, 2, 1, 4, 0, 3] + - [5, 2, 1, 0, 4, 3] + - [5, 2, 1, 0, 3, 4] + - [5, 2, 3, 1, 4, 0] + - [5, 2, 3, 1, 0, 4] + - [5, 2, 3, 4, 1, 0] + - [5, 2, 3, 4, 0, 1] + - [5, 2, 3, 0, 4, 1] + - [5, 2, 3, 0, 1, 4] + - [5, 2, 4, 3, 1, 0] + - [5, 2, 4, 3, 0, 1] + - [5, 2, 4, 1, 3, 0] + - [5, 2, 4, 1, 0, 3] + - [5, 2, 4, 0, 1, 3] + - [5, 2, 4, 0, 3, 1] + - [5, 2, 0, 3, 4, 1] + - [5, 2, 0, 3, 1, 4] + - [5, 2, 0, 4, 3, 1] + - [5, 2, 0, 4, 1, 3] + - [5, 2, 0, 1, 4, 3] + - [5, 2, 0, 1, 3, 4] + - [5, 3, 2, 1, 4, 0] + - [5, 3, 2, 1, 0, 4] + - [5, 3, 2, 4, 1, 0] + - [5, 3, 2, 4, 0, 1] + - [5, 3, 2, 0, 4, 1] + - [5, 3, 2, 0, 1, 4] + - [5, 3, 1, 2, 4, 0] + - [5, 3, 1, 2, 0, 4] + - [5, 3, 1, 4, 2, 0] + - [5, 3, 1, 4, 0, 2] + - [5, 3, 1, 0, 4, 2] + - [5, 3, 1, 0, 2, 4] + - [5, 3, 4, 1, 2, 0] + - [5, 3, 4, 1, 0, 2] + - [5, 3, 4, 2, 1, 0] + - [5, 3, 4, 2, 0, 1] + - [5, 3, 4, 0, 2, 1] + - [5, 3, 4, 0, 1, 2] + - [5, 3, 0, 1, 4, 2] + - [5, 3, 0, 1, 2, 4] + - [5, 3, 0, 4, 1, 2] + - [5, 3, 0, 4, 2, 1] + - [5, 3, 0, 2, 4, 1] + - [5, 3, 0, 2, 1, 4] + - [5, 4, 2, 3, 1, 0] + - [5, 4, 2, 3, 0, 1] + - [5, 4, 2, 1, 3, 0] + - [5, 4, 2, 1, 0, 3] + - [5, 4, 2, 0, 1, 3] + - [5, 4, 2, 0, 3, 1] + - [5, 4, 3, 2, 1, 0] + - [5, 4, 3, 2, 0, 1] + - [5, 4, 3, 1, 2, 0] + - [5, 4, 3, 1, 0, 2] + - [5, 4, 3, 0, 1, 2] + - [5, 4, 3, 0, 2, 1] + - [5, 4, 1, 3, 2, 0] + - [5, 4, 1, 3, 0, 2] + - [5, 4, 1, 2, 3, 0] + - [5, 4, 1, 2, 0, 3] + - [5, 4, 1, 0, 2, 3] + - [5, 4, 1, 0, 3, 2] + - [5, 4, 0, 3, 1, 2] + - [5, 4, 0, 3, 2, 1] + - [5, 4, 0, 1, 3, 2] + - [5, 4, 0, 1, 2, 3] + - [5, 4, 0, 2, 1, 3] + - [5, 4, 0, 2, 3, 1] + - [5, 0, 2, 3, 4, 1] + - [5, 0, 2, 3, 1, 4] + - [5, 0, 2, 4, 3, 1] + - [5, 0, 2, 4, 1, 3] + - [5, 0, 2, 1, 4, 3] + - [5, 0, 2, 1, 3, 4] + - [5, 0, 3, 2, 4, 1] + - [5, 0, 3, 2, 1, 4] + - [5, 0, 3, 4, 2, 1] + - [5, 0, 3, 4, 1, 2] + - [5, 0, 3, 1, 4, 2] + - [5, 0, 3, 1, 2, 4] + - [5, 0, 4, 3, 2, 1] + - [5, 0, 4, 3, 1, 2] + - [5, 0, 4, 2, 3, 1] + - [5, 0, 4, 2, 1, 3] + - [5, 0, 4, 1, 2, 3] + - [5, 0, 4, 1, 3, 2] + - [5, 0, 1, 3, 4, 2] + - [5, 0, 1, 3, 2, 4] + - [5, 0, 1, 4, 3, 2] + - [5, 0, 1, 4, 2, 3] + - [5, 0, 1, 2, 4, 3] + - [5, 0, 1, 2, 3, 4] +... diff --git a/test/02_permutation/configs/validation/rank2_test_params.yaml b/test/02_permutation/configs/validation/rank2_test_params.yaml new file mode 100644 index 00000000..33461d71 --- /dev/null +++ b/test/02_permutation/configs/validation/rank2_test_params.yaml @@ -0,0 +1,25 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1] + - [ 5, 2] + - [ 3, 4] + - [ 15, 12] + - [ 23, 11] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1] + - [1, 0] +... diff --git a/test/02_permutation/configs/validation/rank3_test_params.yaml b/test/02_permutation/configs/validation/rank3_test_params.yaml new file mode 100644 index 00000000..366782c9 --- /dev/null +++ b/test/02_permutation/configs/validation/rank3_test_params.yaml @@ -0,0 +1,29 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1] + - [ 5, 2, 3] + - [ 5, 2, 4] + - [ 15, 12, 23] + - [ 12, 23, 11] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2] + - [0, 2, 1] + - [1, 0, 2] + - [1, 2, 0] + - [2, 1, 0] + - [2, 0, 1] +... diff --git a/test/02_permutation/configs/validation/rank4_test_params.yaml b/test/02_permutation/configs/validation/rank4_test_params.yaml new file mode 100644 index 00000000..e1caffea --- /dev/null +++ b/test/02_permutation/configs/validation/rank4_test_params.yaml @@ -0,0 +1,46 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1, 1] + - [ 5, 2, 3, 4] + - [ 5, 2, 1, 1] + - [ 15, 12, 23, 11] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2, 3] + - [0, 1, 3, 2] + - [0, 2, 1, 3] + - [0, 2, 3, 1] + - [0, 3, 2, 1] + - [0, 3, 1, 2] + - [1, 0, 2, 3] + - [1, 0, 3, 2] + - [1, 2, 0, 3] + - [1, 2, 3, 0] + - [1, 3, 2, 0] + - [1, 3, 0, 2] + - [2, 1, 0, 3] + - [2, 1, 3, 0] + - [2, 0, 1, 3] + - [2, 0, 3, 1] + - [2, 3, 0, 1] + - [2, 3, 1, 0] + - [3, 1, 2, 0] + - [3, 1, 0, 2] + - [3, 2, 1, 0] + - [3, 2, 0, 1] + - [3, 0, 2, 1] + - [3, 0, 1, 2] +... diff --git a/test/02_permutation/configs/validation/rank5_test_params.yaml b/test/02_permutation/configs/validation/rank5_test_params.yaml new file mode 100644 index 00000000..410da229 --- /dev/null +++ b/test/02_permutation/configs/validation/rank5_test_params.yaml @@ -0,0 +1,142 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1, 1, 1] + - [ 5, 2, 3, 4, 5] + - [ 5, 2, 1, 1, 2] + - [ 15, 12, 23, 11, 2] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2, 3, 4] + - [0, 1, 2, 4, 3] + - [0, 1, 3, 2, 4] + - [0, 1, 3, 4, 2] + - [0, 1, 4, 3, 2] + - [0, 1, 4, 2, 3] + - [0, 2, 1, 3, 4] + - [0, 2, 1, 4, 3] + - [0, 2, 3, 1, 4] + - [0, 2, 3, 4, 1] + - [0, 2, 4, 3, 1] + - [0, 2, 4, 1, 3] + - [0, 3, 2, 1, 4] + - [0, 3, 2, 4, 1] + - [0, 3, 1, 2, 4] + - [0, 3, 1, 4, 2] + - [0, 3, 4, 1, 2] + - [0, 3, 4, 2, 1] + - [0, 4, 2, 3, 1] + - [0, 4, 2, 1, 3] + - [0, 4, 3, 2, 1] + - [0, 4, 3, 1, 2] + - [0, 4, 1, 3, 2] + - [0, 4, 1, 2, 3] + - [1, 0, 2, 3, 4] + - [1, 0, 2, 4, 3] + - [1, 0, 3, 2, 4] + - [1, 0, 3, 4, 2] + - [1, 0, 4, 3, 2] + - [1, 0, 4, 2, 3] + - [1, 2, 0, 3, 4] + - [1, 2, 0, 4, 3] + - [1, 2, 3, 0, 4] + - [1, 2, 3, 4, 0] + - [1, 2, 4, 3, 0] + - [1, 2, 4, 0, 3] + - [1, 3, 2, 0, 4] + - [1, 3, 2, 4, 0] + - [1, 3, 0, 2, 4] + - [1, 3, 0, 4, 2] + - [1, 3, 4, 0, 2] + - [1, 3, 4, 2, 0] + - [1, 4, 2, 3, 0] + - [1, 4, 2, 0, 3] + - [1, 4, 3, 2, 0] + - [1, 4, 3, 0, 2] + - [1, 4, 0, 3, 2] + - [1, 4, 0, 2, 3] + - [2, 1, 0, 3, 4] + - [2, 1, 0, 4, 3] + - [2, 1, 3, 0, 4] + - [2, 1, 3, 4, 0] + - [2, 1, 4, 3, 0] + - [2, 1, 4, 0, 3] + - [2, 0, 1, 3, 4] + - [2, 0, 1, 4, 3] + - [2, 0, 3, 1, 4] + - [2, 0, 3, 4, 1] + - [2, 0, 4, 3, 1] + - [2, 0, 4, 1, 3] + - [2, 3, 0, 1, 4] + - [2, 3, 0, 4, 1] + - [2, 3, 1, 0, 4] + - [2, 3, 1, 4, 0] + - [2, 3, 4, 1, 0] + - [2, 3, 4, 0, 1] + - [2, 4, 0, 3, 1] + - [2, 4, 0, 1, 3] + - [2, 4, 3, 0, 1] + - [2, 4, 3, 1, 0] + - [2, 4, 1, 3, 0] + - [2, 4, 1, 0, 3] + - [3, 1, 2, 0, 4] + - [3, 1, 2, 4, 0] + - [3, 1, 0, 2, 4] + - [3, 1, 0, 4, 2] + - [3, 1, 4, 0, 2] + - [3, 1, 4, 2, 0] + - [3, 2, 1, 0, 4] + - [3, 2, 1, 4, 0] + - [3, 2, 0, 1, 4] + - [3, 2, 0, 4, 1] + - [3, 2, 4, 0, 1] + - [3, 2, 4, 1, 0] + - [3, 0, 2, 1, 4] + - [3, 0, 2, 4, 1] + - [3, 0, 1, 2, 4] + - [3, 0, 1, 4, 2] + - [3, 0, 4, 1, 2] + - [3, 0, 4, 2, 1] + - [3, 4, 2, 0, 1] + - [3, 4, 2, 1, 0] + - [3, 4, 0, 2, 1] + - [3, 4, 0, 1, 2] + - [3, 4, 1, 0, 2] + - [3, 4, 1, 2, 0] + - [4, 1, 2, 3, 0] + - [4, 1, 2, 0, 3] + - [4, 1, 3, 2, 0] + - [4, 1, 3, 0, 2] + - [4, 1, 0, 3, 2] + - [4, 1, 0, 2, 3] + - [4, 2, 1, 3, 0] + - [4, 2, 1, 0, 3] + - [4, 2, 3, 1, 0] + - [4, 2, 3, 0, 1] + - [4, 2, 0, 3, 1] + - [4, 2, 0, 1, 3] + - [4, 3, 2, 1, 0] + - [4, 3, 2, 0, 1] + - [4, 3, 1, 2, 0] + - [4, 3, 1, 0, 2] + - [4, 3, 0, 1, 2] + - [4, 3, 0, 2, 1] + - [4, 0, 2, 3, 1] + - [4, 0, 2, 1, 3] + - [4, 0, 3, 2, 1] + - [4, 0, 3, 1, 2] + - [4, 0, 1, 3, 2] + - [4, 0, 1, 2, 3] +... diff --git a/test/02_permutation/configs/validation/rank6_test_params.yaml b/test/02_permutation/configs/validation/rank6_test_params.yaml new file mode 100644 index 00000000..87a26ee7 --- /dev/null +++ b/test/02_permutation/configs/validation/rank6_test_params.yaml @@ -0,0 +1,742 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_32F, HIP_R_32F] + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] +Alphas: + - 0.0 + - 1.0 + - 2.3 +Lengths: + - [ 1, 1, 1, 1, 1, 1] + - [ 5, 2, 3, 4, 1, 2] + - [ 5, 2, 1, 1, 1, 2] + - [ 15, 12, 23, 11, 1, 2] +Operators: + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_IDENTITY, HIPTENSOR_OP_SQRT] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_IDENTITY] + - [HIPTENSOR_OP_SQRT, HIPTENSOR_OP_SQRT] +Permuted Dims: + - [0, 1, 2, 3, 4, 5] + - [0, 1, 2, 3, 5, 4] + - [0, 1, 2, 4, 3, 5] + - [0, 1, 2, 4, 5, 3] + - [0, 1, 2, 5, 4, 3] + - [0, 1, 2, 5, 3, 4] + - [0, 1, 3, 2, 4, 5] + - [0, 1, 3, 2, 5, 4] + - [0, 1, 3, 4, 2, 5] + - [0, 1, 3, 4, 5, 2] + - [0, 1, 3, 5, 4, 2] + - [0, 1, 3, 5, 2, 4] + - [0, 1, 4, 3, 2, 5] + - [0, 1, 4, 3, 5, 2] + - [0, 1, 4, 2, 3, 5] + - [0, 1, 4, 2, 5, 3] + - [0, 1, 4, 5, 2, 3] + - [0, 1, 4, 5, 3, 2] + - [0, 1, 5, 3, 4, 2] + - [0, 1, 5, 3, 2, 4] + - [0, 1, 5, 4, 3, 2] + - [0, 1, 5, 4, 2, 3] + - [0, 1, 5, 2, 4, 3] + - [0, 1, 5, 2, 3, 4] + - [0, 2, 1, 3, 4, 5] + - [0, 2, 1, 3, 5, 4] + - [0, 2, 1, 4, 3, 5] + - [0, 2, 1, 4, 5, 3] + - [0, 2, 1, 5, 4, 3] + - [0, 2, 1, 5, 3, 4] + - [0, 2, 3, 1, 4, 5] + - [0, 2, 3, 1, 5, 4] + - [0, 2, 3, 4, 1, 5] + - [0, 2, 3, 4, 5, 1] + - [0, 2, 3, 5, 4, 1] + - [0, 2, 3, 5, 1, 4] + - [0, 2, 4, 3, 1, 5] + - [0, 2, 4, 3, 5, 1] + - [0, 2, 4, 1, 3, 5] + - [0, 2, 4, 1, 5, 3] + - [0, 2, 4, 5, 1, 3] + - [0, 2, 4, 5, 3, 1] + - [0, 2, 5, 3, 4, 1] + - [0, 2, 5, 3, 1, 4] + - [0, 2, 5, 4, 3, 1] + - [0, 2, 5, 4, 1, 3] + - [0, 2, 5, 1, 4, 3] + - [0, 2, 5, 1, 3, 4] + - [0, 3, 2, 1, 4, 5] + - [0, 3, 2, 1, 5, 4] + - [0, 3, 2, 4, 1, 5] + - [0, 3, 2, 4, 5, 1] + - [0, 3, 2, 5, 4, 1] + - [0, 3, 2, 5, 1, 4] + - [0, 3, 1, 2, 4, 5] + - [0, 3, 1, 2, 5, 4] + - [0, 3, 1, 4, 2, 5] + - [0, 3, 1, 4, 5, 2] + - [0, 3, 1, 5, 4, 2] + - [0, 3, 1, 5, 2, 4] + - [0, 3, 4, 1, 2, 5] + - [0, 3, 4, 1, 5, 2] + - [0, 3, 4, 2, 1, 5] + - [0, 3, 4, 2, 5, 1] + - [0, 3, 4, 5, 2, 1] + - [0, 3, 4, 5, 1, 2] + - [0, 3, 5, 1, 4, 2] + - [0, 3, 5, 1, 2, 4] + - [0, 3, 5, 4, 1, 2] + - [0, 3, 5, 4, 2, 1] + - [0, 3, 5, 2, 4, 1] + - [0, 3, 5, 2, 1, 4] + - [0, 4, 2, 3, 1, 5] + - [0, 4, 2, 3, 5, 1] + - [0, 4, 2, 1, 3, 5] + - [0, 4, 2, 1, 5, 3] + - [0, 4, 2, 5, 1, 3] + - [0, 4, 2, 5, 3, 1] + - [0, 4, 3, 2, 1, 5] + - [0, 4, 3, 2, 5, 1] + - [0, 4, 3, 1, 2, 5] + - [0, 4, 3, 1, 5, 2] + - [0, 4, 3, 5, 1, 2] + - [0, 4, 3, 5, 2, 1] + - [0, 4, 1, 3, 2, 5] + - [0, 4, 1, 3, 5, 2] + - [0, 4, 1, 2, 3, 5] + - [0, 4, 1, 2, 5, 3] + - [0, 4, 1, 5, 2, 3] + - [0, 4, 1, 5, 3, 2] + - [0, 4, 5, 3, 1, 2] + - [0, 4, 5, 3, 2, 1] + - [0, 4, 5, 1, 3, 2] + - [0, 4, 5, 1, 2, 3] + - [0, 4, 5, 2, 1, 3] + - [0, 4, 5, 2, 3, 1] + - [0, 5, 2, 3, 4, 1] + - [0, 5, 2, 3, 1, 4] + - [0, 5, 2, 4, 3, 1] + - [0, 5, 2, 4, 1, 3] + - [0, 5, 2, 1, 4, 3] + - [0, 5, 2, 1, 3, 4] + - [0, 5, 3, 2, 4, 1] + - [0, 5, 3, 2, 1, 4] + - [0, 5, 3, 4, 2, 1] + - [0, 5, 3, 4, 1, 2] + - [0, 5, 3, 1, 4, 2] + - [0, 5, 3, 1, 2, 4] + - [0, 5, 4, 3, 2, 1] + - [0, 5, 4, 3, 1, 2] + - [0, 5, 4, 2, 3, 1] + - [0, 5, 4, 2, 1, 3] + - [0, 5, 4, 1, 2, 3] + - [0, 5, 4, 1, 3, 2] + - [0, 5, 1, 3, 4, 2] + - [0, 5, 1, 3, 2, 4] + - [0, 5, 1, 4, 3, 2] + - [0, 5, 1, 4, 2, 3] + - [0, 5, 1, 2, 4, 3] + - [0, 5, 1, 2, 3, 4] + - [1, 0, 2, 3, 4, 5] + - [1, 0, 2, 3, 5, 4] + - [1, 0, 2, 4, 3, 5] + - [1, 0, 2, 4, 5, 3] + - [1, 0, 2, 5, 4, 3] + - [1, 0, 2, 5, 3, 4] + - [1, 0, 3, 2, 4, 5] + - [1, 0, 3, 2, 5, 4] + - [1, 0, 3, 4, 2, 5] + - [1, 0, 3, 4, 5, 2] + - [1, 0, 3, 5, 4, 2] + - [1, 0, 3, 5, 2, 4] + - [1, 0, 4, 3, 2, 5] + - [1, 0, 4, 3, 5, 2] + - [1, 0, 4, 2, 3, 5] + - [1, 0, 4, 2, 5, 3] + - [1, 0, 4, 5, 2, 3] + - [1, 0, 4, 5, 3, 2] + - [1, 0, 5, 3, 4, 2] + - [1, 0, 5, 3, 2, 4] + - [1, 0, 5, 4, 3, 2] + - [1, 0, 5, 4, 2, 3] + - [1, 0, 5, 2, 4, 3] + - [1, 0, 5, 2, 3, 4] + - [1, 2, 0, 3, 4, 5] + - [1, 2, 0, 3, 5, 4] + - [1, 2, 0, 4, 3, 5] + - [1, 2, 0, 4, 5, 3] + - [1, 2, 0, 5, 4, 3] + - [1, 2, 0, 5, 3, 4] + - [1, 2, 3, 0, 4, 5] + - [1, 2, 3, 0, 5, 4] + - [1, 2, 3, 4, 0, 5] + - [1, 2, 3, 4, 5, 0] + - [1, 2, 3, 5, 4, 0] + - [1, 2, 3, 5, 0, 4] + - [1, 2, 4, 3, 0, 5] + - [1, 2, 4, 3, 5, 0] + - [1, 2, 4, 0, 3, 5] + - [1, 2, 4, 0, 5, 3] + - [1, 2, 4, 5, 0, 3] + - [1, 2, 4, 5, 3, 0] + - [1, 2, 5, 3, 4, 0] + - [1, 2, 5, 3, 0, 4] + - [1, 2, 5, 4, 3, 0] + - [1, 2, 5, 4, 0, 3] + - [1, 2, 5, 0, 4, 3] + - [1, 2, 5, 0, 3, 4] + - [1, 3, 2, 0, 4, 5] + - [1, 3, 2, 0, 5, 4] + - [1, 3, 2, 4, 0, 5] + - [1, 3, 2, 4, 5, 0] + - [1, 3, 2, 5, 4, 0] + - [1, 3, 2, 5, 0, 4] + - [1, 3, 0, 2, 4, 5] + - [1, 3, 0, 2, 5, 4] + - [1, 3, 0, 4, 2, 5] + - [1, 3, 0, 4, 5, 2] + - [1, 3, 0, 5, 4, 2] + - [1, 3, 0, 5, 2, 4] + - [1, 3, 4, 0, 2, 5] + - [1, 3, 4, 0, 5, 2] + - [1, 3, 4, 2, 0, 5] + - [1, 3, 4, 2, 5, 0] + - [1, 3, 4, 5, 2, 0] + - [1, 3, 4, 5, 0, 2] + - [1, 3, 5, 0, 4, 2] + - [1, 3, 5, 0, 2, 4] + - [1, 3, 5, 4, 0, 2] + - [1, 3, 5, 4, 2, 0] + - [1, 3, 5, 2, 4, 0] + - [1, 3, 5, 2, 0, 4] + - [1, 4, 2, 3, 0, 5] + - [1, 4, 2, 3, 5, 0] + - [1, 4, 2, 0, 3, 5] + - [1, 4, 2, 0, 5, 3] + - [1, 4, 2, 5, 0, 3] + - [1, 4, 2, 5, 3, 0] + - [1, 4, 3, 2, 0, 5] + - [1, 4, 3, 2, 5, 0] + - [1, 4, 3, 0, 2, 5] + - [1, 4, 3, 0, 5, 2] + - [1, 4, 3, 5, 0, 2] + - [1, 4, 3, 5, 2, 0] + - [1, 4, 0, 3, 2, 5] + - [1, 4, 0, 3, 5, 2] + - [1, 4, 0, 2, 3, 5] + - [1, 4, 0, 2, 5, 3] + - [1, 4, 0, 5, 2, 3] + - [1, 4, 0, 5, 3, 2] + - [1, 4, 5, 3, 0, 2] + - [1, 4, 5, 3, 2, 0] + - [1, 4, 5, 0, 3, 2] + - [1, 4, 5, 0, 2, 3] + - [1, 4, 5, 2, 0, 3] + - [1, 4, 5, 2, 3, 0] + - [1, 5, 2, 3, 4, 0] + - [1, 5, 2, 3, 0, 4] + - [1, 5, 2, 4, 3, 0] + - [1, 5, 2, 4, 0, 3] + - [1, 5, 2, 0, 4, 3] + - [1, 5, 2, 0, 3, 4] + - [1, 5, 3, 2, 4, 0] + - [1, 5, 3, 2, 0, 4] + - [1, 5, 3, 4, 2, 0] + - [1, 5, 3, 4, 0, 2] + - [1, 5, 3, 0, 4, 2] + - [1, 5, 3, 0, 2, 4] + - [1, 5, 4, 3, 2, 0] + - [1, 5, 4, 3, 0, 2] + - [1, 5, 4, 2, 3, 0] + - [1, 5, 4, 2, 0, 3] + - [1, 5, 4, 0, 2, 3] + - [1, 5, 4, 0, 3, 2] + - [1, 5, 0, 3, 4, 2] + - [1, 5, 0, 3, 2, 4] + - [1, 5, 0, 4, 3, 2] + - [1, 5, 0, 4, 2, 3] + - [1, 5, 0, 2, 4, 3] + - [1, 5, 0, 2, 3, 4] + - [2, 1, 0, 3, 4, 5] + - [2, 1, 0, 3, 5, 4] + - [2, 1, 0, 4, 3, 5] + - [2, 1, 0, 4, 5, 3] + - [2, 1, 0, 5, 4, 3] + - [2, 1, 0, 5, 3, 4] + - [2, 1, 3, 0, 4, 5] + - [2, 1, 3, 0, 5, 4] + - [2, 1, 3, 4, 0, 5] + - [2, 1, 3, 4, 5, 0] + - [2, 1, 3, 5, 4, 0] + - [2, 1, 3, 5, 0, 4] + - [2, 1, 4, 3, 0, 5] + - [2, 1, 4, 3, 5, 0] + - [2, 1, 4, 0, 3, 5] + - [2, 1, 4, 0, 5, 3] + - [2, 1, 4, 5, 0, 3] + - [2, 1, 4, 5, 3, 0] + - [2, 1, 5, 3, 4, 0] + - [2, 1, 5, 3, 0, 4] + - [2, 1, 5, 4, 3, 0] + - [2, 1, 5, 4, 0, 3] + - [2, 1, 5, 0, 4, 3] + - [2, 1, 5, 0, 3, 4] + - [2, 0, 1, 3, 4, 5] + - [2, 0, 1, 3, 5, 4] + - [2, 0, 1, 4, 3, 5] + - [2, 0, 1, 4, 5, 3] + - [2, 0, 1, 5, 4, 3] + - [2, 0, 1, 5, 3, 4] + - [2, 0, 3, 1, 4, 5] + - [2, 0, 3, 1, 5, 4] + - [2, 0, 3, 4, 1, 5] + - [2, 0, 3, 4, 5, 1] + - [2, 0, 3, 5, 4, 1] + - [2, 0, 3, 5, 1, 4] + - [2, 0, 4, 3, 1, 5] + - [2, 0, 4, 3, 5, 1] + - [2, 0, 4, 1, 3, 5] + - [2, 0, 4, 1, 5, 3] + - [2, 0, 4, 5, 1, 3] + - [2, 0, 4, 5, 3, 1] + - [2, 0, 5, 3, 4, 1] + - [2, 0, 5, 3, 1, 4] + - [2, 0, 5, 4, 3, 1] + - [2, 0, 5, 4, 1, 3] + - [2, 0, 5, 1, 4, 3] + - [2, 0, 5, 1, 3, 4] + - [2, 3, 0, 1, 4, 5] + - [2, 3, 0, 1, 5, 4] + - [2, 3, 0, 4, 1, 5] + - [2, 3, 0, 4, 5, 1] + - [2, 3, 0, 5, 4, 1] + - [2, 3, 0, 5, 1, 4] + - [2, 3, 1, 0, 4, 5] + - [2, 3, 1, 0, 5, 4] + - [2, 3, 1, 4, 0, 5] + - [2, 3, 1, 4, 5, 0] + - [2, 3, 1, 5, 4, 0] + - [2, 3, 1, 5, 0, 4] + - [2, 3, 4, 1, 0, 5] + - [2, 3, 4, 1, 5, 0] + - [2, 3, 4, 0, 1, 5] + - [2, 3, 4, 0, 5, 1] + - [2, 3, 4, 5, 0, 1] + - [2, 3, 4, 5, 1, 0] + - [2, 3, 5, 1, 4, 0] + - [2, 3, 5, 1, 0, 4] + - [2, 3, 5, 4, 1, 0] + - [2, 3, 5, 4, 0, 1] + - [2, 3, 5, 0, 4, 1] + - [2, 3, 5, 0, 1, 4] + - [2, 4, 0, 3, 1, 5] + - [2, 4, 0, 3, 5, 1] + - [2, 4, 0, 1, 3, 5] + - [2, 4, 0, 1, 5, 3] + - [2, 4, 0, 5, 1, 3] + - [2, 4, 0, 5, 3, 1] + - [2, 4, 3, 0, 1, 5] + - [2, 4, 3, 0, 5, 1] + - [2, 4, 3, 1, 0, 5] + - [2, 4, 3, 1, 5, 0] + - [2, 4, 3, 5, 1, 0] + - [2, 4, 3, 5, 0, 1] + - [2, 4, 1, 3, 0, 5] + - [2, 4, 1, 3, 5, 0] + - [2, 4, 1, 0, 3, 5] + - [2, 4, 1, 0, 5, 3] + - [2, 4, 1, 5, 0, 3] + - [2, 4, 1, 5, 3, 0] + - [2, 4, 5, 3, 1, 0] + - [2, 4, 5, 3, 0, 1] + - [2, 4, 5, 1, 3, 0] + - [2, 4, 5, 1, 0, 3] + - [2, 4, 5, 0, 1, 3] + - [2, 4, 5, 0, 3, 1] + - [2, 5, 0, 3, 4, 1] + - [2, 5, 0, 3, 1, 4] + - [2, 5, 0, 4, 3, 1] + - [2, 5, 0, 4, 1, 3] + - [2, 5, 0, 1, 4, 3] + - [2, 5, 0, 1, 3, 4] + - [2, 5, 3, 0, 4, 1] + - [2, 5, 3, 0, 1, 4] + - [2, 5, 3, 4, 0, 1] + - [2, 5, 3, 4, 1, 0] + - [2, 5, 3, 1, 4, 0] + - [2, 5, 3, 1, 0, 4] + - [2, 5, 4, 3, 0, 1] + - [2, 5, 4, 3, 1, 0] + - [2, 5, 4, 0, 3, 1] + - [2, 5, 4, 0, 1, 3] + - [2, 5, 4, 1, 0, 3] + - [2, 5, 4, 1, 3, 0] + - [2, 5, 1, 3, 4, 0] + - [2, 5, 1, 3, 0, 4] + - [2, 5, 1, 4, 3, 0] + - [2, 5, 1, 4, 0, 3] + - [2, 5, 1, 0, 4, 3] + - [2, 5, 1, 0, 3, 4] + - [3, 1, 2, 0, 4, 5] + - [3, 1, 2, 0, 5, 4] + - [3, 1, 2, 4, 0, 5] + - [3, 1, 2, 4, 5, 0] + - [3, 1, 2, 5, 4, 0] + - [3, 1, 2, 5, 0, 4] + - [3, 1, 0, 2, 4, 5] + - [3, 1, 0, 2, 5, 4] + - [3, 1, 0, 4, 2, 5] + - [3, 1, 0, 4, 5, 2] + - [3, 1, 0, 5, 4, 2] + - [3, 1, 0, 5, 2, 4] + - [3, 1, 4, 0, 2, 5] + - [3, 1, 4, 0, 5, 2] + - [3, 1, 4, 2, 0, 5] + - [3, 1, 4, 2, 5, 0] + - [3, 1, 4, 5, 2, 0] + - [3, 1, 4, 5, 0, 2] + - [3, 1, 5, 0, 4, 2] + - [3, 1, 5, 0, 2, 4] + - [3, 1, 5, 4, 0, 2] + - [3, 1, 5, 4, 2, 0] + - [3, 1, 5, 2, 4, 0] + - [3, 1, 5, 2, 0, 4] + - [3, 2, 1, 0, 4, 5] + - [3, 2, 1, 0, 5, 4] + - [3, 2, 1, 4, 0, 5] + - [3, 2, 1, 4, 5, 0] + - [3, 2, 1, 5, 4, 0] + - [3, 2, 1, 5, 0, 4] + - [3, 2, 0, 1, 4, 5] + - [3, 2, 0, 1, 5, 4] + - [3, 2, 0, 4, 1, 5] + - [3, 2, 0, 4, 5, 1] + - [3, 2, 0, 5, 4, 1] + - [3, 2, 0, 5, 1, 4] + - [3, 2, 4, 0, 1, 5] + - [3, 2, 4, 0, 5, 1] + - [3, 2, 4, 1, 0, 5] + - [3, 2, 4, 1, 5, 0] + - [3, 2, 4, 5, 1, 0] + - [3, 2, 4, 5, 0, 1] + - [3, 2, 5, 0, 4, 1] + - [3, 2, 5, 0, 1, 4] + - [3, 2, 5, 4, 0, 1] + - [3, 2, 5, 4, 1, 0] + - [3, 2, 5, 1, 4, 0] + - [3, 2, 5, 1, 0, 4] + - [3, 0, 2, 1, 4, 5] + - [3, 0, 2, 1, 5, 4] + - [3, 0, 2, 4, 1, 5] + - [3, 0, 2, 4, 5, 1] + - [3, 0, 2, 5, 4, 1] + - [3, 0, 2, 5, 1, 4] + - [3, 0, 1, 2, 4, 5] + - [3, 0, 1, 2, 5, 4] + - [3, 0, 1, 4, 2, 5] + - [3, 0, 1, 4, 5, 2] + - [3, 0, 1, 5, 4, 2] + - [3, 0, 1, 5, 2, 4] + - [3, 0, 4, 1, 2, 5] + - [3, 0, 4, 1, 5, 2] + - [3, 0, 4, 2, 1, 5] + - [3, 0, 4, 2, 5, 1] + - [3, 0, 4, 5, 2, 1] + - [3, 0, 4, 5, 1, 2] + - [3, 0, 5, 1, 4, 2] + - [3, 0, 5, 1, 2, 4] + - [3, 0, 5, 4, 1, 2] + - [3, 0, 5, 4, 2, 1] + - [3, 0, 5, 2, 4, 1] + - [3, 0, 5, 2, 1, 4] + - [3, 4, 2, 0, 1, 5] + - [3, 4, 2, 0, 5, 1] + - [3, 4, 2, 1, 0, 5] + - [3, 4, 2, 1, 5, 0] + - [3, 4, 2, 5, 1, 0] + - [3, 4, 2, 5, 0, 1] + - [3, 4, 0, 2, 1, 5] + - [3, 4, 0, 2, 5, 1] + - [3, 4, 0, 1, 2, 5] + - [3, 4, 0, 1, 5, 2] + - [3, 4, 0, 5, 1, 2] + - [3, 4, 0, 5, 2, 1] + - [3, 4, 1, 0, 2, 5] + - [3, 4, 1, 0, 5, 2] + - [3, 4, 1, 2, 0, 5] + - [3, 4, 1, 2, 5, 0] + - [3, 4, 1, 5, 2, 0] + - [3, 4, 1, 5, 0, 2] + - [3, 4, 5, 0, 1, 2] + - [3, 4, 5, 0, 2, 1] + - [3, 4, 5, 1, 0, 2] + - [3, 4, 5, 1, 2, 0] + - [3, 4, 5, 2, 1, 0] + - [3, 4, 5, 2, 0, 1] + - [3, 5, 2, 0, 4, 1] + - [3, 5, 2, 0, 1, 4] + - [3, 5, 2, 4, 0, 1] + - [3, 5, 2, 4, 1, 0] + - [3, 5, 2, 1, 4, 0] + - [3, 5, 2, 1, 0, 4] + - [3, 5, 0, 2, 4, 1] + - [3, 5, 0, 2, 1, 4] + - [3, 5, 0, 4, 2, 1] + - [3, 5, 0, 4, 1, 2] + - [3, 5, 0, 1, 4, 2] + - [3, 5, 0, 1, 2, 4] + - [3, 5, 4, 0, 2, 1] + - [3, 5, 4, 0, 1, 2] + - [3, 5, 4, 2, 0, 1] + - [3, 5, 4, 2, 1, 0] + - [3, 5, 4, 1, 2, 0] + - [3, 5, 4, 1, 0, 2] + - [3, 5, 1, 0, 4, 2] + - [3, 5, 1, 0, 2, 4] + - [3, 5, 1, 4, 0, 2] + - [3, 5, 1, 4, 2, 0] + - [3, 5, 1, 2, 4, 0] + - [3, 5, 1, 2, 0, 4] + - [4, 1, 2, 3, 0, 5] + - [4, 1, 2, 3, 5, 0] + - [4, 1, 2, 0, 3, 5] + - [4, 1, 2, 0, 5, 3] + - [4, 1, 2, 5, 0, 3] + - [4, 1, 2, 5, 3, 0] + - [4, 1, 3, 2, 0, 5] + - [4, 1, 3, 2, 5, 0] + - [4, 1, 3, 0, 2, 5] + - [4, 1, 3, 0, 5, 2] + - [4, 1, 3, 5, 0, 2] + - [4, 1, 3, 5, 2, 0] + - [4, 1, 0, 3, 2, 5] + - [4, 1, 0, 3, 5, 2] + - [4, 1, 0, 2, 3, 5] + - [4, 1, 0, 2, 5, 3] + - [4, 1, 0, 5, 2, 3] + - [4, 1, 0, 5, 3, 2] + - [4, 1, 5, 3, 0, 2] + - [4, 1, 5, 3, 2, 0] + - [4, 1, 5, 0, 3, 2] + - [4, 1, 5, 0, 2, 3] + - [4, 1, 5, 2, 0, 3] + - [4, 1, 5, 2, 3, 0] + - [4, 2, 1, 3, 0, 5] + - [4, 2, 1, 3, 5, 0] + - [4, 2, 1, 0, 3, 5] + - [4, 2, 1, 0, 5, 3] + - [4, 2, 1, 5, 0, 3] + - [4, 2, 1, 5, 3, 0] + - [4, 2, 3, 1, 0, 5] + - [4, 2, 3, 1, 5, 0] + - [4, 2, 3, 0, 1, 5] + - [4, 2, 3, 0, 5, 1] + - [4, 2, 3, 5, 0, 1] + - [4, 2, 3, 5, 1, 0] + - [4, 2, 0, 3, 1, 5] + - [4, 2, 0, 3, 5, 1] + - [4, 2, 0, 1, 3, 5] + - [4, 2, 0, 1, 5, 3] + - [4, 2, 0, 5, 1, 3] + - [4, 2, 0, 5, 3, 1] + - [4, 2, 5, 3, 0, 1] + - [4, 2, 5, 3, 1, 0] + - [4, 2, 5, 0, 3, 1] + - [4, 2, 5, 0, 1, 3] + - [4, 2, 5, 1, 0, 3] + - [4, 2, 5, 1, 3, 0] + - [4, 3, 2, 1, 0, 5] + - [4, 3, 2, 1, 5, 0] + - [4, 3, 2, 0, 1, 5] + - [4, 3, 2, 0, 5, 1] + - [4, 3, 2, 5, 0, 1] + - [4, 3, 2, 5, 1, 0] + - [4, 3, 1, 2, 0, 5] + - [4, 3, 1, 2, 5, 0] + - [4, 3, 1, 0, 2, 5] + - [4, 3, 1, 0, 5, 2] + - [4, 3, 1, 5, 0, 2] + - [4, 3, 1, 5, 2, 0] + - [4, 3, 0, 1, 2, 5] + - [4, 3, 0, 1, 5, 2] + - [4, 3, 0, 2, 1, 5] + - [4, 3, 0, 2, 5, 1] + - [4, 3, 0, 5, 2, 1] + - [4, 3, 0, 5, 1, 2] + - [4, 3, 5, 1, 0, 2] + - [4, 3, 5, 1, 2, 0] + - [4, 3, 5, 0, 1, 2] + - [4, 3, 5, 0, 2, 1] + - [4, 3, 5, 2, 0, 1] + - [4, 3, 5, 2, 1, 0] + - [4, 0, 2, 3, 1, 5] + - [4, 0, 2, 3, 5, 1] + - [4, 0, 2, 1, 3, 5] + - [4, 0, 2, 1, 5, 3] + - [4, 0, 2, 5, 1, 3] + - [4, 0, 2, 5, 3, 1] + - [4, 0, 3, 2, 1, 5] + - [4, 0, 3, 2, 5, 1] + - [4, 0, 3, 1, 2, 5] + - [4, 0, 3, 1, 5, 2] + - [4, 0, 3, 5, 1, 2] + - [4, 0, 3, 5, 2, 1] + - [4, 0, 1, 3, 2, 5] + - [4, 0, 1, 3, 5, 2] + - [4, 0, 1, 2, 3, 5] + - [4, 0, 1, 2, 5, 3] + - [4, 0, 1, 5, 2, 3] + - [4, 0, 1, 5, 3, 2] + - [4, 0, 5, 3, 1, 2] + - [4, 0, 5, 3, 2, 1] + - [4, 0, 5, 1, 3, 2] + - [4, 0, 5, 1, 2, 3] + - [4, 0, 5, 2, 1, 3] + - [4, 0, 5, 2, 3, 1] + - [4, 5, 2, 3, 0, 1] + - [4, 5, 2, 3, 1, 0] + - [4, 5, 2, 0, 3, 1] + - [4, 5, 2, 0, 1, 3] + - [4, 5, 2, 1, 0, 3] + - [4, 5, 2, 1, 3, 0] + - [4, 5, 3, 2, 0, 1] + - [4, 5, 3, 2, 1, 0] + - [4, 5, 3, 0, 2, 1] + - [4, 5, 3, 0, 1, 2] + - [4, 5, 3, 1, 0, 2] + - [4, 5, 3, 1, 2, 0] + - [4, 5, 0, 3, 2, 1] + - [4, 5, 0, 3, 1, 2] + - [4, 5, 0, 2, 3, 1] + - [4, 5, 0, 2, 1, 3] + - [4, 5, 0, 1, 2, 3] + - [4, 5, 0, 1, 3, 2] + - [4, 5, 1, 3, 0, 2] + - [4, 5, 1, 3, 2, 0] + - [4, 5, 1, 0, 3, 2] + - [4, 5, 1, 0, 2, 3] + - [4, 5, 1, 2, 0, 3] + - [4, 5, 1, 2, 3, 0] + - [5, 1, 2, 3, 4, 0] + - [5, 1, 2, 3, 0, 4] + - [5, 1, 2, 4, 3, 0] + - [5, 1, 2, 4, 0, 3] + - [5, 1, 2, 0, 4, 3] + - [5, 1, 2, 0, 3, 4] + - [5, 1, 3, 2, 4, 0] + - [5, 1, 3, 2, 0, 4] + - [5, 1, 3, 4, 2, 0] + - [5, 1, 3, 4, 0, 2] + - [5, 1, 3, 0, 4, 2] + - [5, 1, 3, 0, 2, 4] + - [5, 1, 4, 3, 2, 0] + - [5, 1, 4, 3, 0, 2] + - [5, 1, 4, 2, 3, 0] + - [5, 1, 4, 2, 0, 3] + - [5, 1, 4, 0, 2, 3] + - [5, 1, 4, 0, 3, 2] + - [5, 1, 0, 3, 4, 2] + - [5, 1, 0, 3, 2, 4] + - [5, 1, 0, 4, 3, 2] + - [5, 1, 0, 4, 2, 3] + - [5, 1, 0, 2, 4, 3] + - [5, 1, 0, 2, 3, 4] + - [5, 2, 1, 3, 4, 0] + - [5, 2, 1, 3, 0, 4] + - [5, 2, 1, 4, 3, 0] + - [5, 2, 1, 4, 0, 3] + - [5, 2, 1, 0, 4, 3] + - [5, 2, 1, 0, 3, 4] + - [5, 2, 3, 1, 4, 0] + - [5, 2, 3, 1, 0, 4] + - [5, 2, 3, 4, 1, 0] + - [5, 2, 3, 4, 0, 1] + - [5, 2, 3, 0, 4, 1] + - [5, 2, 3, 0, 1, 4] + - [5, 2, 4, 3, 1, 0] + - [5, 2, 4, 3, 0, 1] + - [5, 2, 4, 1, 3, 0] + - [5, 2, 4, 1, 0, 3] + - [5, 2, 4, 0, 1, 3] + - [5, 2, 4, 0, 3, 1] + - [5, 2, 0, 3, 4, 1] + - [5, 2, 0, 3, 1, 4] + - [5, 2, 0, 4, 3, 1] + - [5, 2, 0, 4, 1, 3] + - [5, 2, 0, 1, 4, 3] + - [5, 2, 0, 1, 3, 4] + - [5, 3, 2, 1, 4, 0] + - [5, 3, 2, 1, 0, 4] + - [5, 3, 2, 4, 1, 0] + - [5, 3, 2, 4, 0, 1] + - [5, 3, 2, 0, 4, 1] + - [5, 3, 2, 0, 1, 4] + - [5, 3, 1, 2, 4, 0] + - [5, 3, 1, 2, 0, 4] + - [5, 3, 1, 4, 2, 0] + - [5, 3, 1, 4, 0, 2] + - [5, 3, 1, 0, 4, 2] + - [5, 3, 1, 0, 2, 4] + - [5, 3, 4, 1, 2, 0] + - [5, 3, 4, 1, 0, 2] + - [5, 3, 4, 2, 1, 0] + - [5, 3, 4, 2, 0, 1] + - [5, 3, 4, 0, 2, 1] + - [5, 3, 4, 0, 1, 2] + - [5, 3, 0, 1, 4, 2] + - [5, 3, 0, 1, 2, 4] + - [5, 3, 0, 4, 1, 2] + - [5, 3, 0, 4, 2, 1] + - [5, 3, 0, 2, 4, 1] + - [5, 3, 0, 2, 1, 4] + - [5, 4, 2, 3, 1, 0] + - [5, 4, 2, 3, 0, 1] + - [5, 4, 2, 1, 3, 0] + - [5, 4, 2, 1, 0, 3] + - [5, 4, 2, 0, 1, 3] + - [5, 4, 2, 0, 3, 1] + - [5, 4, 3, 2, 1, 0] + - [5, 4, 3, 2, 0, 1] + - [5, 4, 3, 1, 2, 0] + - [5, 4, 3, 1, 0, 2] + - [5, 4, 3, 0, 1, 2] + - [5, 4, 3, 0, 2, 1] + - [5, 4, 1, 3, 2, 0] + - [5, 4, 1, 3, 0, 2] + - [5, 4, 1, 2, 3, 0] + - [5, 4, 1, 2, 0, 3] + - [5, 4, 1, 0, 2, 3] + - [5, 4, 1, 0, 3, 2] + - [5, 4, 0, 3, 1, 2] + - [5, 4, 0, 3, 2, 1] + - [5, 4, 0, 1, 3, 2] + - [5, 4, 0, 1, 2, 3] + - [5, 4, 0, 2, 1, 3] + - [5, 4, 0, 2, 3, 1] + - [5, 0, 2, 3, 4, 1] + - [5, 0, 2, 3, 1, 4] + - [5, 0, 2, 4, 3, 1] + - [5, 0, 2, 4, 1, 3] + - [5, 0, 2, 1, 4, 3] + - [5, 0, 2, 1, 3, 4] + - [5, 0, 3, 2, 4, 1] + - [5, 0, 3, 2, 1, 4] + - [5, 0, 3, 4, 2, 1] + - [5, 0, 3, 4, 1, 2] + - [5, 0, 3, 1, 4, 2] + - [5, 0, 3, 1, 2, 4] + - [5, 0, 4, 3, 2, 1] + - [5, 0, 4, 3, 1, 2] + - [5, 0, 4, 2, 3, 1] + - [5, 0, 4, 2, 1, 3] + - [5, 0, 4, 1, 2, 3] + - [5, 0, 4, 1, 3, 2] + - [5, 0, 1, 3, 4, 2] + - [5, 0, 1, 3, 2, 4] + - [5, 0, 1, 4, 3, 2] + - [5, 0, 1, 4, 2, 3] + - [5, 0, 1, 2, 4, 3] + - [5, 0, 1, 2, 3, 4] +... diff --git a/test/02_permutation/permutation_cpu_impl_test.cpp b/test/02_permutation/permutation_cpu_impl_test.cpp index 05724a8a..67974f1d 100644 --- a/test/02_permutation/permutation_cpu_impl_test.cpp +++ b/test/02_permutation/permutation_cpu_impl_test.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,11 +26,11 @@ #include #include "data_types.hpp" +#include "hiptensor_options.hpp" #include "logger.hpp" #include "permutation/permutation_cpu_reference.hpp" #include "permutation_test.hpp" #include "utils.hpp" -#include "llvm/hiptensor_options.hpp" template auto permuteWithCpu(hipDataType typeA, hipDataType typeB, hipDataType typeCompute) diff --git a/test/02_permutation/permutation_test.cpp b/test/02_permutation/permutation_test.cpp index e5c72141..2197b1d5 100644 --- a/test/02_permutation/permutation_test.cpp +++ b/test/02_permutation/permutation_test.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,15 +26,16 @@ #include #include "data_types.hpp" +#include "hiptensor_options.hpp" #include "logger.hpp" #include "permutation/permutation_cpu_reference.hpp" #include "permutation_test.hpp" #include "utils.hpp" -#include "llvm/hiptensor_options.hpp" namespace hiptensor { - /*static*/ std::stringstream PermutationTest::sAPILogBuff = std::stringstream(); + /*static*/ bool PermutationTest::mHeaderPrinted = false; + /*static*/ std::stringstream PermutationTest::sAPILogBuff = std::stringstream(); static void logMessage(int32_t logLevel, const char* funcName /*=""*/, const char* msg /*=""*/) { @@ -72,6 +73,80 @@ namespace hiptensor mRunFlag = true; mValidationResult = false; mMaxRelativeError = 0.0; + + mElapsedTimeMs = mTotalGFlops = mMeasuredTFlopsPerSec = mTotalBytes = 0.0; + } + + std::ostream& PermutationTest::printHeader(std::ostream& stream /* = std::cout */) const + { + return stream << "TypeIn, TypeCompute, " << "Operators , LogLevel, " + << "Lengths, PermutedOrder, " << "Alpha, elapsedMs, " + << "Problem Size(GFlops), " << "TFlops/s, " << "TotalBytes, " << "Result" + << std::endl; + } + + std::ostream& PermutationTest::printKernel(std::ostream& stream) const + { + auto param = Base::GetParam(); + auto testType = std::get<0>(param); + auto logLevel = std::get<1>(param); + auto lengths = std::get<2>(param); + auto permutedDims = std::get<3>(param); + auto alpha = std::get<4>(param); + auto operators = std::get<5>(param); + + stream << hipTypeToString(testType[0]) << ", " + << computeTypeToString(convertToComputeType(testType[1])) << ", " + << opTypeToString(operators[0]) << ", " << opTypeToString(operators[1]) << ", " + << logLevelToString(logLevel) << ", ["; + + for(int i = 0; i < lengths.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << lengths[i]; + } + stream << "], ["; + + if(!permutedDims.empty()) + { + for(int i = 0; i < permutedDims.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << permutedDims[i]; + } + } + stream << "], " << alpha << ", "; + + if(!mRunFlag) + { + stream << "n/a" << ", " << "n/a" << ", " << "n/a" << ", " << "n/a" << ", " << "SKIPPED" + << std::endl; + } + else + { + + stream << mElapsedTimeMs << ", " << mTotalGFlops << ", " << mMeasuredTFlopsPerSec + << ", " << mTotalBytes << ", "; + + auto& testOptions = HiptensorOptions::instance(); + + if(testOptions->performValidation()) + { + stream << ((bool)mValidationResult ? "PASSED" : "FAILED") << std::endl; + } + else + { + stream << "BENCH" << std::endl; + } + } + + return stream; } PermutationResource* PermutationTest::getResource() const @@ -85,7 +160,7 @@ namespace hiptensor sAPILogBuff.str(std::string()); auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto logLevel = std::get<1>(param); auto lengths = std::get<2>(param); auto permutedDims = std::get<3>(param); @@ -99,8 +174,8 @@ namespace hiptensor auto op = operators[0]; EXPECT_TRUE((op == HIPTENSOR_OP_IDENTITY) || (op == HIPTENSOR_OP_SQRT)); - EXPECT_EQ(testType.size(), 2); // HIP_R_16F or HIP_R_32F - auto abDataType = testType[0]; + EXPECT_EQ(dataTypes.size(), 2); // HIP_R_16F or HIP_R_32F + auto abDataType = dataTypes[0]; EXPECT_TRUE((abDataType == HIP_R_16F) || (abDataType == HIP_R_32F)); mRunFlag &= checkDevice(abDataType); @@ -120,16 +195,24 @@ namespace hiptensor void PermutationTest::reportResults(std::ostream& stream, hipDataType dataType, + bool omitHeader, bool omitSkipped, bool omitFailed, bool omitPassed) const { + if(!omitHeader) + { + printHeader(stream); + } + // Conditionally print outputs if((mRunFlag || !omitSkipped) && (mValidationResult || !omitFailed) && (!mValidationResult || !omitPassed)) { stream << PermutationTest::sAPILogBuff.str(); + printKernel(stream); + if(mPrintElements) { auto resource = getResource(); @@ -168,18 +251,18 @@ namespace hiptensor void PermutationTest::RunKernel() { auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto logLevel = std::get<1>(param); auto lengths = std::get<2>(param); auto permutedDims = std::get<3>(param); auto alpha = std::get<4>(param); auto operators = std::get<5>(param); - auto abDataType = testType[0]; - auto computeDataType = testType[1]; + auto abDataType = dataTypes[0]; + auto computeDataType = dataTypes[1]; - auto Aop = operators[0]; - auto Bop = operators[1]; + auto Aop = operators[0]; + auto Bop = operators[1]; if(!mRunFlag) { @@ -193,8 +276,8 @@ namespace hiptensor B_{w, h, c, n} = 1.0 * \textsl{IDENTITY}(A_{c, n, h, w}) **********************/ - int nDim = lengths.size(); - int arrDim[] = {'n', 'c', 'w', 'h','d','m'}; + int nDim = lengths.size(); + int arrDim[] = {'n', 'c', 'w', 'h', 'd', 'm'}; std::vector modeA(arrDim, arrDim + nDim); std::vector modeB; @@ -224,22 +307,12 @@ namespace hiptensor CHECK_HIPTENSOR_ERROR(hiptensorCreate(&handle)); hiptensorTensorDescriptor_t descA; - CHECK_HIPTENSOR_ERROR(hiptensorInitTensorDescriptor(handle, - &descA, - nmodeA, - extentA.data(), - NULL /* stride */, - abDataType, - Aop)); + CHECK_HIPTENSOR_ERROR(hiptensorInitTensorDescriptor( + handle, &descA, nmodeA, extentA.data(), NULL /* stride */, abDataType, Aop)); hiptensorTensorDescriptor_t descB; - CHECK_HIPTENSOR_ERROR(hiptensorInitTensorDescriptor(handle, - &descB, - nmodeB, - extentB.data(), - NULL /* stride */, - abDataType, - Bop)); + CHECK_HIPTENSOR_ERROR(hiptensorInitTensorDescriptor( + handle, &descB, nmodeB, extentB.data(), NULL /* stride */, abDataType, Bop)); float alphaValue{}; if(computeDataType == HIP_R_16F) @@ -250,6 +323,12 @@ namespace hiptensor { *(reinterpret_cast(&alphaValue)) = static_cast(alpha); } + + hipEvent_t startEvent, stopEvent; + CHECK_HIP_ERROR(hipEventCreate(&startEvent)); + CHECK_HIP_ERROR(hipEventCreate(&stopEvent)); + CHECK_HIP_ERROR(hipEventRecord(startEvent)); + CHECK_HIPTENSOR_ERROR(hiptensorPermutation(handle, &alphaValue, resource->deviceA().get(), @@ -260,52 +339,88 @@ namespace hiptensor modeB.data(), computeDataType, 0 /* stream */)); + + CHECK_HIP_ERROR(hipEventRecord(stopEvent)); + CHECK_HIP_ERROR(hipEventSynchronize(stopEvent)) + + auto timeMs = 0.0f; + CHECK_HIP_ERROR(hipEventElapsedTime(&timeMs, startEvent, stopEvent)); + + size_t sizeA = std::accumulate(extentA.begin(), + extentA.end(), + hipDataTypeSize(abDataType), + std::multiplies()); + + size_t sizeB = std::accumulate(extentB.begin(), + extentB.end(), + hipDataTypeSize(abDataType), + std::multiplies()); + + mElapsedTimeMs = float64_t(timeMs); + mTotalGFlops = 2.0 * ((sizeA * sizeB) / hipDataTypeSize(abDataType)); + mMeasuredTFlopsPerSec = mTotalGFlops / mElapsedTimeMs; + + mTotalBytes = sizeA + sizeB; + mTotalBytes /= (1e9 * mElapsedTimeMs); + + CHECK_HIP_ERROR(hipEventDestroy(startEvent)); + CHECK_HIP_ERROR(hipEventDestroy(stopEvent)); + resource->copyBToHost(); - if(abDataType == HIP_R_32F) - { - CHECK_HIPTENSOR_ERROR(hiptensorPermutationReference(handle, - &alphaValue, - (const float*)resource->hostA().get(), - &descA, - modeA.data(), - (float*)resource->hostReference().get(), - &descB, - modeB.data(), - computeDataType, - 0 /* stream */)); - - resource->copyReferenceToDevice(); - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel((float*)resource->deviceB().get(), - (float*)resource->deviceReference().get(), - resource->getCurrentMatrixElement(), - convertToComputeType(computeDataType)); - } - else if(abDataType == HIP_R_16F) + auto& testOptions = HiptensorOptions::instance(); + + if(testOptions->performValidation()) { - CHECK_HIPTENSOR_ERROR(hiptensorPermutationReference(handle, - &alphaValue, - (const _Float16*)resource->hostA().get(), - &descA, - modeA.data(), - (_Float16*)resource->hostReference().get(), - &descB, - modeB.data(), - computeDataType, - 0 /* stream */)); - - resource->copyReferenceToDevice(); - - std::tie(mValidationResult, mMaxRelativeError) = compareEqualLaunchKernel<_Float16>( - (_Float16*)resource->deviceB().get(), - (_Float16*)resource->deviceReference().get(), - resource->getCurrentMatrixElement(), - convertToComputeType(computeDataType)); - } - } + resource->copyBToHost(); - EXPECT_TRUE(mValidationResult) << "Max relative error: " << mMaxRelativeError; + if(abDataType == HIP_R_32F) + { + CHECK_HIPTENSOR_ERROR( + hiptensorPermutationReference(handle, + &alphaValue, + (const float*)resource->hostA().get(), + &descA, + modeA.data(), + (float*)resource->hostReference().get(), + &descB, + modeB.data(), + computeDataType, + 0 /* stream */)); + + resource->copyReferenceToDevice(); + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel((float*)resource->deviceB().get(), + (float*)resource->deviceReference().get(), + resource->getCurrentMatrixElement(), + convertToComputeType(computeDataType)); + } + else if(abDataType == HIP_R_16F) + { + CHECK_HIPTENSOR_ERROR( + hiptensorPermutationReference(handle, + &alphaValue, + (const _Float16*)resource->hostA().get(), + &descA, + modeA.data(), + (_Float16*)resource->hostReference().get(), + &descB, + modeB.data(), + computeDataType, + 0 /* stream */)); + + resource->copyReferenceToDevice(); + + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel<_Float16>( + (_Float16*)resource->deviceB().get(), + (_Float16*)resource->deviceReference().get(), + resource->getCurrentMatrixElement(), + convertToComputeType(computeDataType)); + } + EXPECT_TRUE(mValidationResult) << "Max relative error: " << mMaxRelativeError; + } // if (testOptions->performValidation()) + } using Options = hiptensor::HiptensorOptions; auto& loggingOptions = Options::instance(); @@ -314,6 +429,7 @@ namespace hiptensor { reportResults(std::cout, abDataType, + mHeaderPrinted, loggingOptions->omitSkipped(), loggingOptions->omitFailed(), loggingOptions->omitPassed()); @@ -323,10 +439,17 @@ namespace hiptensor { reportResults(loggingOptions->ostream().fstream(), abDataType, + mHeaderPrinted, loggingOptions->omitSkipped(), loggingOptions->omitFailed(), loggingOptions->omitPassed()); } + + // Print the header only once + if(!mHeaderPrinted) + { + mHeaderPrinted = true; + } } void PermutationTest::TearDown() {} diff --git a/test/02_permutation/permutation_test.hpp b/test/02_permutation/permutation_test.hpp index 25b79339..bf47f72e 100644 --- a/test/02_permutation/permutation_test.hpp +++ b/test/02_permutation/permutation_test.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ #include +#include "common.hpp" #include "permutation_resource.hpp" #include "permutation_test_params.hpp" @@ -40,7 +41,7 @@ namespace hiptensor { static void logMessage(int32_t logLevel, const char* funcName = "", const char* msg = ""); - using PermutationTestParams_t = std::tuple -#include "llvm/hiptensor_options.hpp" +#include "hiptensor_options.hpp" #include "llvm/yaml_parser.hpp" #ifdef HIPTENSOR_TEST_YAML_INCLUDE diff --git a/test/02_permutation/permutation_test_params.hpp b/test/02_permutation/permutation_test_params.hpp index a4de81d9..97609bb3 100644 --- a/test/02_permutation/permutation_test_params.hpp +++ b/test/02_permutation/permutation_test_params.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,7 +40,8 @@ namespace hiptensor struct PermutationTestParams { - using TestTypesT = std::vector; + using DataTypesT = std::vector; + using LogLevelT = hiptensorLogLevel_t; using LengthsT = std::vector; using AlphaT = double; @@ -48,7 +49,7 @@ namespace hiptensor using OperatorT = std::vector; public: - std::vector& dataTypes() + std::vector& dataTypes() { return mDataTypes; } @@ -90,7 +91,7 @@ namespace hiptensor private: //Data types of input and output tensors - std::vector mDataTypes; + std::vector mDataTypes; LogLevelT mLogLevelMask; std::vector mProblemLengths; std::vector mAlphas; diff --git a/test/03_reduction/CMakeLists.txt b/test/03_reduction/CMakeLists.txt index b2c0562b..cb51e086 100644 --- a/test/03_reduction/CMakeLists.txt +++ b/test/03_reduction/CMakeLists.txt @@ -2,7 +2,7 @@ # # MIT License # - # Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + # Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,44 +23,43 @@ # THE SOFTWARE. # ############################################################################### -set(ReductionCommonSources ${HIPTENSOR_COMMON_TEST_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/reduction_resource.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/reduction_test.cpp) + set(ReductionCommonSources ${HIPTENSOR_COMMON_TEST_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/reduction_resource.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/reduction_test.cpp) # tests set (ReductionTestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/reduction_cpu_impl_test.cpp - ) +${CMAKE_CURRENT_SOURCE_DIR}/reduction_cpu_impl_test.cpp +) set (ReductionConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/reduction_params.yaml) add_hiptensor_test(reduction_cpu_impl_test ${ReductionConfig} ${ReductionTestSources}) set (ReductionRank1TestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank1_reduction_test.cpp) -set (ReductionRank1TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank1_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank1_reduction_test.cpp) +set (ReductionRank1TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank1_test_params.yaml) add_hiptensor_test(rank1_reduction_test ${ReductionRank1TestConfig} ${ReductionRank1TestSources}) set (ReductionRank2TestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank2_reduction_test.cpp) -set (ReductionRank2TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank2_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank2_reduction_test.cpp) +set (ReductionRank2TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank2_test_params.yaml) add_hiptensor_test(rank2_reduction_test ${ReductionRank2TestConfig} ${ReductionRank2TestSources}) set (ReductionRank3TestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank3_reduction_test.cpp) -set (ReductionRank3TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank3_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank3_reduction_test.cpp) +set (ReductionRank3TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank3_test_params.yaml) add_hiptensor_test(rank3_reduction_test ${ReductionRank3TestConfig} ${ReductionRank3TestSources}) set (ReductionRank4TestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank4_reduction_test.cpp) -set (ReductionRank4TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank4_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank4_reduction_test.cpp) +set (ReductionRank4TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank4_test_params.yaml) add_hiptensor_test(rank4_reduction_test ${ReductionRank4TestConfig} ${ReductionRank4TestSources}) set (ReductionRank5TestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank5_reduction_test.cpp) -set (ReductionRank5TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank5_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank5_reduction_test.cpp) +set (ReductionRank5TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank5_test_params.yaml) add_hiptensor_test(rank5_reduction_test ${ReductionRank5TestConfig} ${ReductionRank5TestSources}) set (ReductionRank6TestSources ${ReductionCommonSources} - ${CMAKE_CURRENT_SOURCE_DIR}/rank6_reduction_test.cpp) -set (ReductionRank6TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/rank6_test_params.yaml) + ${CMAKE_CURRENT_SOURCE_DIR}/rank6_reduction_test.cpp) +set (ReductionRank6TestConfig ${CMAKE_CURRENT_SOURCE_DIR}/configs/validation/rank6_test_params.yaml) add_hiptensor_test(rank6_reduction_test ${ReductionRank6TestConfig} ${ReductionRank6TestSources}) - diff --git a/test/03_reduction/configs/rank1_test_params.yaml b/test/03_reduction/configs/bench/rank1_test_params.yaml similarity index 100% rename from test/03_reduction/configs/rank1_test_params.yaml rename to test/03_reduction/configs/bench/rank1_test_params.yaml diff --git a/test/03_reduction/configs/rank2_test_params.yaml b/test/03_reduction/configs/bench/rank2_test_params.yaml similarity index 100% rename from test/03_reduction/configs/rank2_test_params.yaml rename to test/03_reduction/configs/bench/rank2_test_params.yaml diff --git a/test/03_reduction/configs/rank3_test_params.yaml b/test/03_reduction/configs/bench/rank3_test_params.yaml similarity index 100% rename from test/03_reduction/configs/rank3_test_params.yaml rename to test/03_reduction/configs/bench/rank3_test_params.yaml diff --git a/test/03_reduction/configs/rank4_test_params.yaml b/test/03_reduction/configs/bench/rank4_test_params.yaml similarity index 100% rename from test/03_reduction/configs/rank4_test_params.yaml rename to test/03_reduction/configs/bench/rank4_test_params.yaml diff --git a/test/03_reduction/configs/rank5_test_params.yaml b/test/03_reduction/configs/bench/rank5_test_params.yaml similarity index 100% rename from test/03_reduction/configs/rank5_test_params.yaml rename to test/03_reduction/configs/bench/rank5_test_params.yaml diff --git a/test/03_reduction/configs/rank6_test_params.yaml b/test/03_reduction/configs/bench/rank6_test_params.yaml similarity index 100% rename from test/03_reduction/configs/rank6_test_params.yaml rename to test/03_reduction/configs/bench/rank6_test_params.yaml diff --git a/test/03_reduction/configs/extended/rank1_test_params.yaml b/test/03_reduction/configs/extended/rank1_test_params.yaml new file mode 100644 index 00000000..899fe99a --- /dev/null +++ b/test/03_reduction/configs/extended/rank1_test_params.yaml @@ -0,0 +1,25 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13 ] + - [ 6 ] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [] +... diff --git a/test/03_reduction/configs/extended/rank2_test_params.yaml b/test/03_reduction/configs/extended/rank2_test_params.yaml new file mode 100644 index 00000000..a790cbfa --- /dev/null +++ b/test/03_reduction/configs/extended/rank2_test_params.yaml @@ -0,0 +1,27 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13, 11] + - [ 6, 4] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [0] + - [1] + - [] +... diff --git a/test/03_reduction/configs/extended/rank3_test_params.yaml b/test/03_reduction/configs/extended/rank3_test_params.yaml new file mode 100644 index 00000000..19fb42df --- /dev/null +++ b/test/03_reduction/configs/extended/rank3_test_params.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 11, 8, 5] + - [ 5, 6, 4] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [0, 1] + - [0, 2] + - [1, 2] + - [0] + - [1] + - [2] + - [] + - [2, 1] +... diff --git a/test/03_reduction/configs/extended/rank4_test_params.yaml b/test/03_reduction/configs/extended/rank4_test_params.yaml new file mode 100644 index 00000000..f85a612f --- /dev/null +++ b/test/03_reduction/configs/extended/rank4_test_params.yaml @@ -0,0 +1,41 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13, 11, 8, 5] + - [ 3, 5, 6, 4] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [1, 2, 3] + - [0, 2, 3] + - [0, 1, 3] + - [0, 1, 2] + - [0, 1] + - [0, 2] + - [0, 3] + - [1, 2] + - [1, 3] + - [2, 3] + - [0] + - [1] + - [2] + - [3] + - [] + - [2, 1, 3] + - [2, 3, 1] +... diff --git a/test/03_reduction/configs/extended/rank5_test_params.yaml b/test/03_reduction/configs/extended/rank5_test_params.yaml new file mode 100644 index 00000000..d6c92b0b --- /dev/null +++ b/test/03_reduction/configs/extended/rank5_test_params.yaml @@ -0,0 +1,58 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13, 11, 8, 5, 4] + - [ 3, 5, 6, 4, 5] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [1, 2, 3, 4] + - [0, 2, 3, 4] + - [0, 1, 3, 4] + - [0, 1, 2, 4] + - [0, 1, 2, 3] + - [0, 1, 2] + - [0, 1, 3] + - [0, 1, 4] + - [0, 2, 3] + - [0, 2, 4] + - [0, 3, 4] + - [1, 2, 3] + - [1, 2, 4] + - [1, 3, 4] + - [2, 3, 4] + - [0, 1] + - [0, 2] + - [0, 3] + - [0, 4] + - [1, 2] + - [1, 3] + - [1, 4] + - [2, 3] + - [2, 4] + - [3, 4] + - [0] + - [1] + - [2] + - [3] + - [4] + - [] + - [2, 1, 4, 3] + - [3, 1, 4, 2] + - [4, 3, 1, 2] +... diff --git a/test/03_reduction/configs/extended/rank6_test_params.yaml b/test/03_reduction/configs/extended/rank6_test_params.yaml new file mode 100644 index 00000000..1e5a54a9 --- /dev/null +++ b/test/03_reduction/configs/extended/rank6_test_params.yaml @@ -0,0 +1,90 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 7, 2, 8, 5, 4, 3] + - [ 3, 5, 6, 4, 5, 3] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [0, 1, 2, 3, 4] + - [0, 1, 2, 3, 5] + - [0, 1, 2, 4, 5] + - [0, 1, 3, 4, 5] + - [0, 2, 3, 4, 5] + - [1, 2, 3, 4, 5] + - [0, 1, 2, 3] + - [0, 1, 2, 4] + - [0, 1, 2, 5] + - [0, 1, 3, 4] + - [0, 1, 3, 5] + - [0, 1, 4, 5] + - [0, 2, 3, 4] + - [0, 2, 3, 5] + - [0, 2, 4, 5] + - [0, 3, 4, 5] + - [1, 2, 3, 4] + - [1, 2, 3, 5] + - [1, 2, 4, 5] + - [1, 3, 4, 5] + - [2, 3, 4, 5] + - [0, 1, 2] + - [0, 1, 3] + - [0, 1, 4] + - [0, 1, 5] + - [0, 2, 3] + - [0, 2, 4] + - [0, 2, 5] + - [0, 3, 4] + - [0, 3, 5] + - [0, 4, 5] + - [1, 2, 3] + - [1, 2, 4] + - [1, 2, 5] + - [1, 3, 4] + - [1, 3, 5] + - [1, 4, 5] + - [2, 3, 4] + - [2, 3, 5] + - [2, 4, 5] + - [3, 4, 5] + - [0, 1] + - [0, 2] + - [0, 3] + - [0, 4] + - [0, 5] + - [1, 2] + - [1, 3] + - [1, 4] + - [1, 5] + - [2, 3] + - [2, 4] + - [2, 5] + - [3, 4] + - [3, 5] + - [4, 5] + - [0] + - [1] + - [2] + - [3] + - [4] + - [5] + - [] + - [1, 0, 5, 3, 2] + - [1, 3, 5, 0, 2] + - [2, 4, 5, 0, 3] +... diff --git a/test/03_reduction/configs/validation/rank1_test_params.yaml b/test/03_reduction/configs/validation/rank1_test_params.yaml new file mode 100644 index 00000000..899fe99a --- /dev/null +++ b/test/03_reduction/configs/validation/rank1_test_params.yaml @@ -0,0 +1,25 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13 ] + - [ 6 ] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [] +... diff --git a/test/03_reduction/configs/validation/rank2_test_params.yaml b/test/03_reduction/configs/validation/rank2_test_params.yaml new file mode 100644 index 00000000..a790cbfa --- /dev/null +++ b/test/03_reduction/configs/validation/rank2_test_params.yaml @@ -0,0 +1,27 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13, 11] + - [ 6, 4] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [0] + - [1] + - [] +... diff --git a/test/03_reduction/configs/validation/rank3_test_params.yaml b/test/03_reduction/configs/validation/rank3_test_params.yaml new file mode 100644 index 00000000..19fb42df --- /dev/null +++ b/test/03_reduction/configs/validation/rank3_test_params.yaml @@ -0,0 +1,32 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 11, 8, 5] + - [ 5, 6, 4] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [0, 1] + - [0, 2] + - [1, 2] + - [0] + - [1] + - [2] + - [] + - [2, 1] +... diff --git a/test/03_reduction/configs/validation/rank4_test_params.yaml b/test/03_reduction/configs/validation/rank4_test_params.yaml new file mode 100644 index 00000000..f85a612f --- /dev/null +++ b/test/03_reduction/configs/validation/rank4_test_params.yaml @@ -0,0 +1,41 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13, 11, 8, 5] + - [ 3, 5, 6, 4] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [1, 2, 3] + - [0, 2, 3] + - [0, 1, 3] + - [0, 1, 2] + - [0, 1] + - [0, 2] + - [0, 3] + - [1, 2] + - [1, 3] + - [2, 3] + - [0] + - [1] + - [2] + - [3] + - [] + - [2, 1, 3] + - [2, 3, 1] +... diff --git a/test/03_reduction/configs/validation/rank5_test_params.yaml b/test/03_reduction/configs/validation/rank5_test_params.yaml new file mode 100644 index 00000000..d6c92b0b --- /dev/null +++ b/test/03_reduction/configs/validation/rank5_test_params.yaml @@ -0,0 +1,58 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 13, 11, 8, 5, 4] + - [ 3, 5, 6, 4, 5] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [1, 2, 3, 4] + - [0, 2, 3, 4] + - [0, 1, 3, 4] + - [0, 1, 2, 4] + - [0, 1, 2, 3] + - [0, 1, 2] + - [0, 1, 3] + - [0, 1, 4] + - [0, 2, 3] + - [0, 2, 4] + - [0, 3, 4] + - [1, 2, 3] + - [1, 2, 4] + - [1, 3, 4] + - [2, 3, 4] + - [0, 1] + - [0, 2] + - [0, 3] + - [0, 4] + - [1, 2] + - [1, 3] + - [1, 4] + - [2, 3] + - [2, 4] + - [3, 4] + - [0] + - [1] + - [2] + - [3] + - [4] + - [] + - [2, 1, 4, 3] + - [3, 1, 4, 2] + - [4, 3, 1, 2] +... diff --git a/test/03_reduction/configs/validation/rank6_test_params.yaml b/test/03_reduction/configs/validation/rank6_test_params.yaml new file mode 100644 index 00000000..1e5a54a9 --- /dev/null +++ b/test/03_reduction/configs/validation/rank6_test_params.yaml @@ -0,0 +1,90 @@ +--- +Log Level: [ HIPTENSOR_LOG_LEVEL_ERROR, HIPTENSOR_LOG_LEVEL_PERF_TRACE ] +Tensor Data Types: + - [ HIP_R_16F, HIP_R_16F] + - [ HIP_R_16F, HIP_R_32F] + - [ HIP_R_16BF, HIP_R_16BF] + - [ HIP_R_16BF, HIP_R_32F] + - [ HIP_R_64F, HIP_R_64F] + - [ HIP_R_32F, HIP_R_32F] +Alphas: + - 2.3 +Betas: + - 0.0 + # - 2.3 +Lengths: + - [ 7, 2, 8, 5, 4, 3] + - [ 3, 5, 6, 4, 5, 3] +Operators: + - HIPTENSOR_OP_ADD + - HIPTENSOR_OP_MUL + - HIPTENSOR_OP_MIN + - HIPTENSOR_OP_MAX +Output Dims: + - [0, 1, 2, 3, 4] + - [0, 1, 2, 3, 5] + - [0, 1, 2, 4, 5] + - [0, 1, 3, 4, 5] + - [0, 2, 3, 4, 5] + - [1, 2, 3, 4, 5] + - [0, 1, 2, 3] + - [0, 1, 2, 4] + - [0, 1, 2, 5] + - [0, 1, 3, 4] + - [0, 1, 3, 5] + - [0, 1, 4, 5] + - [0, 2, 3, 4] + - [0, 2, 3, 5] + - [0, 2, 4, 5] + - [0, 3, 4, 5] + - [1, 2, 3, 4] + - [1, 2, 3, 5] + - [1, 2, 4, 5] + - [1, 3, 4, 5] + - [2, 3, 4, 5] + - [0, 1, 2] + - [0, 1, 3] + - [0, 1, 4] + - [0, 1, 5] + - [0, 2, 3] + - [0, 2, 4] + - [0, 2, 5] + - [0, 3, 4] + - [0, 3, 5] + - [0, 4, 5] + - [1, 2, 3] + - [1, 2, 4] + - [1, 2, 5] + - [1, 3, 4] + - [1, 3, 5] + - [1, 4, 5] + - [2, 3, 4] + - [2, 3, 5] + - [2, 4, 5] + - [3, 4, 5] + - [0, 1] + - [0, 2] + - [0, 3] + - [0, 4] + - [0, 5] + - [1, 2] + - [1, 3] + - [1, 4] + - [1, 5] + - [2, 3] + - [2, 4] + - [2, 5] + - [3, 4] + - [3, 5] + - [4, 5] + - [0] + - [1] + - [2] + - [3] + - [4] + - [5] + - [] + - [1, 0, 5, 3, 2] + - [1, 3, 5, 0, 2] + - [2, 4, 5, 0, 3] +... diff --git a/test/03_reduction/reduction_cpu_impl_test.cpp b/test/03_reduction/reduction_cpu_impl_test.cpp index 90308e5e..bbba234e 100644 --- a/test/03_reduction/reduction_cpu_impl_test.cpp +++ b/test/03_reduction/reduction_cpu_impl_test.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,11 +26,11 @@ #include #include "data_types.hpp" +#include "hiptensor_options.hpp" #include "logger.hpp" #include "reduction/reduction_cpu_reference.hpp" #include "reduction_test.hpp" #include "utils.hpp" -#include "llvm/hiptensor_options.hpp" template auto reduceWithCpu(hipDataType typeA, hipDataType typeC, hiptensorComputeType_t typeCompute) diff --git a/test/03_reduction/reduction_test.cpp b/test/03_reduction/reduction_test.cpp index 0bceaac6..4052cef8 100644 --- a/test/03_reduction/reduction_test.cpp +++ b/test/03_reduction/reduction_test.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,12 +26,12 @@ #include #include "data_types.hpp" +#include "hiptensor_options.hpp" #include "logger.hpp" #include "reduction/reduction_cpu_reference.hpp" #include "reduction_test.hpp" #include "util.hpp" #include "utils.hpp" -#include "llvm/hiptensor_options.hpp" namespace { @@ -62,7 +62,8 @@ namespace } namespace hiptensor { - /*static*/ std::stringstream ReductionTest::sAPILogBuff = std::stringstream(); + /*static*/ bool ReductionTest::mHeaderPrinted = false; + /*static*/ std::stringstream ReductionTest::sAPILogBuff = std::stringstream(); static void logMessage(int32_t logLevel, const char* funcName /*=""*/, const char* msg /*=""*/) { @@ -101,6 +102,8 @@ namespace hiptensor mRunFlag = true; mValidationResult = false; mMaxRelativeError = 0.0; + + mElapsedTimeMs = mTotalGFlops = mMeasuredTFlopsPerSec = mTotalBytes = 0.0; } ReductionResource* ReductionTest::getResource() const @@ -108,13 +111,84 @@ namespace hiptensor return DataStorage::instance().get(); } + std::ostream& ReductionTest::printHeader(std::ostream& stream /* = std::cout */) const + { + return stream << "TypeIn, TypeCompute, " << "Operator, LogLevel, " << "Lengths, ReOrder, " + << "Alpha, Beta, elapsedMs, " << "Problem Size(GFlops), " << "TFlops/s, " + << "TotalBytes, " << "Result" << std::endl; + } + + std::ostream& ReductionTest::printKernel(std::ostream& stream) const + { + auto param = Base::GetParam(); + auto testType = std::get<0>(param); + auto logLevel = std::get<1>(param); + auto lengths = std::get<2>(param); + auto outputDims = std::get<3>(param); + auto alpha = std::get<4>(param); + auto beta = std::get<5>(param); + auto op = std::get<6>(param); + + stream << hipTypeToString(testType[0]) << ", " + << computeTypeToString(convertToComputeType(testType[1])) << ", " + << opTypeToString(op) << ", " << logLevelToString(logLevel) << ", ["; + + for(int i = 0; i < lengths.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << lengths[i]; + } + stream << "], ["; + + if(!outputDims.empty()) + { + for(int i = 0; i < outputDims.size(); i++) + { + if(i != 0) + { + stream << ", "; + } + stream << outputDims[i]; + } + } + stream << "], " << alpha << ", " << beta << ", "; + + if(!mRunFlag) + { + stream << "n/a" << ", " << "n/a" << ", " << "n/a" << ", " << "n/a" << ", " << "SKIPPED" + << std::endl; + } + else + { + + stream << mElapsedTimeMs << ", " << mTotalGFlops << ", " << mMeasuredTFlopsPerSec + << ", " << mTotalBytes << ", "; + + auto& testOptions = HiptensorOptions::instance(); + + if(testOptions->performValidation()) + { + stream << ((bool)mValidationResult ? "PASSED" : "FAILED") << std::endl; + } + else + { + stream << "BENCH" << std::endl; + } + } + + return stream; + } + void ReductionTest::SetUp() { // reset API log buffer sAPILogBuff.str(std::string()); auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto logLevel = std::get<1>(param); auto lengths = std::get<2>(param); auto outputDims = std::get<3>(param); @@ -128,9 +202,9 @@ namespace hiptensor EXPECT_TRUE((op == HIPTENSOR_OP_ADD) || (op == HIPTENSOR_OP_MUL) || (op == HIPTENSOR_OP_MAX) || (op == HIPTENSOR_OP_MIN)); - EXPECT_EQ(testType.size(), 2); // HIP_R_16F or HIP_R_32F - auto acDataType = testType[0]; - auto computeDataType = convertToComputeType(testType[1]); + EXPECT_EQ(dataTypes.size(), 2); // HIP_R_16F or HIP_R_32F + auto acDataType = dataTypes[0]; + auto computeDataType = convertToComputeType(dataTypes[1]); EXPECT_TRUE((acDataType == HIP_R_16F && computeDataType == HIPTENSOR_COMPUTE_16F) || (acDataType == HIP_R_16F && computeDataType == HIPTENSOR_COMPUTE_32F) || (acDataType == HIP_R_16BF && computeDataType == HIPTENSOR_COMPUTE_16BF) @@ -161,29 +235,37 @@ namespace hiptensor void ReductionTest::reportResults(std::ostream& stream, hipDataType dataType, + bool omitHeader, bool omitSkipped, bool omitFailed, bool omitPassed) const { + if(!omitHeader) + { + printHeader(stream); + } + // Conditionally print outputs if((mRunFlag || !omitSkipped) && (mValidationResult || !omitFailed) && (!mValidationResult || !omitPassed)) { stream << ReductionTest::sAPILogBuff.str(); + printKernel(stream); + if(mPrintElements) { auto resource = getResource(); auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto logLevel = std::get<1>(param); auto lengths = std::get<2>(param); auto outputDims = std::get<3>(param); auto alpha = std::get<4>(param); auto beta = std::get<5>(param); auto op = std::get<6>(param); - stream << "Input [type: " << testType << ", lengths: " << lengths + stream << "Input [type: " << dataTypes << ", lengths: " << lengths << ", outputDims: " << outputDims << ", alpha: " << alpha << ", beta: " << beta << ", opReduce: " << op << "]\n"; @@ -218,7 +300,7 @@ namespace hiptensor void ReductionTest::RunKernel() { auto param = Base::GetParam(); - auto testType = std::get<0>(param); + auto dataTypes = std::get<0>(param); auto logLevel = std::get<1>(param); auto lengths = std::get<2>(param); auto outputDims = std::get<3>(param); @@ -226,8 +308,8 @@ namespace hiptensor auto beta = std::get<5>(param); auto opReduce = std::get<6>(param); - auto acDataType = testType[0]; - auto computeDataType = convertToComputeType(testType[1]); + auto acDataType = dataTypes[0]; + auto computeDataType = convertToComputeType(dataTypes[1]); if(!mRunFlag) { @@ -341,6 +423,12 @@ namespace hiptensor double betaValue{}; writeVal(&alphaValue, computeDataType, {computeDataType, alpha}); writeVal(&betaValue, computeDataType, {computeDataType, beta}); + + hipEvent_t startEvent, stopEvent; + CHECK_HIP_ERROR(hipEventCreate(&startEvent)); + CHECK_HIP_ERROR(hipEventCreate(&stopEvent)); + CHECK_HIP_ERROR(hipEventRecord(startEvent)); + CHECK_HIPTENSOR_ERROR(hiptensorReduction(handle, (const void*)&alphaValue, resource->deviceA().get(), @@ -359,94 +447,134 @@ namespace hiptensor worksize, 0 /* stream */)); - resource->copyOutputToHost(); - - CHECK_HIPTENSOR_ERROR(hiptensorReductionReference(&alphaValue, - resource->hostA().get(), - &descA, - modeA.data(), - &betaValue, - resource->hostC().get(), - &descC, - modeC.data(), - resource->hostReference().get(), - &descD, - modeD.data(), - opReduce, - computeDataType, - 0 /* stream */)); - resource->copyReferenceToDevice(); - - if(acDataType == HIP_R_16F) + CHECK_HIP_ERROR(hipEventRecord(stopEvent)); + CHECK_HIP_ERROR(hipEventSynchronize(stopEvent)) + + auto timeMs = 0.0f; + CHECK_HIP_ERROR(hipEventElapsedTime(&timeMs, startEvent, stopEvent)); + + size_t sizeA = std::accumulate(extentA.begin(), + extentA.end(), + hipDataTypeSize(acDataType), + std::multiplies()); + + size_t sizeCD = std::accumulate(extentC.begin(), + extentC.end(), + hipDataTypeSize(acDataType), + std::multiplies()); + + mElapsedTimeMs = float64_t(timeMs); + mTotalGFlops = sizeA / hipDataTypeSize(acDataType); + mMeasuredTFlopsPerSec = mTotalGFlops / mElapsedTimeMs; + + mTotalBytes = sizeA + sizeCD; + mTotalBytes += (betaValue != 0.0) ? sizeCD : 0; + mTotalBytes /= (1e9 * mElapsedTimeMs); + + CHECK_HIP_ERROR(hipEventDestroy(startEvent)); + CHECK_HIP_ERROR(hipEventDestroy(stopEvent)); + + auto& testOptions = HiptensorOptions::instance(); + + if(testOptions->performValidation()) + { - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel( - (float16_t*)resource->deviceD().get(), - (float16_t*)resource->deviceReference().get(), - resource->getCurrentOutputElementCount(), - computeDataType); - } - else if(acDataType == HIP_R_16BF) + resource->copyOutputToHost(); + + CHECK_HIPTENSOR_ERROR(hiptensorReductionReference(&alphaValue, + resource->hostA().get(), + &descA, + modeA.data(), + &betaValue, + resource->hostC().get(), + &descC, + modeC.data(), + resource->hostReference().get(), + &descD, + modeD.data(), + opReduce, + computeDataType, + 0 /* stream */)); + resource->copyReferenceToDevice(); + + if(acDataType == HIP_R_16F) + { + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel( + (float16_t*)resource->deviceD().get(), + (float16_t*)resource->deviceReference().get(), + resource->getCurrentOutputElementCount(), + computeDataType); + } + else if(acDataType == HIP_R_16BF) + { + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel( + (bfloat16_t*)resource->deviceD().get(), + (bfloat16_t*)resource->deviceReference().get(), + resource->getCurrentOutputElementCount(), + computeDataType); + } + else if(acDataType == HIP_R_32F) + { + auto reducedSize = resource->getCurrentInputElementCount() + / resource->getCurrentOutputElementCount(); + double tolerance = reducedSize * getEpsilon(computeDataType); + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel( + (float32_t*)resource->deviceD().get(), + (float32_t*)resource->deviceReference().get(), + resource->getCurrentOutputElementCount(), + computeDataType, + tolerance); + } + else if(acDataType == HIP_R_64F) + { + auto reducedSize = resource->getCurrentInputElementCount() + / resource->getCurrentOutputElementCount(); + double tolerance = reducedSize * getEpsilon(computeDataType); + std::tie(mValidationResult, mMaxRelativeError) + = compareEqualLaunchKernel( + (float64_t*)resource->deviceD().get(), + (float64_t*)resource->deviceReference().get(), + resource->getCurrentOutputElementCount(), + computeDataType, + tolerance); + } + + EXPECT_TRUE(mValidationResult) << "Max relative error: " << mMaxRelativeError; + } // if (testOptions->performValidation()) + + using Options = hiptensor::HiptensorOptions; + auto& loggingOptions = Options::instance(); + + if(!loggingOptions->omitCout()) { - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel( - (bfloat16_t*)resource->deviceD().get(), - (bfloat16_t*)resource->deviceReference().get(), - resource->getCurrentOutputElementCount(), - computeDataType); + reportResults(std::cout, + acDataType, + mHeaderPrinted, + loggingOptions->omitSkipped(), + loggingOptions->omitFailed(), + loggingOptions->omitPassed()); } - else if(acDataType == HIP_R_32F) + + if(loggingOptions->ostream().isOpen()) { - auto reducedSize = resource->getCurrentInputElementCount() - / resource->getCurrentOutputElementCount(); - double tolerance = reducedSize * getEpsilon(computeDataType); - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel( - (float32_t*)resource->deviceD().get(), - (float32_t*)resource->deviceReference().get(), - resource->getCurrentOutputElementCount(), - computeDataType, - tolerance); + reportResults(loggingOptions->ostream().fstream(), + acDataType, + mHeaderPrinted, + loggingOptions->omitSkipped(), + loggingOptions->omitFailed(), + loggingOptions->omitPassed()); } - else if(acDataType == HIP_R_64F) + + // Print the header only once + if(!mHeaderPrinted) { - auto reducedSize = resource->getCurrentInputElementCount() - / resource->getCurrentOutputElementCount(); - double tolerance = reducedSize * getEpsilon(computeDataType); - std::tie(mValidationResult, mMaxRelativeError) - = compareEqualLaunchKernel( - (float64_t*)resource->deviceD().get(), - (float64_t*)resource->deviceReference().get(), - resource->getCurrentOutputElementCount(), - computeDataType, - tolerance); + mHeaderPrinted = true; } } - - EXPECT_TRUE(mValidationResult) << "Max relative error: " << mMaxRelativeError; - - using Options = hiptensor::HiptensorOptions; - auto& loggingOptions = Options::instance(); - - if(!loggingOptions->omitCout()) - { - reportResults(std::cout, - acDataType, - loggingOptions->omitSkipped(), - loggingOptions->omitFailed(), - loggingOptions->omitPassed()); - } - - if(loggingOptions->ostream().isOpen()) - { - reportResults(loggingOptions->ostream().fstream(), - acDataType, - loggingOptions->omitSkipped(), - loggingOptions->omitFailed(), - loggingOptions->omitPassed()); - } } - void ReductionTest::TearDown() {} } // namespace hiptensor diff --git a/test/03_reduction/reduction_test.hpp b/test/03_reduction/reduction_test.hpp index ffe0ad90..f7319381 100644 --- a/test/03_reduction/reduction_test.hpp +++ b/test/03_reduction/reduction_test.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ #include +#include "common.hpp" #include "reduction_resource.hpp" #include "reduction_test_params.hpp" @@ -40,7 +41,7 @@ namespace hiptensor { static void logMessage(int32_t logLevel, const char* funcName = "", const char* msg = ""); - using ReductionTestParams_t = std::tuple -#include "llvm/hiptensor_options.hpp" +#include "hiptensor_options.hpp" #include "llvm/yaml_parser.hpp" #ifdef HIPTENSOR_TEST_YAML_INCLUDE diff --git a/test/03_reduction/reduction_test_params.hpp b/test/03_reduction/reduction_test_params.hpp index 6912ee6e..56ef5ba9 100644 --- a/test/03_reduction/reduction_test_params.hpp +++ b/test/03_reduction/reduction_test_params.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,7 +40,8 @@ namespace hiptensor struct ReductionTestParams { - using TestTypesT = std::vector; + using DataTypesT = std::vector; + using LogLevelT = hiptensorLogLevel_t; using LengthsT = std::vector; using AlphaT = double; @@ -49,7 +50,7 @@ namespace hiptensor using OperatorT = hiptensorOperator_t; public: - std::vector& dataTypes() + std::vector& dataTypes() { return mDataTypes; } @@ -97,7 +98,7 @@ namespace hiptensor private: //Data types of input and output tensors - std::vector mDataTypes; + std::vector mDataTypes; LogLevelT mLogLevelMask; std::vector mProblemLengths; std::vector mAlphas; diff --git a/test/common.hpp b/test/common.hpp index 46387b08..155c9cf8 100644 --- a/test/common.hpp +++ b/test/common.hpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,6 +46,7 @@ namespace hiptensor CHECK_HIP_ERROR(hipFree(ptr)); } }; + } // namespace hiptensor #endif // HIPTENSOR_TEST_COMMON_HPP diff --git a/test/hiptensor_gtest_main.cpp b/test/hiptensor_gtest_main.cpp index 2d8f1d45..6674af5e 100644 --- a/test/hiptensor_gtest_main.cpp +++ b/test/hiptensor_gtest_main.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,17 +23,17 @@ * SOFTWARE. * *******************************************************************************/ +#include "hiptensor_options.hpp" #include "utils.hpp" -#include "llvm/hiptensor_options.hpp" #include +#include "llvm/command_line_parser.hpp" + int main(int argc, char** argv) { // Parse hiptensor test options - using Options = hiptensor::HiptensorOptions; - auto& testOptions = Options::instance(); - testOptions->parseOptions(argc, argv); + hiptensor::parseOptions(argc, argv); // Initialize Google Tests testing::InitGoogleTest(&argc, argv); diff --git a/test/llvm/CMakeLists.txt b/test/llvm/CMakeLists.txt index 3b0fc857..7b668674 100644 --- a/test/llvm/CMakeLists.txt +++ b/test/llvm/CMakeLists.txt @@ -2,7 +2,7 @@ # # MIT License # - # Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + # Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -78,7 +78,7 @@ set(HIPTENSOR_LLVM_INCLUDES ${LLVM_INCLUDE_DIRS} # Sources for this static object set(HIPTENSOR_LLVM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/yaml_parser_config.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/hiptensor_options.cpp) + ${CMAKE_CURRENT_SOURCE_DIR}/command_line_parser.cpp) # Create hiptensor_llvm object target # All LLVM resources are private to this object. diff --git a/test/llvm/hiptensor_options.cpp b/test/llvm/command_line_parser.cpp similarity index 64% rename from test/llvm/hiptensor_options.cpp rename to test/llvm/command_line_parser.cpp index 1cfae723..dd370e52 100644 --- a/test/llvm/hiptensor_options.cpp +++ b/test/llvm/command_line_parser.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,10 +24,11 @@ * *******************************************************************************/ +#include #include +#include "command_line_parser.hpp" #include "hiptensor_options.hpp" -#include // Get input/output file names llvm::cl::OptionCategory HiptensorCategory("hipTensor Options", @@ -40,6 +41,25 @@ llvm::cl::opt hiptensorOutputFilename("o", llvm::cl::desc("Specify output filename"), llvm::cl::value_desc("filename"), llvm::cl::cat(HiptensorCategory)); +llvm::cl::opt + hiptensorValidationOption("v", + llvm::cl::desc("Specify whether to perform validation"), + llvm::cl::value_desc("ON/OFF"), + llvm::cl::cat(HiptensorCategory)); +llvm::cl::opt + hiptensorHotRuns("hot_runs", + llvm::cl::desc("Specify number of benchmark runs to include in the timing"), + llvm::cl::value_desc("integer number"), + llvm::cl::init(1), + llvm::cl::cat(HiptensorCategory)); + +llvm::cl::opt hiptensorColdRuns( + "cold_runs", + llvm::cl::desc( + "Specify number of benchmark runs to exclude from timing, but to warm up frequency"), + llvm::cl::value_desc("integer number"), + llvm::cl::init(0), + llvm::cl::cat(HiptensorCategory)); llvm::cl::opt hiptensorOmitMask("omit", @@ -50,20 +70,11 @@ llvm::cl::opt namespace hiptensor { - HiptensorOptions::HiptensorOptions() - : mOstream() - , mOmitSkipped(false) - , mOmitFailed(false) - , mOmitPassed(false) - , mOmitCout(false) - , mUsingDefaultParams(true) - , mInputFilename("") - , mOutputFilename("") + void parseOptions(int argc, char** argv) { - } + using Options = hiptensor::HiptensorOptions; + auto& options = Options::instance(); - void HiptensorOptions::parseOptions(int argc, char** argv) - { // Setup LLVM command line parser llvm::cl::SetVersionPrinter([](llvm::raw_ostream& os) { os << "hipTensor version: " << std::to_string(hiptensorGetVersion()) << "\n"; @@ -73,74 +84,26 @@ namespace hiptensor llvm::cl::ParseCommandLineOptions(argc, argv); // set I/O files if present - mInputFilename = hiptensorInputFilename; - mOutputFilename = hiptensorOutputFilename; + options->setInputYAMLFilename(hiptensorInputFilename); + options->setOutputStreamFilename(hiptensorOutputFilename); - setOmits(hiptensorOmitMask); + options->setOmits(hiptensorOmitMask); + + options->setValidation(hiptensorValidationOption); + + options->setHotRuns(hiptensorHotRuns); + options->setColdRuns(hiptensorColdRuns); // Load testing params from YAML file if present - if(!mInputFilename.empty()) + if(!options->inputFilename().empty()) { - mUsingDefaultParams = false; + options->setDefaultParams(false); } // Initialize output stream - if(!mOutputFilename.empty()) + if(!options->outputFilename().empty()) { - mOstream.initializeStream(mOutputFilename); + options->setOstream(options->outputFilename()); } } - - void HiptensorOptions::setOmits(int mask) - { - if(mask & 1) - mOmitSkipped = true; - if(mask & 2) - mOmitFailed = true; - if(mask & 4) - mOmitPassed = true; - if(mask & 8) - mOmitCout = true; - } - - HiptensorOStream& HiptensorOptions::ostream() - { - return mOstream; - } - - bool HiptensorOptions::omitSkipped() - { - return mOmitSkipped; - } - - bool HiptensorOptions::omitFailed() - { - return mOmitFailed; - } - - bool HiptensorOptions::omitPassed() - { - return mOmitPassed; - } - - bool HiptensorOptions::omitCout() - { - return mOmitCout; - } - - bool HiptensorOptions::usingDefaultConfig() - { - return mUsingDefaultParams; - } - - std::string HiptensorOptions::inputFilename() - { - return mInputFilename; - } - - std::string HiptensorOptions::outputFilename() - { - return mOutputFilename; - } - -} // namespace hiptensor +} diff --git a/test/llvm/command_line_parser.hpp b/test/llvm/command_line_parser.hpp new file mode 100644 index 00000000..d1bd17af --- /dev/null +++ b/test/llvm/command_line_parser.hpp @@ -0,0 +1,35 @@ +/******************************************************************************* + * + * MIT License + * + * Copyright (C) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef HIPTENSOR_COMMAND_LINE_PARSER_IMPL_HPP +#define HIPTENSOR_COMMAND_LINE_PARSER_IMPL_HPP + +namespace hiptensor +{ + void parseOptions(int argc, char** argv); +} + +#endif // HIPTENSOR_COMMAND_LINE_PARSER_IMPL_HPP diff --git a/test/llvm/yaml_parser_config.cpp b/test/llvm/yaml_parser_config.cpp index ec55df2e..ad62acf7 100644 --- a/test/llvm/yaml_parser_config.cpp +++ b/test/llvm/yaml_parser_config.cpp @@ -2,7 +2,7 @@ * * MIT License * - * Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,6 +33,7 @@ #include "01_contraction/contraction_test_params.hpp" #include "02_permutation/permutation_test_params.hpp" #include "03_reduction/reduction_test_params.hpp" +#include "common.hpp" #include "yaml_parser_impl.hpp" // Fwd declare NoneType @@ -49,6 +50,7 @@ namespace hiptensor // /// // struct ContractionTestParams // { + // using TestDataTypeT = std::vector; // using AlgorithmT = hiptensorAlgo_t; @@ -270,6 +272,7 @@ namespace llvm // Additional validation for input / output of the config static std::string validate(IO& io, hiptensor::ContractionTestParams& doc) { + if(doc.problemLengths().size() == 0) { return "Error: Empty Lengths"; @@ -334,6 +337,7 @@ namespace llvm // Additional validation for input / output of the config static std::string validate(IO& io, hiptensor::PermutationTestParams& doc) { + if(doc.problemLengths().size() == 0) { return "Error: Empty Lengths"; @@ -381,6 +385,7 @@ namespace llvm // Additional validation for input / output of the config static std::string validate(IO& io, hiptensor::ReductionTestParams& doc) { + if(doc.problemLengths().size() == 0) { return "Error: Empty Lengths";