mirror of
https://github.com/tile-ai/tilelang.git
synced 2026-10-24 07:04:00 +08:00
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.