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 Sep 4, 2024
1 parent 901019e commit cea691b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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
2 changes: 1 addition & 1 deletion libl4casadi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_definitions(-DTORCH_VERSION_MINOR=${Torch_VERSION_MINOR})
add_definitions(-DTORCH_VERSION_PATCH=${Torch_VERSION_PATCH})

if (Torch_VERSION_MAJOR GREATER_EQUAL 1 AND Torch_VERSION_MINOR GREATER_EQUAL 4)
#add_definitions(-DENABLE_TORCH_COMPILE)
# add_definitions(-DENABLE_TORCH_COMPILE)
endif ()
if (USE_CUDA)
add_definitions(-DUSE_CUDA)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "l4casadi"
version = "1.4.1"
version = "2.0.0"
authors = [
{ name="Tim Salzmann", email="[email protected]" },
]
Expand Down

0 comments on commit cea691b

Please sign in to comment.