nlp-uoregon / trankit

Trankit is a Light-Weight Transformer-based Python Toolkit for Multilingual Natural Language Processing
Apache License 2.0
724 stars 99 forks source link

CUDA error: device-side assert triggered #52

Open kkashleva opened 2 years ago

kkashleva commented 2 years ago

Hi! When I try to parse with

tagged_sent = p.posdep(data, is_sent=True)

I got such an error. My input is a list of strings. Environment is Google Colab.

RuntimeError                              Traceback (most recent call last)
[<ipython-input-17-776a5ac68296>](https://localhost:8080/#) in <module>()
----> 1 tagged_sent = p.posdep(data,is_sent=True)
2 frames
[/usr/local/lib/python3.7/dist-packages/trankit/models/classifiers.py](https://localhost:8080/#) in predict(self, batch, word_reprs, cls_reprs)
    170         unlabeled_scores = self.unlabeled(dep_reprs, dep_reprs).squeeze(3)
    171 
--> 172         diag = torch.eye(batch.head_idxs.size(-1) + 1, dtype=torch.bool).unsqueeze(0).to(self.config.device)
    173         unlabeled_scores.masked_fill_(diag, -float('inf'))
    174 
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.
nagaraju291990 commented 6 months ago

Hi @kkashleva did you fix this error? I am also facing this error.

nagaraju291990 commented 6 months ago

@kkashleva setting 'max_input_length': 1024, solved my issue. Hope this might help you