You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RUNTIME] Pass full kwargs to Autotuner hooks instead of positional args (#5083)
Currently, when there are hooks accessing args in the
`@triton.autotuner` (e.g., `pre_hook` / `post_hook` or those created
from the `restore_value` or `reset_to_zero`) and the kernel arguments
are passed as kwargs, this breaks, because the hooks take positional
`args` only.
This PR changes the first parameter of the `pre_hook` and `post_hook` of
the `Autotuner` from (partial) `args` to (full) `kwargs`. As a result,
we now have access to all arguments, positional or keyword, passed to
the kernel call. The call sites and docs are updated accordingly.
N.B.: This change is BC-breaking! In the signatures of `pre_hook` and
`post_hook`, the first parameter type has changed from list (of
positional args) to dict (of all kwargs). Submitting, as agreed with
@Jokeren and @peterbell10 below.
Fixes#5082. See the failing example, error, and code pointers there.
0 commit comments