Skip to content

Top-k cost rows: CMS/CountSketch+heap exclude the heap from memory, UnivMon includes it #146

Closed

Description

@milindsrivastava1997

Problem

The top-k rows in the rqe-optimizer cost table don't count memory the same way:

  • CMS+heap and CountSketch+heap leave the heap out. memory_bytes is rows × cols × size_of::<i32>(), with a comment saying the heap of at most CMS_HEAP_TOP_K = 32 items is negligible (sketch-bench/src/wrappers/cms_heap/sketchlib.rs:50-55, sketch-bench/src/wrappers/cs_heap.rs:35-37).
  • UnivMon counts its heaps: layer_size × (counters + heap_size × size_of::<HHItem>()) (sketch-bench/src/wrappers/univmon/sketchlib.rs:51-56).

All three are Capability::TopK candidates in rqe-optimizer. Its candidate pruning and the MILP's memory term compare mem_bytes_per_instance across them, so they aren't compared like for like.

Fix

Add the heap to the CMS+heap and CountSketch+heap footprints: CMS_HEAP_TOP_K entries of (key, count). Then re-run scripts/export_rqe_optimizer_costs.sh.

Related

🤖 Generated with Claude Code

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions