From 6faf593775d7b28bce80c0a273f526780f6f67b8 Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Mon, 29 Sep 2025 23:39:04 -0700 Subject: [PATCH] Ensure the same behaviour as before --- mlx/compile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mlx/compile.cpp b/mlx/compile.cpp index 6e0be94a8..34d122b06 100644 --- a/mlx/compile.cpp +++ b/mlx/compile.cpp @@ -1007,6 +1007,14 @@ std::function(const std::vector&)> compile( std::uintptr_t fun_id, bool shapeless /* = false */, std::vector constants /* = {} */) { + if (skip_compile()) { + return fun; + } + if (!fun) { + throw std::invalid_argument( + "[compile] Cannot compile a function without a target."); + } + ArrayFnWithExtra fun_with_extra = [fun = std::move(fun)](const std::vector& inputs) { return std::pair, std::shared_ptr>{