Carriage 3: LayoutAssignmentPass on the production path — one target, one decision - #1184
Merged
michalharakal merged 1 commit intoAug 26, 2026
Merged
Conversation
…one decision Carriage slice 3 (#1147): the optimizer pipeline joins the production tape→HLO path, and the first real layout decision runs on it. - HloGenerator.generate gains target: String? = null. Null — the default — runs no pipeline and emits byte-identically to before; a named target runs dagPipelineFor(target) with LayoutAssignmentPass as a core pass, plus whatever the target registered through TargetOptimizers. compile-hlo gains the compile-opt dependency this wiring always implied (opt depends on dag; no cycle). - LayoutAssignmentPass, deliberately narrow: rank-2 block-quantized weights (the GGML block formats) get kernel-feed order (INPUT_BLOCK_MAJOR) for the target — mirroring the decision the eager form resolver makes at load (#1120) — and never overrides an order the tape already carried: the loader's fact outranks the pass's preference. Touched nodes are stamped with the backend assignment. - The pre-built ResolvedComputeGraph seams stop returning hardcoded null: resolvedLayout derives BlockOrderLayout from the spec the passes (or the tape) stamped; backendAssignment reads the node metadata key, which lives on ResolvedComputeGraph so the pass imports it along the legal opt→dag direction. - Tests: pass semantics (decides / never-overrides / leaves dense and rank-1 alone; seams surface exactly the decisions made) and the pipeline→emission composition (a decided order reaches the module header as block_order; with no pipeline, no order is invented). Closes #1180. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #1180 (parent #1147, carriage slice 3 of 3). Stacked on #1183 — merge order: #1183 → this ("delete branch" each time and the retarget is automatic).
The optimizer pipeline joins the production tape→HLO path, and the first real layout decision runs on it.
HloGenerator.generate(target: String? = null)—null(the default) runs no pipeline and emits byte-identically to before (pinned: no order is invented without a pass); a named target runsdagPipelineFor(target)withLayoutAssignmentPassas a core pass, plus whatever the target registered throughTargetOptimizers— the registry that existed since [S0.9] Golden parity gate + PR gate script + benchmark baseline (guards every memory-architecture slice) #1005 and was never on the production path until now.compile-hlogains thecompile-optdependency this wiring always implied (opt→dag, no cycle).LayoutAssignmentPass, deliberately narrow: rank-2 block-quantized weights (the GGML block formats) get kernel-feed order (INPUT_BLOCK_MAJOR), mirroring the decision the eager form resolver makes at load (Packed storage that knows its own block order, so KERNEL_FEED can reach a kernel #1120) — and the tape's carried fact always outranks the pass's preference (a loader-declaredROW_MAJORis never overridden). Touched nodes are stamped with the backend assignment.ResolvedComputeGraphseams stop returning hardcodednull:resolvedLayoutderivesBlockOrderLayoutfrom what the passes (or the tape) stamped;backendAssignmentreads node metadata whose key lives onResolvedComputeGraph— imported by the pass along the legal opt→dag direction.sk.ainet.lang.memoryimport enteredskainet-compile.block_order = "INPUT_BLOCK_MAJOR").With this merged, all three carriage slices are in and #1147 can close — leaving #1148 as the placeholder for the IREE-validation SKEEP per the agreed strategy (conformity via SKaiNET-transformers, post-release).
Full pr-gate green.
🤖 Generated with Claude Code