Code Monkey home page Code Monkey logo

dg_benchmarks's Introduction

dg_benchmarks

Run DG-FEM benchmarks for different arraycontext implementations. These benchmarks generate arraycontext-based Python code for the operators' RHS to avoid time spent in the setup phases of the driver (mesh gen, computing geometry factors, etc.) and evaluate the performance of the generated code.

Installation

$ # Install Mirge-Com
$ git clone https://github.com/illinois-ceesd/emirge
$ cd emirge; ./install.sh
$ cd ..; source emirge/miniforge/bin/activate ceesd
$ git clone https://github.com/kaushikcfd/dg_benchmarks
$ cd dg_benchmarks; pip install -e .

Supporting literal data is made available via pickled files. Run the following commands to get the pickle blobs for the current suite.

$ cd dg_benchmarks
$ python download_pickled_files.py

WARNING: The above command downloads pickled files approx. 800MB in size. To avoid network traffic and for better security practices, see dg_benchmarks/suite_generators.py to generate them.

HOWTO: Run the timing suite

$ cd dg_benchmarks
$ python -O  run.py --equations "wave,euler,cns_without_chem" \
                    --degrees "1,2,3,4" \
                    --dims "3" \
                    --actxs "pyopencl,jax:jit,pytato:batched_einsum"
GFLOPS/s for 3D-wave:
╒════╤══════════╤═════════╤═══════════════════════╤══════════╕
│    │ pyopencl │ jax:jit │ pytato:batched_einsum │ Roofline │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P1 │ 5.3      │ 33.1    │ 112.1                 │ 441.1    │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P2 │ 5.1      │ 86.7    │ 224.5                 │ 707.9    │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P3 │ 5.5      │ 193.8   │ 428.5                 │ 1163.9   │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P4 │ 4.2      │ 377.2   │ 645.9                 │ 1874.8   │
╘════╧══════════╧═════════╧═══════════════════════╧══════════╛

GFLOPS/s for 3D-euler:
╒════╤══════════╤═════════╤═══════════════════════╤══════════╕
│    │ pyopencl │ jax:jit │ pytato:batched_einsum │ Roofline │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P1 │ 23.0     │ 44.9    │ 225.8                 │ 770.0    │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P2 │ 25.8     │ 81.1    │ 281.6                 │ 971.7    │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P3 │ 31.7     │ 136.0   │ 355.9                 │ 1326.4   │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P4 │ 40.9     │ 217.7   │ 485.8                 │ 1897.8   │
╘════╧══════════╧═════════╧═══════════════════════╧══════════╛

GFLOPS/s for 3D-cns_without_chem:
╒════╤══════════╤═════════╤═══════════════════════╤══════════╕
│    │ pyopencl │ jax:jit │ pytato:batched_einsum │ Roofline │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P1 │ 8.2      │ 35.1    │ 147.8                 │ 510.3    │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P2 │ 7.7      │ 80.5    │ 282.2                 │ 722.0    │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P3 │ 7.8      │ 160.6   │ 373.1                 │ 1087.5   │
├────┼──────────┼─────────┼───────────────────────┼──────────┤
│ P4 │ 5.6      │ 283.3   │ 466.4                 │ 1650.2   │
╘════╧══════════╧═════════╧═══════════════════════╧══════════╛

HOWTO: Add new arraycontext implementations to compare

Update run.py to include your arraycontext type. We are happy to accept PRs for your arraycontext type.

HOWTO: Add new tests to the suite

Implement the new operators in dg_benchmarks/suite/, invoke

$ python -m suite_generators -h
usage:  python -m suite_generators [-h] --equations E --dims D --degrees G

Generate DG-FEM benchmarks suite

optional arguments:
  -h, --help     show this help message and exit
  --equations E  comma separated strings representing which equations to time (for ex. 'wave,euler,cns_with_chem,cns_without_chem')
  --dims D       comma separated integers representing the topological dimensions to run the problems on (for ex. 2,3 to run 2D and 3D versions of the
                 problem)
  --degrees G    comma separated integers representing the polynomial degree of the discretizing function spaces to run the problems on (for ex. 1,2,3 to run
                 using P1,P2,P3 function spaces)

LICENSE

MIT (see LICENSE.txt)

dg_benchmarks's People

Contributors

kaushikcfd avatar mitkotak 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.