fix(ops): select active implementation for configless calls - #910
Draft
voltjia wants to merge 1 commit into
Draft
Conversation
20 tasks
voltjia
force-pushed
the
fix/select-active-implementation-by-default
branch
from
August 7, 2026 19:12
871deaf to
e7b9e38
Compare
voltjia
force-pushed
the
fix/select-active-implementation-by-default
branch
from
August 8, 2026 00:43
e7b9e38 to
b43e564
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Operator::MakeandOperator::Callselect the first active implementation for the input device.Configbehavior.Motivation
Generated Python bindings already choose the first active implementation when a caller omits
implementation_index. The configless C++ convenience overloads instead constructedConfig{}, which always selected slot 0. Operators implemented only by a linked provider at slot 16 therefore failed even though a valid implementation was active.The default cannot be derived from
ActiveImplementationsin a downstream translation unit because installed public headers do not expose backend specializations. This change emits one scalar resolver instantiation per operator in an implementation-visible generated source file and only declares it in the installed header.N/A - no linked issue.
Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvementrefactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changesPlatforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_HYGON)WITH_TORCH)Smoke Test Result
Remote environment:
ssh nvidia,accelerator-dev/nvidia:latest, PyTorch2.10.0a0+b4e4ee8.The smoke allowlist is unchanged.
Focused Test Results
The installed consumer test uses the real generated
Absslot 8 path for configlessMakeandCall. Existing Add coverage exercises slot 0 andCallReturning; a test-only slot 16 operator covers tensor-list descriptor construction.The remote consumer compiler temporarily suppressed deprecation warnings emitted by legacy operators already present in the smoke-generated umbrella header. No deprecation behavior is changed in this PR.
Benchmark / Performance Impact
The default implementation query returns a scalar and runs only while entering a configless API. It does not allocate a vector and does not change kernel execution.
Notes for Reviewers
Configderive a default from the device's active implementations.Make(config, ...)andCall(handle, config, ...)still honor the exact requested index and never fall back.Makekeeps its public forwarding-reference signature and normalizes only the internal generated-factory call to the existingconst T&explicit instantiations.CallReturningis covered because it delegates to configlessCallafter allocating the return tensor.