Skip to content

global sliding window似乎有问题? #61

@WKQ9411

Description

@WKQ9411

您好,在 ContextManagerget_global_hidden_and_mask 方法中(代码位置),对 sliding_window 赋值为:

sliding_window = (self.global_remainder[0].size(-2) + rmd_st, self.n_local)

我认为这里是不是用错了?我的理解应该是:

sliding_window = (rmd_st + self._global_remainder_ed - self._global_remainder_st, self.n_local)

理由如下:
在刚开始执行 append 方法时,对 self.global_remainder 进行了拼接,这时 self.global_remainder[0].size(-2) 指的应该是它的物理存储长度。但是在处理某一个 exc_block 时,我们关注的应该是 self._global_remainder_ed - self._global_remainder_st 这个指针代表的逻辑长度,以这个逻辑长度构建 sliding_window 时,才能提供正确的偏移量,从而刚好跟local计算时的mask互补。我画了一个示意图如下,不知我理解的是否正确?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions