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

[bug] Avoid redundant cache loading #7741

Merged
merged 3 commits into from
Apr 4, 2023
Merged
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
6 changes: 5 additions & 1 deletion taichi/compilation_manager/kernel_compilation_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ const CompiledKernelData *KernelCompilationManager::try_load_cached_kernel(
auto iter = kernels.find(kernel_key);
if (iter != kernels.end()) {
auto &k = iter->second;
if (auto loaded = load_ckd(kernel_key, arch)) {
if (k.compiled_kernel_data) {
TI_DEBUG("Create kernel '{}' from cache (key='{}')",
kernel_def.get_name(), kernel_key);
return k.compiled_kernel_data.get();
} else if (auto loaded = load_ckd(kernel_key, arch)) {
TI_DEBUG("Create kernel '{}' from cache (key='{}')",
kernel_def.get_name(), kernel_key);
TI_ASSERT(loaded->arch() == arch);
Expand Down