Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于OpPackage-LLaMAAdd中的Q6_V_valign_VVR计算方式的疑惑 #131

Open
mailonghua opened this issue Aug 29, 2024 · 1 comment
Open
Assignees

Comments

@mailonghua
Copy link

你好
在LLaMAAdd.cpp中的如下函数

int32_t hvx_add_af(
    float *restrict input,
    float *restrict input2,
    float *restrict output,
    uint32_t size)
{
       ...
           sline1 = Q6_V_valign_VVR(sline1c, sline1p, (size_t)input);
            sline2 = Q6_V_valign_VVR(sline2c, sline2p, (size_t)input2);
       ...

}

其中Q6_V_valign_VVR是按照(size_t)input进行对齐拼接,最终返回到一个HVX_VECTOR中,其应该对应
Vd = valign(Vu,Vv,Rt)

这里的Rt对应的就是代码中(size_t)input,这里将一个地址作为RT的功能是什么?或者有什么意义吗?这块不是很理解,能否解答一下

@liang1232018
Copy link
Collaborator

你好,
感谢关注!

该部分设计主要是考虑地址可能存在不对齐的可能性。该指令将地址传进去是依据地址不对齐的偏移来拼接sline1c和sline1p两相邻的vector。

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

No branches or pull requests

3 participants