Skip to content

[Fusion][F2] Implement fusion legality, CubeCL lowering, and bounded plan cache #47

Description

@code-tc

Objective

Fuse compatible IR subgraphs at runtime, lower them to CubeCL kernels, and cache compiled plans with deterministic keys and bounded storage.

Acceptance criteria

  • A documented legality table covers operations, layouts, broadcasting, aliases, devices, errors and materialization boundaries.
  • A representative chain of at least three compatible operations dispatches one kernel.
  • Fused/unfused differential and property tests agree for results and typed failures.
  • Unsupported or illegal graphs visibly fall back to unfused execution.
  • Plan keys include graph, shape/dtype specialization, runtime/device capabilities, CubeCL/compiler versions and relevant options.
  • Hits, misses, compile time, eviction, invalidation and fallback are observable; memory/disk growth is bounded.
  • Fusion can be disabled to provide an independent oracle.

Parent: #37

Tembo execution contract

automation:
  eligible: true
  executor_profile: tembo
  readiness: blocked
  primary_repository: TinyChain-Inc/ha-ndarray
  base_branch: main
  writable_scope:
    - src/fusion/**
    - src/ir/**
    - src/cubecl/**
    - tests/fusion/**
    - benches/**
  prerequisites:
    - "#50 designated accelerator validation lane"
    - "#46"
    - "#42"
    - "#43"
  concurrency_group: array-fusion-runtime
  required_commands:
    - "cargo fmt --all -- --check"
    - "cargo test --no-default-features --features cubecl"
    - "cargo test --all-features"
  evidence:
    cpu_conformance: required
    accelerator_conformance: required-on-designated-runner
    actual_browser: not-required
    benchmark_report: required
    exact_hardware_and_driver_identity: required
  external_actions: none
  draft_pr_only: true
  completion_authority: human
  budget:
    size: large
    max_revisions: 3
    max_wall_minutes: 180

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions