Skip to content

Commit

Permalink
Update on "Make CI error on inductor fallback when decomp is available"
Browse files Browse the repository at this point in the history
Fixes #99446 

Remove the warning, as that annoyed end-users who don't know what to do about it.

Instead, try to hold the line by preventing any decomp from being added without making
the corresponding change to inductor's fallbacks.

Note: we probably still need to better document how to update inductor's decomps,
for now it's pretty much "go ask the inductor team for advice"

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
  • Loading branch information
wconstab committed Apr 19, 2023
1 parent 2a23c14 commit ce205d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions torch/_dynamo/allowed_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def _is_allowed_module_prefix(obj):
"torch._C.inductor.",
"torch.fx.",
"torch.distributed.fsdp.",
"torch.distributed.nn.functional",
)
allowed_modules_dot = tuple([x + "." for x in allowed_modules])
module = inspect.getmodule(obj)
Expand Down
11 changes: 4 additions & 7 deletions torch/_inductor/lowering.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import functools
import itertools
import logging
import sys
from collections.abc import Iterable
from typing import List, Optional, Tuple

Expand Down Expand Up @@ -1090,16 +1089,14 @@ def make_fallback(kernel, layout_constraint=None, warn=True):
if get_decompositions([kernel]) and warn and IS_CI:
# Note: 'warn' is holdover from when this was a warning, but for ops that previously
# set warn=False we do not want a CI error.
log.error(
"make_fallback(%s): a decomposition exists, we should switch to it."
# Ignore the 'suppress errors' configs in CI, as this particular warning happens on startup anyway and is not
# likely to be triggered preferentially on one CI config over another.
raise AssertionError(
f"make_fallback({kernel}): a decomposition exists, we should switch to it."
" To fix this error, either add a decomposition to core_aten_decompositions (preferred)"
" or inductor_decompositions, and delete the corresponding `make_fallback` line."
" Get help from the inductor team if unsure, don't pick arbitrarily to unblock yourself.",
kernel,
)
# Make sure the process exits and CI flags an error, raising
# an exception could allow a graph-break and silently pass CI in some configs
sys.exit(1)

add_needs_realized_inputs(kernel)
if layout_constraint is not None:
Expand Down

0 comments on commit ce205d2

Please sign in to comment.