[Docs] Describe op to kernel dispatch as kernel interfaces and implementations - #59
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new manifest-family precedence and Sampling-page routing lack focused renderer coverage.
Review effort: Balanced
Findings: 1
What changed in this PR
Updates dispatch documentation to match TileOPs’ current kernel-interface model and extends benchmark rendering for Sampling.
Changes:
- Documents kernel interfaces, implementations, and backend extension paths bilingually.
- Corrects obsolete dispatch examples and terminology.
- Adds manifest-driven Sampling benchmark classification and navigation.
| File | Description |
|---|---|
scripts/gen_bench_pages.py |
Adds manifest-family routing and Sampling pages. |
mkdocs.yml |
Adds Sampling navigation translation. |
hooks.py |
Adds Sampling to benchmark navigation order. |
docs/torch-compile.md |
Updates the English dispatch example. |
docs/torch-compile.zh.md |
Updates the Chinese dispatch example. |
docs/new-op.md |
Documents current kernel selection architecture. |
docs/new-op.zh.md |
Chinese counterpart of the new-op updates. |
docs/manifest.md |
Replaces obsolete kernel-role terminology. |
docs/manifest.zh.md |
Updates corresponding Chinese terminology. |
docs/backends.md |
Documents three backend integration mechanisms. |
docs/backends.zh.md |
Chinese counterpart of backend guidance. |
CLAUDE.md |
Refreshes repository development conventions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+213
to
+215
| fam = _MANIFEST_FAMILY.get((manifest_family or "").lower()) | ||
| if fam: | ||
| return fam |
…tations The dispatch migration replaced the op-level hooks the manual still taught. An op declares `interfaces`, `kernel_for(interface, call)` takes two arguments, and the implementations of an interface state their own availability, applicability, precedence and `entry_for`. The role concept, the op-level `entry_for` and the `kernel_for` path for an op with no interfaces are gone. new-op rewrites the kernel-selection section against that model, with the real `GemmFwdOp`, `GemmFwdInterface` and `RMSNormKernel`. backends gains the three extension granularities, `kernel_map=` and `register_implementation` beside a target, and drops the claim that an op may leave `entry_for` out. torch-compile gives `RMSNormFwdOp` its `interfaces` and its real `_eager_forward` body. manifest renames a composite's kernel roles to kernel keys. The backends pages also stated that no target is used unless a backend claims the device, which the same page contradicts forty lines earlier by documenting `set_default_target`.
…e lint TileOPs #2352 fixed the interface naming rule and added interface-names-lint after this branch was written.
The Chinese dropped subjects and compressed clauses to the point of reading as notes: the dispatcher, the op and the implementation are now named where they act. Three places defined a thing by what it is not and now say what it is. Replaced the invented word for making a tensor contiguous, and the one for the builder, with what they do.
lcy-seso
force-pushed
the
docs/dispatch-mechanism
branch
from
October 1, 2026 05:21
bbd499d to
bd89ba9
Compare
Twelve places where the two languages had drifted into each other: a spatial metaphor for a mapping, an implementation that 'reaches' an instance, a coined 'place' for a kernel call, builder translated two different ways and once as constructor, and two defaults defined by what they are not.
An ungrammatical English clause left by the previous fix, a Chinese sentence that still ranked the three mechanisms by size, implementations attached to a call rather than to the interface they implement, and one sentence corrected in Chinese but not in English.
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.

Problems
new-opteachesrole, a three-argumentkernel_for(role, inputs, call)and an op-levelentry_for(role, call). None of those exist; the op→kernel dispatch migration removed them. Itskernel_typeskeys are invented, and its_eager_forwardcalls aself._call_spec(...)the base class does not define. It never mentionsinterfaces, which every op holding kernels now declares.backendssayskernel_forandentry_forare the op author's and that an op with no in-tree implementation may leaveentry_forout. It predatesregister_implementation, so a backend is offered only a target. Its "why selection has two layers" section says TileOPs does no candidate filtering, which now holds only of the target path.torch-compiledeclareskernel_typesand nointerfacesin its op skeleton, and callskernel_forwith three arguments.manifestcalls a composition stage's target a kernel role.Changes
new-opgains a kernel-selection section: the two arguments ofkernel_for, what a kernel interface is and where it lives, the four declarations an implementation makes (devices/supported_archs,applies/refusal,general/preferred_over,entry_for) with their defaults, andGemmFwdOp's three implementations as the worked example.backendsgains a section comparing the three ways in —kernel_map=replaces one implementation for one op instance,register_implementationadds an implementation to an interface, a target replaces the whole op — and states for each what it changes, what it acts on, which contract it is written against, and what happens to a call it does not serve.gemm_cp_async's refusal of a K row narrower than one four-byte load, and the claim that the protocol has no default target, which the same page contradicts by documentingset_default_target.mainand names the file it came from.