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

Allow linear to be consumed by nvFuser by default #1371

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
2 changes: 2 additions & 0 deletions thunder/executors/nvfuserex_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,8 @@ def map_inside_replacement(x: Any) -> None:

def _linear_check(a: TensorProxy, b: TensorProxy, bias: TensorProxy | None) -> bool:
enable_linear: None | bool = get_compile_option("nv_enable_linear", "Enable nvFuser linear.")
if enable_linear is None:
enable_linear = True
if not enable_linear:
return False
riccardofelluga marked this conversation as resolved.
Show resolved Hide resolved
# Verify linear inputs and bias (optional) are supported tensors.
Expand Down
1 change: 1 addition & 0 deletions thunder/tests/test_nvfuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def test_cse_rematerialization(executor, device, _):
disable_torch_autograd=True,
executors=executor.executors_list(),
nv_enable_bookend=False,
nv_enable_linear=False,
)
compiled_func(x, y)

Expand Down
Loading