TinyChain-Inc / TinyChain-Inc/ha-ndarray

Add runtime execution IR, automatic operator fusion, and plan cache

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Objective

Represent deferred Array expressions in a backend-neutral execution IR, fuse compatible operator chains at runtime, and cache compiled CubeCL plans without changing observable ndarray semantics.

Procedure

  1. Define typed IR nodes, shapes, dtypes, dependencies, device placement, and materialization boundaries.
  2. Define legality rules for elementwise fusion first; reductions/transforms require explicit legality tests before inclusion.
  3. Build deterministic plan keys from operation graph, dtype/shape specialization, runtime/backend, and compiler version.
  4. Compile and cache fused CubeCL kernels with bounded cache size and invalidation.
  5. Fall back to unfused execution for unsupported graphs with a visible diagnostic.

Acceptance criteria

  • A chain of at least three compatible operations executes as one compiled kernel after planning.
  • Fused and unfused paths pass the same property/conformance tests, including errors and broadcasting.
  • Side-effect, aliasing, ordering, and materialization boundaries prevent illegal fusion.
  • Cache keys are deterministic; hits, misses, compilation time, eviction, and fallback are observable.
  • Cache growth is bounded and stale/incompatible artifacts are rejected.
  • Fusion can be disabled for diagnosis and parity testing.

Parent: #33

Tembo-sized implementation issues

  • #46 — deferred execution IR and materialization boundaries
  • #47 — fusion legality, CubeCL lowering, and bounded cache

Dependency order: #46 → #47. The unfused path must remain enabled as an independent differential oracle.

Tembo program boundary

This parent is a non-executable acceptance rollup. Tembo must be assigned to the child issues, and may not close this issue from a child PR.

automation:
  eligible: false
  executor_profile: tembo
  readiness: rollup
  primary_repository: TinyChain-Inc/ha-ndarray
  base_branch: main
  writable_scope: []
  prerequisites: ["#46", "#47"]
  concurrency_group: cubecl-fusion-rollup
  required_commands: []
  external_actions: none
  draft_pr_only: true
  completion_authority: human

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with child issue #46 on deferred execution IR and materialization boundaries, then follow dependency order to #47 for fusion legality, CubeCL lowering, and bounded caching. Use the unfused path as the differential oracle. Done means the listed acceptance criteria pass, including observable cache behavior, safe fallbacks, bounded growth, and diagnostic disabling.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, compilers, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.