Commit 6b03cfdb authored by guanyu1's avatar guanyu1
Browse files

补充mrope创建部分

parent fb445dde
...@@ -611,9 +611,15 @@ class GPUModelRunner( ...@@ -611,9 +611,15 @@ class GPUModelRunner(
# identical position IDs, making M-RoPE functionally equivalent to # identical position IDs, making M-RoPE functionally equivalent to
# 1D-RoPE. # 1D-RoPE.
# See page 5 of https://arxiv.org/abs/2409.12191 # See page 5 of https://arxiv.org/abs/2409.12191
self.mrope_positions = self._make_buffer( if self.use_1d_mrope:
(3, self.max_num_tokens + 1), dtype=torch.int64 self.mrope_positions = self._make_buffer(
) 3 * (self.max_num_tokens + 1), dtype=torch.int64
)
else:
self.mrope_positions = self._make_buffer(
(3, self.max_num_tokens + 1), dtype=torch.int64
)
# Only relevant for models using XD-RoPE (e.g, HunYuan-VL) # Only relevant for models using XD-RoPE (e.g, HunYuan-VL)
if self.uses_xdrope_dim > 0: if self.uses_xdrope_dim > 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment