This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 2bab8bc47d fix: Use T.decl_buffer instead of T.Buffer for aliased 
buffers in LongRoPE (#18859)
2bab8bc47d is described below

commit 2bab8bc47db0eab2f491432a8d42fea4b3662593
Author: Ruihang Lai <[email protected]>
AuthorDate: Sun Mar 1 06:54:29 2026 -0500

    fix: Use T.decl_buffer instead of T.Buffer for aliased buffers in LongRoPE 
(#18859)
    
    T.Buffer used as a local variable does not emit a DeclBuffer IR node,
    causing well-formedness check failures. Replace with T.decl_buffer.
---
 python/tvm/relax/frontend/nn/llm/position_embedding.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/tvm/relax/frontend/nn/llm/position_embedding.py 
b/python/tvm/relax/frontend/nn/llm/position_embedding.py
index a0bfbbc578..2fc438cacd 100644
--- a/python/tvm/relax/frontend/nn/llm/position_embedding.py
+++ b/python/tvm/relax/frontend/nn/llm/position_embedding.py
@@ -587,8 +587,8 @@ def llama_rope_with_position_map(  # pylint: 
disable=too-many-arguments
             var_position_map, (seq_len,), "int32", 
elem_offset=position_map_elem_offset
         )
         # long factors is the first half, short factors is the second half
-        long_factors = T.Buffer((rotary_dim // 2,), "float32", 
data=ext_factors.data)
-        short_factors = T.Buffer(
+        long_factors = T.decl_buffer((rotary_dim // 2,), "float32", 
data=ext_factors.data)
+        short_factors = T.decl_buffer(
             (rotary_dim // 2,),
             "float32",
             data=ext_factors.data,
@@ -814,8 +814,8 @@ def llama4_rope_with_position_map(  # pylint: 
disable=too-many-arguments
             var_position_map, (seq_len,), "int32", 
elem_offset=position_map_elem_offset
         )
         # long factors is the first half, short factors is the second half
-        long_factors = T.Buffer((rotary_dim // 2,), "float32", 
data=ext_factors.data)
-        short_factors = T.Buffer(
+        long_factors = T.decl_buffer((rotary_dim // 2,), "float32", 
data=ext_factors.data)
+        short_factors = T.decl_buffer(
             (rotary_dim // 2,),
             "float32",
             data=ext_factors.data,

Reply via email to