Skip to content

Determine the right tradeoff to use when baby-step-giant-step step sizes are not evenly divisible #2162

@j2kun

Description

@j2kun

Filing issue for pending TODO.

The problem is that when we are lowering rotate-and-reduce via baby-step-giant-step, if the numBabySteps does not divide the total number of steps, we have two options:

  1. Add some extra ops at the end to account for the leftover
  2. Find the closest number to sqrt(n) that does divide steps and use that.

Not sure which is best, and I decided to punt on doing the most optimal thing for now and implementing a naive version of (2). It seems like (2) is suboptimal in extreme cases like a prime number of steps, so the question is how to select between (1) and (2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues suitable for a new contributor's first PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions