Skip to content

Add io/read state machine for copy-based tensor loading #62

@gabewillen

Description

@gabewillen

Summary

Add an io/read state machine under src/emel/io that provides an explicit read/copy tensor-loading strategy beneath tensor-owned residency management.

This issue should land after #59 and #60.

Motivation

Not every platform or deployment mode should rely on memory mapping. We need a separate strategy for explicit file reads / copies into owned buffers.

That strategy has distinct behavior:

  • owned-buffer residency instead of mapped residency
  • explicit transfer/copy lifecycle
  • different error and resource behavior than mmap

It should be implemented as its own io actor rather than folded into tensor orchestration or bundled with other strategies.

Scope

  • Add src/emel/io/... machine(s) for explicit read/copy tensor loading.
  • Define the request/result events needed for tensor-owned loading to request an owned resident buffer from file-backed input.
  • Handle copy-based allocation / transfer success and failure semantics explicitly.
  • Integrate with the tensor-to-io boundary introduced by Add emel/io module and tensor-to-io orchestration boundary #60.

Hard Constraints

  • This issue implements the read/copy strategy only.
  • Tensor lifecycle/residency semantics remain owned by model/tensor.
  • Do not fold mmap or staged/chunked constrained-memory policy into this issue.
  • Keep the strategy boundary explicit enough that later cooperative loading can build on it cleanly.

Acceptance Criteria

  • A dedicated read/copy strategy state machine exists under src/emel/io.
  • Tensor-owned load flow can request copy-based residency through the io boundary.
  • Strategy-specific errors are surfaced explicitly and deterministically.
  • Tests cover success and representative transfer/allocation failures.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions