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

Multicore improvements #69

Merged
merged 24 commits into from Sep 2, 2021
Merged

Multicore improvements #69

merged 24 commits into from Sep 2, 2021

Commits on Jun 4, 2021

  1. feat: allow controll of the maximum number of cpus using BELLMAN_NUM_…

    …CPUS
    
    (cherry picked from commit 37686f8)
    dignifiedquire authored and str4d committed Jun 4, 2021
    Copy the full SHA
    d90bb21 View commit details
    Browse the repository at this point in the history
  2. feat(groth16): control parallel proving threads

    Uses the existing env variable to restrict the number of threads used for parallel proving.
    
    Cleaned up version of #81
    
    (cherry picked from commit 0c1868d)
    
    pick:
    - Only the changes to bellman::multicore.
    - Added lazy_static and rayon dependencies.
    dignifiedquire authored and str4d committed Jun 4, 2021
    Copy the full SHA
    2b7a58b View commit details
    Browse the repository at this point in the history
  3. fix: only spawn threads into a pool, to avoid unlimited thread spawns

    (cherry picked from commit dca4c5a)
    
    pick: Only the changes to bellman::multicore.
    dignifiedquire authored and str4d committed Jun 4, 2021
    Copy the full SHA
    4970b8f View commit details
    Browse the repository at this point in the history
  4. feat: limited thread spawning and unroll recursion in multiexp

    (cherry picked from commit c55d5e4)
    
    Changes during pick:
    - Excluded GPU-related changes (not upstreamed yet).
    - Added fix for change to Field::double API.
    - Fixed no-multicore Worker impl.
    
    Co-authored-by: Jack Grigg <thestr4d@gmail.com>
    dignifiedquire and str4d committed Jun 4, 2021
    Copy the full SHA
    b4276a3 View commit details
    Browse the repository at this point in the history
  5. chore: log error if waiter is used within a thread pool

    If a waiter is used from within a thread pool it might deadlock. Don't
    do that.
    
    (cherry picked from commit dc13606)
    vmx authored and str4d committed Jun 4, 2021
    Copy the full SHA
    4d85780 View commit details
    Browse the repository at this point in the history
  6. feat: fix bug in parallelism inherent in the Worker/Waiter model

    The Worker/Waiter model creates a Worker that requests that threads
    be spawned to complete some work.  Since there is no bound to the
    number of requests for work, it's possible to exhaust memory with
    pending closures waiting to be processed.
    
    This was not an issue when 'everything was bounded by a single thread
    pool', however that setup has race conditions built into it.
    
    We have recently spent time splitting that model out, and this should
    be the final step required.
    
    This code places a limit on the number of requests that can be queued
    in an attempt to lessen the chance of memory exhaustion due to pending
    requests.  It does this by placing a limit that is a simple multiple of
    the number of cores available (and in testing is far below observed
    crash criteria).  When the number of requests for spawning new threads
    reaches that limit, instead of adding a new request, we block on execution
    to help clear the backlog.
    
    (cherry picked from commit 74947c0)
    
    pick: Also includes log change from b481a34
    vmx authored and str4d committed Jun 4, 2021
    Copy the full SHA
    7d7c453 View commit details
    Browse the repository at this point in the history
  7. style: remove verbose logging

    (cherry picked from commit 007487f)
    cryptonemo authored and str4d committed Jun 4, 2021
    Copy the full SHA
    103113a View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    360788d View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    9f05fec View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    d7ec539 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    510b908 View commit details
    Browse the repository at this point in the history
  12. Remove broken intra-doc link

    str4d committed Jun 4, 2021
    Copy the full SHA
    6e9f575 View commit details
    Browse the repository at this point in the history
  13. multicore: Unconditionally panic if Waiter::wait is called from threa…

    …dpool
    
    
    This occurring is a programming error.
    
    Co-authored-by: Daira Hopwood <daira@jacaranda.org>
    str4d and daira committed Jun 4, 2021
    Copy the full SHA
    22caab9 View commit details
    Browse the repository at this point in the history
  14. multicore: Code simplification

    Co-authored-by: Daira Hopwood <daira@jacaranda.org>
    str4d and daira committed Jun 4, 2021
    Copy the full SHA
    a4b4e14 View commit details
    Browse the repository at this point in the history
  15. multicore: Documentation tweaks

    Co-authored-by: Daira Hopwood <daira@jacaranda.org>
    str4d and daira committed Jun 4, 2021
    Copy the full SHA
    7d81964 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2021

  1. Update dependencies.

    Signed-off-by: Daira Hopwood <daira@jacaranda.org>
    daira committed Aug 15, 2021
    Copy the full SHA
    6916c3b View commit details
    Browse the repository at this point in the history
  2. Use global threadpool unless we exceed WORKER_SPAWN_MAX_COUNT. This…

    … is expected to play more nicely
    
    with other uses of rayon in the same process (avoiding excess parallelism).
    
    Signed-off-by: Daira Hopwood <daira@jacaranda.org>
    daira committed Aug 15, 2021
    Copy the full SHA
    1815042 View commit details
    Browse the repository at this point in the history
  3. Rename multicore::log_num_cpus to log_num_threads.

    Signed-off-by: Daira Hopwood <daira@jacaranda.org>
    daira committed Aug 15, 2021
    Copy the full SHA
    1e39743 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2021

  1. Copy the full SHA
    313245b View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2021

  1. Simplify by removing the overflow thread pool

    Co-authored-by: str4d <thestr4d@gmail.com>
    daira and str4d committed Aug 26, 2021
    Copy the full SHA
    e3a4ea6 View commit details
    Browse the repository at this point in the history
  2. Bugfix: log_num_cpus should be renamed also for the dummy (non-mult…

    …icore) implementation.
    
    Signed-off-by: Daira Hopwood <daira@jacaranda.org>
    daira committed Aug 26, 2021
    Copy the full SHA
    a94da42 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #71 from daira/daira-multicore

    Use global rayon threadpool for multicore
    str4d committed Aug 26, 2021
    Copy the full SHA
    6af1fcf View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2021

  1. Copy the full SHA
    5e68a2e View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2021

  1. Copy the full SHA
    2c96556 View commit details
    Browse the repository at this point in the history