Skip to content

Commit

Permalink
Make compile exception fail for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Salzmann committed Aug 9, 2024
1 parent 901019e commit 4334926
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion l4casadi/l4casadi.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(self,
if not scripting:
warnings.warn("L4CasADi with Torch AOT compilation is experimental at this point and might not work as "
"expected.")
raise RuntimeError("PyTorch compile is not supported yet as it does not seem stable.")
if torch.__version__ < torch.torch_version.TorchVersion('2.4.0'):
raise RuntimeError("For PyTorch versions < 2.4.0 L4CasADi only supports jit scripting. Please pass "
"scripting=True.")
Expand Down Expand Up @@ -386,7 +387,7 @@ def export_torch_traces(self) -> Tuple[bool, bool, bool, bool]:

out_folder = self.build_dir

self.model_compile( make_fx(functionalize(self.model, remove='mutations_and_views'))(d_inp),
self.model_compile(make_fx(functionalize(self.model, remove='mutations_and_views'))(d_inp),
(out_folder / f'{self.name}.pt').as_posix(),
(d_inp,))

Expand Down

0 comments on commit 4334926

Please sign in to comment.