Skip to content

Conversation

@NicolasHug
Copy link
Contributor

@NicolasHug NicolasHug commented Oct 20, 2025

This PR adds a _core utility to get details about the current backend / interface being used. It reports:

  • the name of the interface (CPU, FFmpeg CUDA, Beta CUDA)
  • whether a CPU fallback is happening for FFmpeg CUDA and Beta CUDA.

This utility is needed for testing, see resolved TODO in our tests. I also expect it will also be useful for debugging purposes, e.g. when working on #943. We might want to eventually expose it publicly, so that users know whether a fallback is happening or not.

ATM, the returned value is a string with no particular structure. I think that's fine for now. Everything is private. We can think of defining something more structured later (keeping in mind that our custom ops don't have much flexibility in terms of what can be returned).

The new functionality is exposed as:

  • _core._get_backend_details(decoder: torch.Tensor) -> str
  • std::string SingleStreamDecoder::getInterfaceDetails()
  • std::string DeviceInterface::getDetails()

Happy to bikeshed on the names.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 20, 2025
@NicolasHug NicolasHug changed the title Add _core._get_backend_details() utility Add _core._get_backend_details() utility for testing and debugging Oct 20, 2025
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.

Looks good! Maybe we should add device to the function names, to be clearer on what they get?
getDetails -> getDeviceDetails
getInterfaceDetails -> getDeviceInterfaceDetails

@scotts
Copy link
Contributor

scotts commented Oct 20, 2025

There's at least one other thing we may want to expose such a private function for for testing: color space library. We have tests that exercise the different color space libraries, but we can't know for sure from the outside which one we're using.

@NicolasHug NicolasHug merged commit 75a3325 into meta-pytorch:main Oct 21, 2025
59 checks passed
@NicolasHug NicolasHug deleted the fallback-expose branch October 21, 2025 16:05
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