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

RuntimeError: CUDA error: device-side assert triggered #1881

Open
JiangSYKY opened this issue Feb 24, 2025 · 1 comment
Open

RuntimeError: CUDA error: device-side assert triggered #1881

JiangSYKY opened this issue Feb 24, 2025 · 1 comment

Comments

@JiangSYKY
Copy link

torch是2.3.0
K2: Version: 1.24.4.dev20241029+cuda12.1.torch2.3.0
lhotse:Version: 1.30.0.dev0+git.13c7616.clean
在使用mdcc粤语数据集,执行prepare.sh的第十二步训练rnn_lm语言模型时,出现错误
Traceback (most recent call last):
File "/root/autodl-tmp/.autodl/icefall/egs/mdcc/ASR/../../../icefall/rnn_lm/train.py", line 689, in
main()
File "/root/autodl-tmp/.autodl/icefall/egs/mdcc/ASR/../../../icefall/rnn_lm/train.py", line 682, in main
run(rank=0, world_size=1, args=args)
File "/root/autodl-tmp/.autodl/icefall/egs/mdcc/ASR/../../../icefall/rnn_lm/train.py", line 647, in run
train_one_epoch(
File "/root/autodl-tmp/.autodl/icefall/egs/mdcc/ASR/../../../icefall/rnn_lm/train.py", line 474, in train_one_epoch
loss, loss_info = compute_loss(
^^^^^^^^^^^^^
File "/root/autodl-tmp/.autodl/icefall/egs/mdcc/ASR/../../../icefall/rnn_lm/train.py", line 376, in compute_loss
nll = model(x, y, sentence_lengths)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/autodl-tmp/.autodl/icefall/icefall/rnn_lm/model.py", line 151, in forward
rnn_out, _ = self.rnn(embedding)
^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/torch/nn/modules/rnn.py", line 911, in forward
result = _VF.lstm(input, hx, self._flat_weights, self.bias, self.num_layers,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

@csukuangfj
Copy link
Collaborator

File "/root/autodl-tmp/.autodl/icefall/egs/mdcc/ASR/../../../icefall/rnn_lm/train.py", line 376, in compute_loss
nll = model(x, y, sentence_lengths)

你把 x, y, sentence_lengths 的值打印出来?

为方便调试,请使用 batch size == 1 做测试。

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