Skip to content

Conversation

@clouds56
Copy link
Contributor

@clouds56 clouds56 commented Dec 26, 2025

I know it's not perfect, but better than nothing

def __getitem__(self, idx) -> Buffer

This is not breaking, I think T.Kernel is intended to call with T.Kernel(64, 128) but not T.Kernel([64], [128])

Summary by CodeRabbit

  • New Features

    • Added new utility operations for expression handling.
    • Typing support added for indexing on buffer-like objects.
  • API Changes

    • Simplified kernel-like call signature to accept block extents directly (no per-block list wrapping required).

✏️ 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

Kernel signature changed to accept variadic tir.PrimExpr for blocks (no per-block lists); Buffer gained __getitem__/__setitem__ declarations in a TYPE_CHECKING block; Cast, max, and min function stubs added to TIR type stubs.

Changes

Cohort / File(s) Summary
Kernel API Update
tilelang/language/kernel.py
Signature changed from def Kernel(*blocks: list[tir.PrimExpr], ...) to def Kernel(*blocks: tir.PrimExpr, ...); docstring/type hint updated from blocks : List[int]blocks : int.
Buffer Type Hints
tilelang/language/v2/annot.py
Added __getitem__(self, idx) -> Buffer and __setitem__(self, idx, val) declarations inside the TYPE_CHECKING block (typing/IDE-only).
TIR Function Stubs
tilelang/language/tir/ir.pyi
Added public stubs: `def Cast(dtype, value: _T, span: Span

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped through code with nimble feet,
Blocks unwrapped made my rhythm sweet,
Cast, max, and min now join the crew,
Buffers index with hints anew,
A tiny rabbit's dev-time tune — hooray for you!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% 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 accurately summarizes the main changes: updating the Kernel signature (from list-wrapped to variadic PrimExpr) and adding type hints for buffer operations (getitem, setitem, and new functions in the type stub file).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@clouds56 clouds56 changed the title improve some typings Update Kernel signature and add type hints for buffer operations Dec 26, 2025
@clouds56
Copy link
Contributor Author

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #1546

coderabbitai bot added a commit that referenced this pull request Dec 26, 2025
Docstrings generation was requested by @clouds56.

* #1545 (comment)

The following files were modified:

* `tilelang/language/kernel.py`
* `tilelang/language/v2/annot.py`
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c44d59 and e5d95aa.

📒 Files selected for processing (1)
  • tilelang/language/tir/ir.pyi

Copy link
Collaborator

@kurisu6912 kurisu6912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@LeiWang1999 LeiWang1999 changed the title Update Kernel signature and add type hints for buffer operations [TypinfUpdate Kernel signature and add type hints for buffer operations Dec 29, 2025
@LeiWang1999 LeiWang1999 changed the title [TypinfUpdate Kernel signature and add type hints for buffer operations [Typing] Update Kernel signature and add type hints for buffer operations Dec 29, 2025
@LeiWang1999 LeiWang1999 merged commit 470d8b2 into tile-ai:main Dec 29, 2025
6 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.

3 participants