Add _core._get_backend_details() utility for testing and debugging
#987
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
_coreutility to get details about the current backend / interface being used. It reports: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) -> strstd::string SingleStreamDecoder::getInterfaceDetails()std::string DeviceInterface::getDetails()Happy to bikeshed on the names.