From 90172a504e96d246e07cb1ebad3b291532445560 Mon Sep 17 00:00:00 2001 From: Martin Vit Date: Thu, 9 Jul 2026 02:28:26 +0000 Subject: [PATCH] Handle plain CuTe compile callable with DSL options --- b12x/cute/compiler.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/b12x/cute/compiler.py b/b12x/cute/compiler.py index 1e007ff04..24637ceb7 100644 --- a/b12x/cute/compiler.py +++ b/b12x/cute/compiler.py @@ -1994,7 +1994,17 @@ def compile( # Subscript-style DSL compile options (e.g. OptLevel(2): ptxas -O3's # scheduler register-starves some scalar-heavy kernels; see the w4a8 # dynamic MoE recipe). - compile_callable = cute.compile[dsl_compile_options] + if hasattr(compile_callable, "__getitem__"): + compile_callable = compile_callable[dsl_compile_options] + else: + # Some embedded runtimes expose cutlass.cute.compile as a plain + # function instead of the CompileCallable instance installed by the + # top-level module import. Recreate the callable explicitly so DSL + # options still take effect instead of crashing or silently falling + # back to the default compiler options. + from cutlass.base_dsl.compiler import CompileCallable + + compile_callable = CompileCallable(dsl_compile_options) kwargs = dict(kwargs) kwargs["__dsl_compile_options_key"] = repr(dsl_compile_options) memory_cache_key = _compile_memory_cache_key(