TinyChain-Inc / TinyChain-Inc/ha-ndarray
Add runtime execution IR, automatic operator fusion, and plan cache
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
- Define typed IR nodes, shapes, dtypes, dependencies, device placement, and materialization boundaries.
- Define legality rules for elementwise fusion first; reductions/transforms require explicit legality tests before inclusion.
- Build deterministic plan keys from operation graph, dtype/shape specialization, runtime/backend, and compiler version.
- Compile and cache fused CubeCL kernels with bounded cache size and invalidation.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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