Skip to content

[MLIR Opt] Static memory lifetime scheduling and zero-runtime allocation #669

Closed

Description

@godofecht

Implement static buffer lifetime scheduling and arena promotion for zero-runtime memory overhead.

Problem & Goal

Dynamic allocations (malloc, free) in computational graphs cause heap fragmentation and synchronization latency.
We want to construct interference graphs of buffer live ranges and allocate a single contiguous scratchpad shared across non-overlapping buffers.

Key Deliverables

  • Build buffer interference graph analysis across Flow AST / MLIR functions.
  • Implement memory reuse passes to fold temporary allocations into shared arenas or stack frames.
  • Support static scratchpad placement in fast on-chip SRAM / GPU shared memory.

Activity

  1. added
    enhancement
    roadmap
    P1-high
    on Aug 21, 2026
  2. godofecht commented on Oct 2, 2026

    @godofecht
    ContributorAuthor

    Added PR #1216 with planner coverage for disjoint lifetime reuse and per-buffer alignment. Local Flow test passes all three static-memory checks.

  3. godofecht commented on Oct 3, 2026

    @godofecht
    ContributorAuthor

    PR #1299 merged at 9a803ff. Static memory planning now guards arena and alignment arithmetic overflow, clamps planner counts, and normalizes invalid alignments. Flow-native suites pass 5/5 and 12/12.

  4. godofecht commented on Oct 3, 2026

    @godofecht
    ContributorAuthor

    PR #1314 adds a regression guard for invalid and unplaceable static-memory buffers. It returns a negative arena size instead of a partial plan. Local bootstrap fixed-point and three-generation self-host checks pass; GitHub required checks are running.

  5. godofecht commented on Oct 3, 2026

    @godofecht
    ContributorAuthor

    PR #1314 merged at 060f4b9. Invalid and unplaceable static-memory buffers now produce a rejected plan instead of a partial arena plan. Bootstrap fixed-point, three-generation self-host, and all required GitHub checks passed.

  6. godofecht commented on Oct 6, 2026

    @godofecht
    ContributorAuthor

    Closing as completed. The work for this issue landed in merged PR #1328. The later Jules PR #1389 was green but empty (no file changes) and has been closed as superseded.

  7. added 11 commits that reference this issue on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highcompilerenhancementroadmap

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions