AlibabaResearch / AlibabaResearch/AdvancedLiterateMachinery

OmniParser - inference过程中循环输出长度超过最大值

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.8k
Forks
195
PR merge metrics
No merged PRs in 30d

Description

一个小的代码修改意见:

pt_seq_length=1024
所以在transformer.py decoder逐步输出inference结果时的for循环里
for i in range(self.args.pt_seq_length):
i从0取到1023
embedding对于Position的编码应该也是0到1023

但是pt_hs = self.decode(pt_seq, memory, mask, pos_embed, 'pt')这一步输入到decode函数里的pt_seq,在i=0的时候,已经长度为7(应该是有prompt),所以会存在数组越界的情况。

数组越界就报错:
RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasLtMatmul( ltHandle, computeDesc.descriptor(), &alpha_val, mat1_ptr, Adesc.descriptor(), mat2_ptr, Bdesc.descriptor(), &beta_val, result_ptr, Cdesc.descriptor(), result_ptr, Cdesc.descriptor(), &heuristicResult.algo, workspace.data_ptr(), workspaceSize, at::cuda::getCurrentCUDAStream())`

最后,感谢作者分享工作,学习后受益良多。
祝好~

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.