findAlgorithm Class — pytorch Architecture
Architecture documentation for the findAlgorithm class in Conv_miopen.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/miopen/Conv_miopen.cpp lines 565–594
template<typename algo_t>
void findAlgorithm(const ConvolutionArgs& args, bool benchmark, algo_t* algo) {
using search = algorithm_search<algo_t>;
auto& cache = search::cache();
auto& wsscache = search::wsscache();
if (cache.find(args.params, algo)) {
return;
}
if (args.params.deterministic && !benchmark) {
*algo = search::DEFAULT_ALGO;
}
if (cache.find(args.params, algo)) {
// re-check cache since another thread may have benchmarked the algorithm
return;
}
auto perfResults = search::findAlgorithm(args, benchmark);
*algo = reinterpret_cast<algo_t&>(perfResults);
cache.insert(args.params, *algo);
wsscache.insert(args.params, perfResults.memory);
if (at::native::_cudnn_get_conv_benchmark_empty_cache()) {
c10::cuda::CUDACachingAllocator::emptyCache();
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free