{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiaczshzz6x5m2zc5ykpilst2dvbhj5pafrjxh35rpq3vebe6wtjaq",
"uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3mgv235gd43i2"
},
"path": "/t/helsinki-nlp-throws-stopiteration-within-dataparallel/174223#post_1",
"publishedAt": "2026-03-12T13:17:43.000Z",
"site": "https://discuss.huggingface.co",
"textContent": "Hoping this is the correct forum for this:\n\nPython 3.12.3\ntorch==2.10.0\ntransformers=5.3.0\n\nMy aim is to use Helsinki-NLP/opus-mt-ru-en and Helsinki-NLP/opus-mt-zh-en with two GPUs in batches, which I’ve been able to do for a couple years until I upgraded to Ubuntu 24, hence Python 3.12.\n\nIt now fails with a StopIteration exception within the Module. For instance, at this line in the Module in the forward method:\n\n\n outputs = self.model.generate(**inputs)\n\n\nIf, at that point any attempt to interrogate self.model.device, which is what happens downstream at line 2502 within GenerateMixin.generate() in transforers/generation/utils.py, the exception is thrown.\n\nDr. Google recommends converting to using DistributedDataParallel, but that seems to me a good bit of work for a process running on a single machine without any guarantee of sucess.\n\nI may have to resort to hand-jamming threads, which I had to do for the ModernBERT models some time back.",
"title": "Helsinki-NLP throws StopIteration within DataParallel"
}