Add model-first provider boundary and split kernel implementations - #628
Open
devteapot wants to merge 2 commits into
Open
Add model-first provider boundary and split kernel implementations#628devteapot wants to merge 2 commits into
devteapot wants to merge 2 commits into
Conversation
devteapot
force-pushed
the
t3code/analyze-kernel-core-interface
branch
from
July 29, 2026 17:26
6a278e3 to
1465498
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
models/<model>/.Architectural boundary
The extension point is
ds4_model_provider_v1: a whole-model lifecycleinterface, not an abstraction over kernels, tensors, operators, or graphs.
The engine core owns loading, tokenizer/session lifecycle, placement,
checkpoint transport, and provider selection. Each model integration owns its
provider table, CPU/reference path, graph state and scheduling, and custom
backend implementations.
Kernel code remains concrete and specialized. The
.incand.cuhfiles aresource-ownership units included once by the existing engine/backend entry
points. This adds no virtual kernel dispatch, generic operator layer,
synchronization boundary, or hot-path runtime overhead. Shared code stays
common only where models already use the same low-level contract; duplication
between model-tuned paths remains acceptable.
This creates a strong core seam for future model integrations and leaves open
the option of a small
ds4-corewith model-specific integrations or forks.Before and after
Before, ownership followed the translation unit or backend, so model code was
spread across root and backend directories:
After, model ownership is the first directory boundary on every backend:
The Metal mixed shader source was split into model-owned segments while
preserving its original byte order when the runtime assembles the library.
Testing
test_session_snapshot: OK tokens=10 payload=13623728 bytes.Metal compilation is unavailable on this Linux host.
unavailable because
hipccis not installed on this host.