From 9d370611855c0d100102276862bfb966226522ca Mon Sep 17 00:00:00 2001 From: Huanran Wang Date: Fri, 1 Nov 2024 13:45:51 -0400 Subject: [PATCH 1/6] Add ROCm path for hipRTC --- src/comgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/comgr.cpp b/src/comgr.cpp index b508bced2f..842500f2d1 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -990,7 +990,7 @@ void BuildHip(const std::string& name, return StartsWith(s, "--std=") || StartsWith(s, "-std="); })) opts.push_back("-std=c++17"); - + opts.push_back("-I/opt/rocm/include"); HiprtcProgram prog(name, text); prog.Compile(opts); prog.GetCode(binary); From 65d7d8078c00deb61b3b1ab9101d6d4d090b54ba Mon Sep 17 00:00:00 2001 From: Huanran Wang Date: Tue, 19 Nov 2024 12:23:31 -0500 Subject: [PATCH 2/6] Update ROCm path handling in BuildHip function and add logs for hipRTC build options --- src/comgr.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/comgr.cpp b/src/comgr.cpp index 842500f2d1..854e155814 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -990,7 +990,20 @@ void BuildHip(const std::string& name, return StartsWith(s, "--std=") || StartsWith(s, "-std="); })) opts.push_back("-std=c++17"); - opts.push_back("-I/opt/rocm/include"); + + const char* rocm_path = std::getenv("ROCM_PATH"); + if(rocm_path == nullptr || std::string(rocm_path).empty()) + { + rocm_path = "/opt/rocm"; + } + opts.push_back(std::string("-I") + rocm_path + "/include"); + + MIOPEN_LOG_I("HIPRTC compile options:"); + for (const auto& opt : opts) + { + MIOPEN_LOG_I(opt); + } + HiprtcProgram prog(name, text); prog.Compile(opts); prog.GetCode(binary); From 16acda9966cf5d60a9bf561004ee3c52f7970325 Mon Sep 17 00:00:00 2001 From: Brian Harrison Date: Wed, 20 Nov 2024 20:16:52 +0000 Subject: [PATCH 3/6] Fix formatting issue. --- src/comgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/comgr.cpp b/src/comgr.cpp index 854e155814..5199f28c84 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -999,7 +999,7 @@ void BuildHip(const std::string& name, opts.push_back(std::string("-I") + rocm_path + "/include"); MIOPEN_LOG_I("HIPRTC compile options:"); - for (const auto& opt : opts) + for(const auto& opt : opts) { MIOPEN_LOG_I(opt); } From ebc89880be53311b52debcd70a167f32e9677c3c Mon Sep 17 00:00:00 2001 From: Huanran Wang Date: Thu, 21 Nov 2024 16:59:28 -0500 Subject: [PATCH 4/6] Add ROCM_PATH using MIOpen Macros --- src/comgr.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/comgr.cpp b/src/comgr.cpp index 5199f28c84..6419f7b77a 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -75,6 +75,9 @@ MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_DEBUG_SRAM_EDC_DISABLED) MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_DEBUG_OPENCL_WAVE64_NOWGP) +/// Base directory of ROCm +MIOPEN_DECLARE_ENV_VAR_STR(ROCM_PATH) + #ifndef MIOPEN_AMD_COMGR_VERSION_MAJOR #define MIOPEN_AMD_COMGR_VERSION_MAJOR 0 #endif @@ -991,12 +994,13 @@ void BuildHip(const std::string& name, })) opts.push_back("-std=c++17"); - const char* rocm_path = std::getenv("ROCM_PATH"); - if(rocm_path == nullptr || std::string(rocm_path).empty()) + auto rocm_path = env::value(ROCM_PATH); + + if(rocm_path.empty()) { rocm_path = "/opt/rocm"; - } - opts.push_back(std::string("-I") + rocm_path + "/include"); + } + opts.push_back("-I" + rocm_path + "/include"); MIOPEN_LOG_I("HIPRTC compile options:"); for(const auto& opt : opts) From fcd5b45cf419dff1fb3c5de2954e67f97a349ec9 Mon Sep 17 00:00:00 2001 From: Huanran Wang Date: Tue, 3 Dec 2024 16:55:02 -0500 Subject: [PATCH 5/6] Update format with Clang script --- src/comgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/comgr.cpp b/src/comgr.cpp index 6419f7b77a..2f652d12a9 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -999,7 +999,7 @@ void BuildHip(const std::string& name, if(rocm_path.empty()) { rocm_path = "/opt/rocm"; - } + } opts.push_back("-I" + rocm_path + "/include"); MIOPEN_LOG_I("HIPRTC compile options:"); From a0847355516dba0c779ba2a606a714f4daca8a18 Mon Sep 17 00:00:00 2001 From: Huanran Wang Date: Fri, 17 Jan 2025 18:19:12 -0500 Subject: [PATCH 6/6] Improve logging format in GenericSearch for clarity on iteration and attempts (avoid "failed" string for error check in untest) --- src/include/miopen/generic_search.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/include/miopen/generic_search.hpp b/src/include/miopen/generic_search.hpp index a9cb6e4ae9..46b6ff8f7a 100644 --- a/src/include/miopen/generic_search.hpp +++ b/src/include/miopen/generic_search.hpp @@ -496,9 +496,10 @@ auto GenericSearch(const Solver s, } MIOPEN_LOG_T("##" - << "(n_current, n_failed, n_runs_total): " << n_current << '/' << n_failed - << '/' << n_runs_total << " elapsed_time: " << elapsed_time - << ", best_time: " << best_time << ", " << current_config); + << "(current_iter_num, attempts_fail_num, total_runs_num): " << n_current + << '/' << n_failed << '/' << n_runs_total + << ", elapsed_time: " << elapsed_time << ", best_time: " << best_time + << ", current_config" << current_config); if(ret == 0) {