Skip to content
Closed
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
11 changes: 6 additions & 5 deletions aten/src/ATen/native/cudnn/Conv_v8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ cudnn_frontend::ExecutionPlan* find(const KeyType& key) {
return &(it->second);
}

void emplace(const KeyType& key, T& results) {
void update(const KeyType& key, T& results) {
std::lock_guard<std::mutex> guard(mutex);
engine_cache.erase(key);
engine_cache.emplace(key, std::move(results));
}

Expand Down Expand Up @@ -548,7 +549,7 @@ void try_plans(cudnn_frontend::executionPlans_t& plans, const CacheKey& key, con
for (auto & plan : plans) {
try {
run_conv_plan(handle, x, y, w, plan);
benchmark_cache.emplace(key, plan);
benchmark_cache.update(key, plan);
return;
} catch (cudnn_frontend::cudnnException &e) {} catch (CuDNNError &e) {}
catch (c10::OutOfMemoryError &e) {
Expand All @@ -562,7 +563,7 @@ void try_plans_fused(cudnn_frontend::executionPlans_t& plans, const CacheKeyFuse
for (auto & plan : plans) {
try {
run_conv_plan_fused(handle, x, y, w, z, b, plan);
benchmark_cache_fused.emplace(key, plan);
benchmark_cache_fused.update(key, plan);
return;
} catch (cudnn_frontend::cudnnException &e) {} catch (CuDNNError &e) {}
catch (c10::OutOfMemoryError &e) {
Expand All @@ -583,7 +584,7 @@ bool try_configs(cudnn_frontend::EngineConfigList& configs, const std::string& o
continue;
}
run_conv_plan(handle, x, y, w, plan);
benchmark_cache.emplace(key, plan);
benchmark_cache.update(key, plan);
return true;
} catch (cudnn_frontend::cudnnException &e) {} catch(CuDNNError &e) {}
catch (c10::OutOfMemoryError &e) {
Expand All @@ -604,7 +605,7 @@ bool try_configs_fused(cudnn_frontend::EngineConfigList& configs, const std::str
continue;
}
run_conv_plan_fused(handle, x, y, w, z, b, plan);
benchmark_cache_fused.emplace(key, plan);
benchmark_cache_fused.update(key, plan);
return true;
} catch (cudnn_frontend::cudnnException &e) {} catch(CuDNNError &e) {}
catch (c10::OutOfMemoryError &e) {
Expand Down