meta-pytorch / meta-pytorch/torchcodec
Improve UX by letting the user know that their `torch` and `torchcodec` versions are incompatible
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 125
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 54
Description
🚀 The feature
Improve error message when torchcodec version is not compatible with torch version.
Before, user gets an obscure segmentation fault
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
After, user gets a meaningful error message
Your version of `torchcodec` (0.8) is incompatible with `torch` (2.8.0)`. Please downgrade `torchcodec` to 0.7 of upgrade `torch` to `2.9.0`.
Motivation, pitch
For some reason, I (and a bunch of my pyannote.audio users) ended up with an environment with torchcodec 0.8 and torch 2.8.0 which (I understand from the docs) are incompatible.
Running import torchcodec with version 0.8 of torchcodec and version 2.8.0 of torch leads to an obscure bad_alloc error message (+ core dump).
An obvious solution would indeed be for pyannote.audio to pin torch and torchcodec versions but this usually leads to incompatibility with other libraries.
A nice error message would help users figure this out by themselves.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with import torchcodec using torchcodec 0.8 and torch 2.8.0. Trace the import path to find where the compatibility check can happen. Done means incompatible versions produce a meaningful error that identifies both versions and suggests compatible upgrades or downgrades instead of the obscure bad_alloc crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100