Skip to content

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

Closed
voltjia wants to merge 1 commit into
masterfrom
fix/linked-operator-allowlist
Closed

feat(build): select operator implementations from ops.json#923
voltjia wants to merge 1 commit into
masterfrom
fix/linked-operator-allowlist

Conversation

@voltjia

@voltjia voltjia commented Aug 11, 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.
  • 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, 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.

Validation

  • Ruff format/check passed.
  • Focused selector, wrapper, Torch codegen, and linked resolver tests: 93 passed.
  • Concrete CMake configurations covered inline precedence, JSON slot filtering, missing external providers, and linked slot resolution.
  • Final selector commit is based directly on master and does not contain feat(nvidia): add top-k top-p sampling provider #922.

Type of Change

  • feat
  • build / CMake
  • tests
  • docs

Notes

The FlashInfer sampling provider is intentionally a separate stacked change. This PR only establishes the generic implementation-selection mechanism.

@voltjia
voltjia force-pushed the fix/linked-operator-allowlist branch from 0f41435 to 4ba65ce Compare August 13, 2026 15:19
@voltjia voltjia changed the title fix(build): separate linked operator allowlist feat(build): select operator implementations from ops.json Aug 13, 2026
@voltjia
voltjia changed the base branch from feat/nvidia-top-k-top-p-sampling to master August 13, 2026 15:20
@voltjia voltjia closed this Aug 13, 2026
@voltjia
voltjia deleted the fix/linked-operator-allowlist branch August 13, 2026 15:32
@voltjia

voltjia commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #931 after renaming the head branch to match the feat(build) PR title. GitHub automatically closed this PR during the branch rename; the replacement points to the same 4ba65ce commit.

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