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

Beam search error #90

Open
Faiail opened this issue Feb 9, 2023 · 3 comments
Open

Beam search error #90

Faiail opened this issue Feb 9, 2023 · 3 comments

Comments

@Faiail
Copy link

Faiail commented Feb 9, 2023

Hi everyone,
While evaluating the model, I got the following error:
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())`

I think that it could be a problem of shape for the input in the decoding stage of the model, when asking to search the best captions fot a batch of images.

How should I fix the error in your opinion? The error occurs exactly here: attention

@Faiail
Copy link
Author

Faiail commented Feb 10, 2023

Actually I checked that during beam search the shape of previous generated token changes from bs_ X 1 to 40 X 1 and I trurly don't know why. In particular this happens after generating the first token. In fact the first input is a batch of start tokens, with the correct batch size, whereas after the first iteration the it tensor changes the shape. This is related to the fact that it is taken the previous generated token as input. How can I fix that?

@KillerGary
Copy link

RuntimeError: gather(): Expected dtype int64 for index

@Kuo2023
Copy link

Kuo2023 commented Jul 12, 2023

RuntimeError: gather(): Expected dtype int64 for index:
I get this too, I have to add .to(torch.int64) at the end of every line of the code with gather (e.g
s = torch.gather(s.view(([self.b_s, cur_beam_size] + shape[1:])), 1,
beam.expand(
([self.b_s, self.beam_size] + shape[1:])).to(torch.int64))
)
And then I am encountered with other different problems
RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.cuda.FloatTensor instead (while checking arguments for embedding)

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