Giter Site home page Giter Site logo

yrrid-gpu's Introduction

Z-Prize MSM on the GPU Submission

Introduction

The following is Yrrid Software's GPU MSM submission to the Z-Prize. The submission is available from our GitHub repository.

Full Run Performance

We generally observe the running time to be between 2500 milliseconds and 2600 milliseconds for a full run of 4 MSMs of size 2^26. Performance is quite dependent on the other workloads running on the same physical machine.

Building and running the submission

Install CUDA 11.7. Install rust, for example, rustup install stable. Next clone the repository, and run the benchmark.

git clone https://github.com/yrrid/submission-msm-gpu
cd submission-msm-gpu
cargo bench

To run the correctness test, use the following command. Note, the util.rs routines generate a small number of points and copy them many times to generate the 2^26 points needed for a run, so that benchmarking and correctness testing can be performed in a reasonable amount of time.

cargo test --release

GPU requiments

Since this is a competition and every millisecond counts, the software has been tuned to run a batch of 4 x 2^26 MSMs on the target GPU, an NVIDIA A40. Our solution requires Compute Capability 8.0 (Ampere) and roughly 46 GB (46 x 2^30 bytes) of memory.

Optimizations in our solution

In this section, we give a high level overview of the optimizations we have used to accelerate the computation:

  • Pippenger bucket algorithm with a 23-bit window.
  • Signed digits. Since 11 windows of 23-bits is exactly 253 bits, we employ the following trick. If the MSB of the scalar is set, we negate the scalar and point, and continue processing normally. This works since:
       (M - s) (-P) = -s (-P) = s P
  • Pre-process all of the scalars to generate lists of points to add to each bucket.
  • The buckets are then sorted, such that the buckets with the most points are run first. This allows the GPU warps to run convergent workloads and minimizes the tail effect.
  • For an input point Pi, we precompute 6 points: 246 Pi, 292 Pi, 2138, ..., 2230 Pi. This allows us to compress our 11 windows down to 2 windows, since, for example, adding Pi to window 4 is the same as adding 292 Pi to window 0.
  • The pre-processing sorting routines are custom written and are very fast and efficient. Much faster than CUB based solutions.
  • The FF and EC routines have been carefully optimized:
    • Based on Montgomery multiplication
    • Minimize correction steps in the FF operations
    • Use an XYZZ representation for the EC point accumulators
    • Use fast squaring

Questions

For technical questions about this submission, please contact nemmart at yrrid.com.

yrrid-gpu's People

Contributors

nemmart avatar yrrid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.