Skip to content

feat(build): select operator implementations from ops.json - #931

Merged
voltjia merged 1 commit into
masterfrom
feat/operator-implementation-selection
Aug 19, 2026
Merged

feat(build): select operator implementations from ops.json#931
voltjia merged 1 commit into
masterfrom
feat/operator-implementation-selection

Conversation

@voltjia

@voltjia voltjia commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extends INFINI_OPS_OPS so it accepts a user-owned ops.json that selects exact implementation slots per operator.
  • Uses one normalized selection for wrapper generation, linked dependency resolution, and generated Torch operators.
  • Preserves the existing comma-separated operator allowlist and legacy external header-list JSON format, including structured {path, backend} descriptors.
  • Removes the need for a separate INFINI_OPS_LINKED_OPS configuration surface.

Example:

{
  "add": {"implementations": [0]},
  "argmax": {"implementations": [8]},
  "top_k_top_p_sampling_from_logits": {"implementations": [16]}
}

Motivation

Operator names alone cannot express builds that need one implementation while excluding another provider of the same operator. Selecting by the existing implementation slot keeps native, generated Torch, Triton, and linked providers under the same configuration model and avoids resolving or linking unselected external dependencies.

Compatibility

  • -DINFINI_OPS_OPS=add,gemm retains its current operator-level behavior.
  • -DINFINI_OPS_OPS=/absolute/path/ops.json enables slot selection.
  • A repository-root user ops.json remains supported when the CMake option is unset.
  • The repository does not ship a default ops.json; the file is a consumer-owned build input.
  • Slot arrays are sets, not priority lists. Runtime default selection remains the first active slot.
  • Legacy string/string-array header paths and structured {path, backend} descriptors remain supported.

Validation

  • Ruff format/check passed.
  • Focused parser/resolver tests: 50 passed.
  • Wrapper and Torch codegen tests: 59 passed; the packaged-ATen case requiring torchgen is covered by the hosted NVIDIA build.
  • Concrete CMake configurations cover inline precedence, JSON slot filtering, missing external providers, linked slot resolution, and implementation-header reconfigure dependencies.
  • Hosted documentation, Ruff, clang-format, NVIDIA, Iluvatar, MetaX, Moore, and Cambricon checks passed before the documentation-only wording clarification; current-head checks are running.
  • The previous Ascend shadow task timed out after 3600 seconds waiting for an Ascend device (resource_timeout); the regular Ascend job was cancelled in the same device-lease window. Neither reached selector compilation or tests.
  • The selector commit is based directly on master and does not contain feat(nvidia): add top-k top-p sampling provider #922.

Notes

This replaces #923, which GitHub automatically closed when its head branch was renamed to align the branch type with the feat(build) title.

The FlashInfer sampling provider remains a separate stacked change in #930.

@voltjia
voltjia force-pushed the feat/operator-implementation-selection branch from 87a242b to 5c7ef80 Compare August 18, 2026 09:34
@voltjia voltjia changed the title feat(build): select operator implementations from ops.json feat(build): select operator implementations from ops.json Aug 19, 2026
@voltjia
voltjia merged commit 8773433 into master Aug 19, 2026
12 of 20 checks passed
@voltjia
voltjia deleted the feat/operator-implementation-selection branch August 19, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant