<h1>triton.autotune<aclass="headerlink"href="#triton-autotune"title="Permalink to this headline">¶</a></h1>
<dlclass="py function">
<dtclass="sig sig-object py"id="triton.autotune">
<spanclass="sig-prename descclassname"><spanclass="pre">triton.</span></span><spanclass="sig-name descname"><spanclass="pre">autotune</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">configs</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">key</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">prune_configs_by</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">reset_to_zero</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#triton.autotune"title="Permalink to this definition">¶</a></dt>
<dd><p>Decorator for auto-tuning a <codeclass="code docutils literal notranslate"><spanclass="pre">triton.jit</span></code>’d function.</p>
<spanclass="n">key</span><spanclass="o">=</span><spanclass="p">[</span><spanclass="s1">'x_size'</span><spanclass="p">]</span><spanclass="c1"># the two above configs will be evaluated anytime</span>
<spanclass="c1"># the value of x_size changes</span>
<ddclass="field-odd"><p>When all the configurations are evaluated, the kernel will run multiple time.
This means that whatever value the kernel updates will be updated multiple times.
To avoid this undesired behavior, you can use the <cite>reset_to_zero</cite> argument, which
reset the value of the provided tensor to <cite>zero</cite> before running any configuration.</p>
</dd>
<dtclass="field-even">Parameters</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>configs</strong> (<em>list</em><em>[</em><aclass="reference internal"href="triton.Config.html#triton.Config"title="triton.Config"><em>triton.Config</em></a><em>]</em>) – a list of <codeclass="code docutils literal notranslate"><spanclass="pre">triton.Config</span></code> objects</p></li>
<li><p><strong>key</strong> (<em>list</em><em>[</em><em>str</em><em>]</em>) – a list of argument names whose change in value will trigger the evaluation of all provided configs.</p></li>
<li><p><strong>prune_configs_by</strong>– a dict of functions that are used to prune configs, fields:
‘perf_model’: performance model used to predicate running time with different configs, returns running time
‘early_config_prune’(optional): a function used to do early prune (eg, num_stages). It take configs:List[Config] as its input, and returns pruned configs.</p></li>
<li><p><strong>reset_to_zero</strong> (<em>list</em><em>[</em><em>str</em><em>]</em>) – a list of argument names whose value will be reset to zero before evaluating any configs.</p></li>