Skip to content

Conversation

@botbw
Copy link
Contributor

@botbw botbw commented Dec 26, 2025

Summary by CodeRabbit

  • Refactor
    • Updated example code to use modern dynamic variable construction methods.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

The change replaces tvm.te.var() calls with T.dynamic() calls for dynamic shape variables (M, N, K) in the matmul_dynamic_mnk function within the dynamic shape example. This switches the method of constructing dynamic variables while maintaining identical semantics and control flow.

Changes

Cohort / File(s) Summary
Dynamic variable construction refactoring
examples/dynamic_shape/example_dynamic.py
Replaced three instances of tvm.te.var("m"/"n"/"k") with T.dynamic("m"/"n"/"k") for M, N, K variables in matmul_dynamic_mnk function

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

A rabbit hops with glee today,
Old vars fade and new ones play,
From tvm.te to T.dynamic's call,
Our shapes now flow through it all! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: replacing tvm.te.var calls with T.dynamic in the example code, which aligns with the actual modifications in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e82f37 and 6f36c2d.

📒 Files selected for processing (1)
  • examples/dynamic_shape/example_dynamic.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-14T07:56:11.098Z
Learnt from: lucifer1004
Repo: tile-ai/tilelang PR: 1256
File: testing/python/jit/test_tilelang_jit_gemm_nvrtc.py:55-115
Timestamp: 2025-11-14T07:56:11.098Z
Learning: In `testing/python/jit/test_tilelang_jit_gemm_nvrtc.py`, the global function `tilelang_callback_cuda_postproc` registered via `tvm.register_global_func(..., override=True)` is intentionally not restored after the test completes, as the persistent behavior is expected.

Applied to files:

  • examples/dynamic_shape/example_dynamic.py
📚 Learning: 2025-12-18T04:50:00.512Z
Learnt from: silentCoder-dev
Repo: tile-ai/tilelang PR: 1464
File: testing/python/language/test_tilelang_language_rand.py:14-14
Timestamp: 2025-12-18T04:50:00.512Z
Learning: In `testing/python/language/test_tilelang_language_rand.py`, the TileLang kernel uses `blk_M = M` (single block) and calls `rng_rand()` four times per element to align results with the Triton implementation, which uses `blk_M = 128` (multiple blocks) and calls the RNG once per element. These differences compensate for internal RNG behavior differences between TileLang and Triton.

Applied to files:

  • examples/dynamic_shape/example_dynamic.py
🧬 Code graph analysis (1)
examples/dynamic_shape/example_dynamic.py (1)
tilelang/language/symbolics.py (1)
  • dynamic (10-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
  • GitHub Check: Test for Python 3.12 with Nightly-ROCm-7.1 (on self-hosted-amd)
🔇 Additional comments (1)
examples/dynamic_shape/example_dynamic.py (1)

19-21: Correct adoption of TileLang's idiomatic API for dynamic shapes.

The change to T.dynamic() is the standard pattern throughout the TileLang codebase for defining dynamic shape variables. The default int32 dtype is appropriate for dimension variables. This aligns with the framework's design where T.dynamic() is the official API and T.symbolic() is deprecated.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@LeiWang1999 LeiWang1999 merged commit 5bba4df into tile-ai:main Dec 26, 2025
7 checks passed
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.

2 participants