Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize dettman algorithm #1601

Merged
merged 27 commits into from
May 19, 2023
Merged

Optimize dettman algorithm #1601

merged 27 commits into from
May 19, 2023

Commits on May 17, 2023

  1. Began trying to make the optimization. from here, making the optimiza…

    …tion should consist of just writing "register_width = 64" in Arith/DettmanMultiplcation. something broke.
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    2e293f9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    878dd64 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7547ccc View commit details
    Browse the repository at this point in the history
  4. In its state before this commit, the reduce_carry_borrow

    function did rather unreasonable things when the limbwidth was fractional.
    
    In this commit, I tried to fix this issue, but I ended up making the
    reduce_carry_borrow function pretty obnoxious.  Also, fixing this issue
    requires somewhat strange (and strong) hypotheses on the weight function.
    We'd want, for instance,
    
    (weight (2 * limbs - 2) / weight (limbs - 2)) mod s = 0.
    
    I plan to revert my changes (from this commit) to the reduce_carry_borrow
    function, so that it will continue to do unreasonable things given fractional
    limbwidths.  This was not worth it.
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    fd4ee40 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8fb6a87 View commit details
    Browse the repository at this point in the history
  6. decided to keep the messy-ish, fractional-limbwidth-friendly implemen…

    …tation. wrote some (messy) arithmetic proofs. still more proofs to go in Arithmetic/DettmanMultiplication.v. Then need to change PushButtonSynthesis appropriately.
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    ba042cf View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6cb81cb View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2696dec View commit details
    Browse the repository at this point in the history
  9. changed PushButtonSynthesis/DettmanMultiplication.v to reflect change…

    …s to Arithmetic/DettmanMultiplication.v
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    9a1c67f View commit details
    Browse the repository at this point in the history
  10. ran make

    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    bc0a990 View commit details
    Browse the repository at this point in the history
  11. made proofs a bit nicer

    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    a21e03c View commit details
    Browse the repository at this point in the history
  12. made proofs nicer

    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    0e6448b View commit details
    Browse the repository at this point in the history
  13. made proofs a bit nicer

    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    5bd1fe6 View commit details
    Browse the repository at this point in the history
  14. Cleaned up PushButtonSynthesis/DettmanMultiplication.v

    Replaced a bunch of references to (Z.log2_up s) with (Z.log2 s), since (in
    the dettman_multiplication_mod_ops module) we now stipulate that s is a power
    of 2.
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    4450dfa View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    59753ff View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4f7cb68 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    19cdc41 View commit details
    Browse the repository at this point in the history
  18. tried out another draft of the rewrite rule. this one successfully el…

    …iminated the unnecessary 64-bit mask, but it also caused weird stuff to happen and killed off a bunch of 52-bit masks. Where'd they go? idk.
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    43f2f3d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    2144195 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    a559efd View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    a70781b View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    799c212 View commit details
    Browse the repository at this point in the history
  23. I moved the new rewriting pass (ArithWithRelaxedCasts) that I added.

    It now comes later in the rewriting process.
    Apparently it's important that it comes after the fancy stuff.
    For reasons that I don't understand, proofs in Barrett256 and Montgomery256 break if
    I put it before.
    OwenConoly committed May 17, 2023
    Configuration menu
    Copy the full SHA
    6e951d0 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2023

  1. fixed error with generating C code I think?

    In this commit, I just removed the bit about dead code elimination that I
    added in BoundsPipeline.v.
    The C code synthesizes without error now, at least.
    I haven't built everything yet, so we'll see if things actually work nicely.
    OwenConoly committed May 18, 2023
    Configuration menu
    Copy the full SHA
    aa4babd View commit details
    Browse the repository at this point in the history
  2. ran make after [fixing the redundant-land-removing rewrite pass

    by removing the dead-code-elimination thing]
    OwenConoly committed May 18, 2023
    Configuration menu
    Copy the full SHA
    822615f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c78648d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2bba8e2 View commit details
    Browse the repository at this point in the history