Skip to content

Conversation

@NicolasHug
Copy link
Contributor

Meant to be used as:

with torchcodec.set_cuda_backend("beta"):
    decoder = VideoDecoder("video.mp4", device="cuda")

decoder.get_frame_at(...)

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2025
# Thread-local and async-safe storage for the current CUDA backend
_CUDA_BACKEND: contextvars.ContextVar[str] = contextvars.ContextVar(
"_CUDA_BACKEND", default="ffmpeg"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan on changing the default to be the beta interface at some point in the future? Would we need to indicate the change to users in some way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we'll want the current "beta" to eventually become the default interface. Usually the way to give notice is that for a few versions, we'll be raising a warning if the user doesn't explicitly requests either the "beta" or the "ffmpeg" interface. Basically we'd force them to use the CM, or they get a warning. Then we do the switch and remove the warning.

This is a bit disruptive and annoying, maybe we'll decide that the new interface is just strictly better and 99.9999% compatible with the existing one, at which point we could decide not to raise any warning and just silently do the switch.

@NicolasHug NicolasHug merged commit b084768 into meta-pytorch:main Oct 15, 2025
53 of 54 checks passed
@NicolasHug NicolasHug deleted the cmcmcmcmcmcmcmcmcmcmcmcm branch October 15, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants