Skip to content

OOM when histogramming depending on argument order #3948

Description

@jokasimr

Let's say there is a binned data array with two coordinates, one lives "on the binning" (x) and one lives "on the events" (y) and the intention of the user is to create a 2D histogram over y and x.

If the outer binning is large it is easy to run into a situation where performance drops drastically, or the process runs out of memory, for example:

import scipp as sc

# 1 million bins
da = sc.data.binned_x(1000_000, 1000_000)

da.hist(x=200, y=200, dim=da.dims)
# This works.

# Different argument order
da.hist(y=200, x=200, dim=da.dims)
# This crashes the kernel (I assume it OOMs because it tries to create a large intermediate binning).
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