In triton.autotune , how long time is each config benchmarked?
- User
In triton.autotune , how long time is each config benchmarked?
Assistant
I'll help you find information about how long each config is benchmarked in triton.autotune. Let me search the codebase for relevant files.
Assistant
Now let me examine the autotuner.py file to understand how the benchmarking duration is configured:
Assistant
Now I need to look at how the actual benchmarking is performed. The autotuner uses a benchmarking function, so let me check the driver module to see how the benchmarking is implemented:
Assistant
Let me look at the base driver and the NVIDIA backend to understand the benchmarking implementation:
Assistant
Now let me check the NVIDIA backend implementation to see how the benchmarking works:
Assistant
Now I need to check the triton.testing module to see how the
do_benchfunction works:Assistant
Let me check the main triton testing module:
Assistant
Now I have the information I need. Looking at the code, I can see that in the
triton.autotuneprocess, each configuration is benchmarked using thedo_benchfunction fromtriton.testing.From the
do_benchfunction intriton/testing.py:127-191, the benchmark time for each configuration is determined by:- The
warmupparameter - defaults to 25ms (number of warmup iterations is calculated asmax(1, int(warmup / estimate_ms))) - The
repparameter - defaults to 100ms (number of repetitions is calculated asmax(1, int(rep / estimate_ms)))
Looking back at the autotuner code in
autotuner.py:127-169, the_benchmethod usesself.do_bench(kernel_call, quantiles=(0.5, 0.2, 0.8)), which eventually calls thedo_benchfunction with default parameters (warmup=25, rep=100).So, to answer your original question: Each configuration in
triton.autotuneis benchmarked by running it for approximately 100ms (plus 25ms warmup), though the actual number of runs depends on an initial estimate of how long each kernel call takes.- The