Skip to content

Tracking Issue: Garbage Collection #9397

Description

@connortsui20

This is a tracking issue for adding the ability to express precise garbage collection in Vortex.

Whether this is a new Array node or a free-standing function, we will want this to live in vortex-array as all of the relevant types to this live there as well.

Motivation

We have several physical encodings (canonical and non-canonical) that can store "garbage" or unreferenced values. These are:

  • ListView: Views can have gaps of unreferenced elements.
  • VarBinView: Similar to ListView, buffers might not be fully utilized.
  • Dict: There can be unreferenced dictionary values
  • DenseUnion (new): stores index offsets into child array which need to be sorted, but not necessarily monotonically increasing (there can be gaps after a filter).

For ListView, we have a bunch of rebuild* methods that are free-standing functions on the ListView type. We generally just call this right before compression, but it is hard to express "garbage collect the list view at this arbitrary point in time" during execution of the array tree. I believe that VarBinView has a similar compaction method.

Dict and DenseUnion have it even worse because they are not canonical types, which means that we basically have zero control over when they can get compacted.

To me, it seems like the only solution here is to have some sort of GarbageCollectArray node in the array tree.

Design

I think that a GarbageCollect array is warranted here, as that allows us to reorder the operation in the array tree. Likely, we always want to "lift" it up to the top of the execution so that we can perform the garbage collection after all lazy operations have had a chance to reduce the work.

We should be able to push down every single operation that has the same input dtype through this array. For example, if I have a list_contains function, we can push that through the garbage collect so that we do not need to do the expensive operation for nothing. And then since the output dytpe of list_contains is a boolean array, the GarbageCollect node becomes a no-op.

Steps

  • Initial implementation
  • Documentation
  • Public API stabilization

Unresolved questions

  • Is it possible to have the same optimization / reordering behavior without expressing this operation as an Array node?

Implementation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    tracking-issueShared implementation context for work likely to span multiple PRs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions