Files
tilelang/testing/python/cpu
xyyy1420 00267e43aa [BugFix] add target context and avoid redundant re-lowering in TLCPUSourceWrapper (#1899)
fix(cpu): skip redundant re-lowering in TLCPUSourceWrapper when mods already exist

TLCPUSourceWrapper.parse_source_information() unconditionally called
get_annotated_mod() to re-lower the IR, even when device_mod and
host_mod were already passed in from tilelang.lower(). This caused a
crash when the kernel uses T.copy (which generates T.Parallel loops),
because VectorizePlanner requires Target::Current() during lowering.

Fix: check if device_mod/host_mod already exist before re-lowering,
matching the pattern used by TLCUDASourceWrapper. Also add self.target
to the context manager for the fallback path.

Added test_matmul_with_copy_cython to reproduce the issue.
2026-03-05 13:38:05 +08:00
..