Skip to content

Commit

Permalink
empty gpu memory cache between different benchmark cases (pytorch#2242)…
Browse files Browse the repository at this point in the history
  • Loading branch information
liqiangxl authored Dec 6, 2022
1 parent 70ef3a4 commit 673d40c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benchmarks/cpp/nvfuser/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <benchmarks/cpp/nvfuser/utils.h>

#include <c10/cuda/CUDACachingAllocator.h>
#include <torch/csrc/jit/codegen/cuda/scheduler/all_schedulers.h>

#include <sstream>
Expand Down Expand Up @@ -168,6 +168,7 @@ void runBenchmarkIterations(
benchmark::State& benchmark_state,
FusionExecutorCache* fusion_executor_cache,
std::vector<c10::IValue>& aten_inputs) {
c10::cuda::CUDACachingAllocator::emptyCache();
fusion_executor_cache->runFusionWithInputs(aten_inputs);
bool segmented =
fusion_executor_cache->getMostRecentKernelRuntime()->isSegmented() &&
Expand Down

0 comments on commit 673d40c

Please sign in to comment.