Skip to content

Carriage 3: LayoutAssignmentPass on the production path — one target, one decision - #1184

Merged
michalharakal merged 1 commit into
feature/1179-structural-attrsfrom
feature/1180-layout-pass
Aug 26, 2026
Merged

michalharakal merged 1 commit into
feature/1179-structural-attrsfrom
feature/1180-layout-pass

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

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 runs dagPipelineFor(target) with LayoutAssignmentPass as a core pass, plus whatever the target registered through TargetOptimizers — 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-hlo gains the compile-opt dependency 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-declared ROW_MAJOR is never overridden). Touched nodes are stamped with the backend assignment.
  • The pre-built ResolvedComputeGraph seams stop returning hardcoded null: resolvedLayout derives BlockOrderLayout from what the passes (or the tape) stamped; backendAssignment reads node metadata whose key lives on ResolvedComputeGraph — imported by the pass along the legal opt→dag direction.
  • The known traps are dodged by design: fusion stays un-enabled (only the layout pass runs as core), Minerva stringification is moot (block order is already a string), and no sk.ainet.lang.memory import entered skainet-compile.
  • Tests: pass semantics (decides / never overrides / leaves dense & rank-1 alone; seams surface exactly the decisions made) and the pipeline→emission composition (a decided order reaches the module header as 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

…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>
@michalharakal
michalharakal merged commit 6bbba96 into feature/1179-structural-attrs Aug 26, 2026
1 check passed
@michalharakal
michalharakal deleted the feature/1180-layout-pass branch August 26, 2026 19:15
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