Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frontend] Print out config when autotune fails #5117

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/triton/runtime/autotuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def _post_hook(kwargs, exception):
def _bench(self, *args, config, **meta):
from ..compiler.errors import CompileTimeAssertionFailure

verbose = os.environ.get("TRITON_PRINT_AUTOTUNING", None) == "1"
if verbose:
print(f"Autotuning kernel {self.base_fn.__name__} with config {config}")

# check for conflicts, i.e. meta-parameters both provided
# as kwargs and by the autotuner
conflicts = meta.keys() & config.kwargs.keys()
Expand Down Expand Up @@ -161,7 +165,9 @@ def kernel_call():

try:
return self.do_bench(kernel_call, quantiles=(0.5, 0.2, 0.8))
except (OutOfResources, CompileTimeAssertionFailure, PTXASError):
except (OutOfResources, CompileTimeAssertionFailure, PTXASError) as e:
if verbose:
print(f"Autotuning failed with {e}")
return [float("inf"), float("inf"), float("inf")]

def run(self, *args, **kwargs):
Expand Down
Loading