Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion python/CuTeDSL/cutlass/base_dsl/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,9 @@ def _compile(self, func: Any, *args: Any, **kwargs: Any) -> Any:
the same token string as ``CUTE_DSL_COMPILER_OPT``. For the
full option catalog, see
``write-kernel/references/compiler-options.md``.
``no_cache=False`` opts this compile into the content-addressed
compile cache; it defaults to ``True`` because compile-only
results are not cached by default.
:return: A compiled callable.
:raises DSLRuntimeError: If ``func`` is not callable or not
decorated with ``@cute.jit``.
Expand All @@ -1316,7 +1319,11 @@ def _compile(self, func: Any, *args: Any, **kwargs: Any) -> Any:
finalize_hook = kwargs.pop("trace_finalize_hooks", None)

kwargs["compile_only"] = True
kwargs["no_cache"] = True
# Default to bypassing the cache, but let an explicit `no_cache=False` from
# the caller opt back in. This used to be an unconditional assignment, which
# meant `cute.compile` could never reach the content-addressed compile cache
# and re-ran the full MLIR build even for a byte-identical artifact.
kwargs.setdefault("no_cache", True)

if inspect.isfunction(func):
# regular function
Expand Down
9 changes: 7 additions & 2 deletions python/CuTeDSL/cutlass/base_dsl/dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,12 @@ def _prepare_compilation(

pipeline = kwargs.pop("pipeline", None)
gpu_module_attrs = kwargs.pop("gpu_module_attrs", {})
no_cache = kwargs.pop("no_cache", False)
# `None` means the caller expressed no preference, so the conservative
# defaults below apply. An explicit value is treated as an opt-in and is
# not overridden by the compile-only rule.
no_cache_arg = kwargs.pop("no_cache", None)
no_cache_explicit = no_cache_arg is not None
no_cache = bool(no_cache_arg)
no_jit_engine = kwargs.pop("no_jit_engine", False)
compile_only = kwargs.pop("compile_only", False)

Expand All @@ -2608,7 +2613,7 @@ def _prepare_compilation(
no_cache = True
self.print_warning("Cache is disabled as user wants to generate PTX/ASM.")

if not no_cache and compile_only:
if not no_cache and compile_only and not no_cache_explicit:
no_cache = True
self.print_warning("Cache is disabled as user wants to compile only.")

Expand Down