You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2024/11/05 16:49:13 UTC
[PR] [Python][Relax] Update Rotary positional embedding scaling [tvm]
tlopex opened a new pull request, #17506:
URL: https://github.com/apache/tvm/pull/17506
This PR introduces two more styles of RoPE scaling: the gptj style and the yarn scale.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Python][Relax] Update Rotary positional embedding scaling [tvm]
Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 merged PR #17506:
URL: https://github.com/apache/tvm/pull/17506
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Python][Relax] Update Rotary positional embedding scaling [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex commented on PR #17506:
URL: https://github.com/apache/tvm/pull/17506#issuecomment-2478579701
Thanks!@MasterJH5574 It works!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Python][Relax] Update Rotary positional embedding scaling [tvm]
Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 commented on code in PR #17506:
URL: https://github.com/apache/tvm/pull/17506#discussion_r1842900900
##########
python/tvm/relax/frontend/nn/llm/position_embedding.py:
##########
@@ -341,11 +427,18 @@ def _rope( # pylint: disable=too-many-arguments
pos * scale, d, rotary_dim, theta, "float32", **kwargs
)
cos = cos_freq * x[s, h, d].astype("float32")
- sin = sin_freq * tir.if_then_else(
- d < rotary_dim // 2,
- -x[s, h, d + rotary_dim // 2],
- x[s, h, d - rotary_dim // 2],
- ).astype("float32")
+ if rope_scaling["rope_type"] == "gptj":
Review Comment:
I'm not sure if it's the reason, but I guess maybe we can try `"rope_type" in rope_scaling and rope_scaling["rope_type"] == "gptj"`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Python][Relax] Update Rotary positional embedding scaling [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex commented on PR #17506:
URL: https://github.com/apache/tvm/pull/17506#issuecomment-2457735953
cc @tqchen @MasterJH5574
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Python][Relax] Update Rotary positional embedding scaling [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex commented on PR #17506:
URL: https://github.com/apache/tvm/pull/17506#issuecomment-2470074059
@MasterJH5574 Hi, Ruihang! Could you have a look at it and tell me how can I modify my code to pass the CI? Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org