Skip to content

[DLight][GPU] Skip fallback scheduling for zero extents - #20394

Open
Nanmur wants to merge 1 commit into
apache:mainfrom
Nanmur:codex/fix-dlight-zero-extent-fallback
Open

Nanmur wants to merge 1 commit into
apache:mainfrom
Nanmur:codex/fix-dlight-zero-extent-fallback

Conversation

@Nanmur

@Nanmur Nanmur commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Skip the GPU fallback schedule rule when a PrimFunc contains a statically zero-extent loop.
  • Add a regression test for an elementwise float32[4, 0] function.

This prevents Fallback from reaching inline/fuse transformations that construct invalid zero-extent index arithmetic.

Testing

  • python -m pytest tests/python/s_tir/dlight/test_gpu_fallback.py::test_fallback_skips_zero_extent_spatial -q
  • ruff check python/tvm/s_tir/dlight/gpu/fallback.py tests/python/s_tir/dlight/test_gpu_fallback.py

Fixes #20279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][CUDA][dlight] GPU Fallback calls sch.fuse on a zero loop extent and aborts with "Divide by zero"

1 participant