Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print JIT logs to Info, always #948

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/backend/Level0/CHIPBackendLevel0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2374,7 +2374,7 @@
std::vector<char> LogVec(LogSize);
zeStatus = zeModuleBuildLogGetString(Log, &LogSize, LogVec.data());
if (zeStatus == ZE_RESULT_SUCCESS)
logError("ZE Build Log:\n{}", std::string_view(LogVec.data(), LogSize));
logInfo("ZE Build Log:\n{}", std::string_view(LogVec.data(), LogSize));
}

CHIPERR_CHECK_LOG_AND_THROW_TABLE(zeModuleBuildLogDestroy);
Expand Down Expand Up @@ -2411,8 +2411,7 @@
std::string cacheDir = ChipEnvVars.getModuleCacheDir().value();
// Create the cache directory if it doesn't exist
std::filesystem::create_directories(cacheDir);
std::string fullPath =
cacheDir + std::to_string(hash);
std::string fullPath = cacheDir + std::to_string(hash);

Check warning on line 2414 in src/backend/Level0/CHIPBackendLevel0.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

src/backend/Level0/CHIPBackendLevel0.cc:2414:15 [readability-identifier-naming]

invalid case style for local variable 'fullPath'

size_t binarySize;
zeStatus = zeModuleGetNativeBinary(module, &binarySize, nullptr);
Expand Down Expand Up @@ -2505,8 +2504,7 @@
elapsed.count());
else
logTrace("zeModulerCeate took {} seconds", elapsed.count());
if (zeStatus != ZE_RESULT_SUCCESS)
dumpBuildLog(std::move(Log));
dumpBuildLog(std::move(Log));

CHIPERR_CHECK_LOG_AND_THROW_TABLE(zeModuleCreate);
logTrace("LZ CREATE MODULE via calling zeModuleCreate {} ",
Expand Down
10 changes: 4 additions & 6 deletions src/backend/OpenCL/CHIPBackendOpenCL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,8 @@ static void dumpProgramLog(CHIPDeviceOpenCL &ChipDev, cl::Program Prog) {
std::string Log =
Prog.getBuildInfo<CL_PROGRAM_BUILD_LOG>(*ChipDev.get(), &Err);
if (Err == CL_SUCCESS)
logError("Program LOG for device #{}:{}:\n{}\n", ChipDev.getDeviceId(),
ChipDev.getName(), Log);
logInfo("Program LOG for device #{}:{}:\n{}\n", ChipDev.getDeviceId(),
ChipDev.getName(), Log);
}

static cl::Program compileIL(cl::Context Ctx, CHIPDeviceOpenCL &ChipDev,
Expand All @@ -869,10 +869,8 @@ static cl::Program compileIL(cl::Context Ctx, CHIPDeviceOpenCL &ChipDev,
auto Duration =
std::chrono::duration_cast<std::chrono::milliseconds>(End - Start);
logTrace("clCompileProgram took {} ms", Duration.count());
if (Err != CL_SUCCESS) {
dumpProgramLog(ChipDev, Prog);
CHIPERR_LOG_AND_THROW("Compile step failed.", hipErrorInitializationError);
}
dumpProgramLog(ChipDev, Prog);
CHIPERR_CHECK_LOG_AND_THROW_TABLE(clCompileProgram);

return Prog;
}
Expand Down
Loading