From a59c94ed2822bd9e7d7e37e127b5c44d84bb4930 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Fri, 20 Sep 2024 08:47:51 +0000 Subject: [PATCH] adjust cache size Signed-off-by: Anatoly Myachev --- benchmarks/triton_kernels_benchmark/benchmark_testing.py | 5 ++++- python/triton/testing.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/benchmarks/triton_kernels_benchmark/benchmark_testing.py b/benchmarks/triton_kernels_benchmark/benchmark_testing.py index 77a298c642..add0c86a94 100644 --- a/benchmarks/triton_kernels_benchmark/benchmark_testing.py +++ b/benchmarks/triton_kernels_benchmark/benchmark_testing.py @@ -64,7 +64,10 @@ def do_bench_ipex(fn, warmup=25, rep=100, grad_to_none=None, quantiles=None, fas # We maintain a buffer of 256 MB that we clear # before each kernel call to make sure that the L2 # doesn't contain any input data before the run - cache_size = 256 * 1024 * 1024 + factor = 1 + if os.getenv("ZE_FLAT_DEVICE_HIERARCHY", "FLAT") == "COMPOSITE": + factor = 2 + cache_size = factor * 256 * 1024 * 1024 if fast_flush: cache = torch.empty(int(cache_size // 4), dtype=torch.int, device=device) else: diff --git a/python/triton/testing.py b/python/triton/testing.py index 07827ad853..3098cd99ef 100644 --- a/python/triton/testing.py +++ b/python/triton/testing.py @@ -169,7 +169,10 @@ def do_bench(fn, warmup=25, rep=100, grad_to_none=None, quantiles=None, fast_flu # We maintain a buffer of 256 MB that we clear # before each kernel call to make sure that the L2 cache # doesn't contain any input data before the run - cache_size = 256 * 1024 * 1024 + factor = 1 + if os.getenv("ZE_FLAT_DEVICE_HIERARCHY", "FLAT") == "COMPOSITE": + factor = 2 + cache_size = factor * 256 * 1024 * 1024 if fast_flush: cache = torch.empty(int(cache_size // 4), dtype=torch.int, device=device_type) else: