Skip to content

Distribution.from_shape is producing localarrays with size 0 #442

Open

Description

@cowlicks

With 4 engines:

In [1]: from distarray.dist import Context, Distribution

In [2]: context = Context()

In [3]: distribution = Distribution.from_shape(context, (9, 8), dist=('b', 'n')) 

In [4]: distribution.localshapes()
Out[4]: [(3, 8), (3, 8), (3, 8), (0, 8)]

This appears to be from this line.

The size of this axis of the grid_shape is set to comm_size, which doesn't divide into the size of the corresponding axis of the DistArray.

Activity

  1. cowlicks commented on Jun 16, 2014

    @cowlicks
    ContributorAuthor

    From some experimenting if we call the processor grid size for an axis p and the distarray size in an axis d then the following must be satisfied

    p < d
    d = p*n + p - n - 1
    

    Where n = p // d so d - p < pn < d.

    From experimenting, it looks like for a given p there are p - 2 cases where the above relations are satisfied and we would end up with an empty localarray.

    It seems like the best solution would be to check if the above conditions are satified in make_grid_shape, if not reduce p by 1 and try again.

  2. added this to the 0.4 milestone on Jun 19, 2014
  3. kwmsmith commented on Jul 7, 2014

    @kwmsmith
    Contributor

    Should be partially addressed by PR #502.

  4. modified the milestones: 0.5, 0.4 on Jul 7, 2014
  5. modified the milestones: 0.5, 0.6 on Aug 8, 2014
  6. modified the milestones: 0.7, 0.6 on Oct 5, 2015
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions