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

segfault with large tensor for pytorch #95

Open
Peach-He opened this issue Dec 8, 2021 · 1 comment
Open

segfault with large tensor for pytorch #95

Peach-He opened this issue Dec 8, 2021 · 1 comment

Comments

@Peach-He
Copy link

Peach-He commented Dec 8, 2021

Hi,
I am facing segmentation fault issue with large input tensor.
Test code:

import torch
from warprnnt_pytorch import RNNTLoss
rnnt_loss = RNNTLoss()

acts = torch.ones(128,256,129,1024, requires_grad=True)
labels = torch.ones(128,128)
act_length = torch.ones(128) * 256
label_length = torch.ones(128) * 128

if acts.dtype != torch.float:
    acts = acts.float()
if labels.dtype != torch.int32:
    labels = labels.int()
if act_length.dtype != torch.int32:
    act_length = act_length.int()
if label_length.dtype != torch.int32:
    label_length = label_length.int()

loss = rnnt_loss(acts, labels, act_length, label_length)
print(loss)
loss.backward()

How can I fix this issue?
Thanks!

@csukuangfj
Copy link

Can you try https://github.com/csukuangfj/optimized_transducer ?
It uses less memory and may fix your issue.

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

2 participants