Skip to content

[TIRx] Improve BufferStore cast warning context#20038

Open
tlopex wants to merge 1 commit into
apache:mainfrom
tlopex:buffer-store-warning-context
Open

[TIRx] Improve BufferStore cast warning context#20038
tlopex wants to merge 1 commit into
apache:mainfrom
tlopex:buffer-store-warning-context

Conversation

@tlopex

@tlopex tlopex commented Jul 21, 2026

Copy link
Copy Markdown
Member

This PR improves the precision-loss warning emitted while building a BufferStore.

Before this change, the warning only displayed the LHS and RHS dtypes, making it difficult to identify the failing kernel when many kernels were built together:

Warning: Casting in BufferStore may lose precision:
LHS is `T.int32`, RHS is `T.float32`, indexing lanes: 1

After this change, the warning also displays the current kernel name and the complete BufferStore node:

Warning: Casting in BufferStore may lose precision:
LHS is `T.int32`, RHS is `T.float32`, indexing lanes: 1,
kernel: `warning_kernel`

BufferStore:
A = T.Buffer((4,), "int32")
B = T.Buffer((4,))
i = T.int32()
A[i] = T.Cast("int32", B[i] + T.float32(0.5))

@tlopex

tlopex commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

cc @LeiWang1999

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the BufferStore function in src/tirx/script/builder/ir.cc to enhance the warning log for precision loss during casting. It now retrieves the kernel name from the current PrimFuncFrame and appends both the kernel name and the BufferStore object to the warning message. There are no review comments, so no additional feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant