Skip to content

Conversation

@mollyxu
Copy link
Contributor

@mollyxu mollyxu commented Dec 3, 2025

Expose cpu_fallback in VideoDecoder API

Expose the cpu_fallback property in the public API to allow users to check whether the video decoder fell back to CPU decoding. #943

The FallbackInfo class provides a clean interface for users to check decoder fallback status:

  • bool(fallback_info) returns True if any fallback occurred
  • str(fallback_info) provides a human-readable explanation of why fallback happened
  • Tracks two types of fallback: NVcuvid not found and unsupported video formats

The cpu_fallback property on VideoDecoder returns a FallbackInfo instance that can be queried after decoding at least one frame. This helps users understand why GPU decoding may not be used and debug performance issues.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 3, 2025
@mollyxu mollyxu marked this pull request as ready for review December 4, 2025 04:49
@mollyxu mollyxu changed the title expose cpu_fallback Expose cpu_fallback Dec 4, 2025
@mollyxu mollyxu changed the title Expose cpu_fallback Expose cpu_fallback property in VideoDecoder API Dec 4, 2025
@mollyxu mollyxu changed the title Expose cpu_fallback property in VideoDecoder API Expose cpu_fallback in VideoDecoder API Dec 4, 2025
Copy link
Contributor

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @mollyxu ! Left a few comments and suggestions regarding the implementation, let me know if I can clarify anything.

Copy link
Contributor

@Dan-Flores Dan-Flores left a comment

Choose a reason for hiding this comment

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

Left some small comments, but after those LGTM!

Copy link
Contributor

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks a lot for working on this @mollyxu ! Left 2 last minor comments below but LGTM

@mollyxu mollyxu merged commit cbe186f into meta-pytorch:main Dec 10, 2025
99 of 102 checks passed
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