ocannl icon indicating copy to clipboard operation
ocannl copied to clipboard

Get rid of the `array` field of `Tnode.t`, of the "hosted" memory mode, and ideally also of the `Ndarray` module

Open lukstafi opened this issue 4 months ago • 2 comments

We will anyway be moving towards a migration model where buffers can appear and disappear as needed, eventually, from the current static / indefinite lifetime model. So this change will make that a bit easier. But it's important for frontend ergonomics.

lukstafi avatar Aug 04 '25 19:08 lukstafi

To be more precise, we get rid of the Hosted distinction from memory mode, and make everything that's materialized also hosted in the current sense, but only on-demand. We could stay with lazy, but mutable is more future proof as it allows to evict buffers when memory is scarce.

To not replace the set_hosted problem with a set_materialized problem, the Tensor printing function will use this optional trick (off by default for Tensor.print, on for Train.printf) when t_to_print is not materialized -- [%cd "for_print" =: t_to_print] with a cache of the for-print tensor nodes.

lukstafi avatar Aug 06 '25 08:08 lukstafi

Actually, we will make nothing hosted, printing, saving, and accessing selected values will perform on-demand retrieving from the devices.

lukstafi avatar Sep 09 '25 12:09 lukstafi