Git Product home page Git Product logo

matmul_benchmark's Introduction

Matmul benchmark

This is a study on how fast embedded Python in Fortran can be. It compares different matrix multiplication implementations: two implementations using nested loops (in both Fortran and embedded Python) and two implementations that use BLAS libraries (Fortran's intrinsic matmul() and Numpy's np.matmul()).

Compilation

During compilation via make different options can be specified.

  • Compiler (FC): gfortran or ifort
  • Timer (TIMER): CPU_TIME, OMP_WTIME or ICON_WALLCLOCK_TIMER
  • Optimisation (OPT_LEVEL): any, e.g. 2
  • RUN_SET will produce a binary that runs a set of tests, instead of receiving a configuration as arguments

A simple make will compile with default settings as configured in the makefile.

The makefile is made to work on DKRZ's Mistral cluster, but this is only visible in the $PYTHON_PREFIX that is hard coded and the use of module names for the the distinction of Python versions. They makefile can easily adapted by exchanging the $PYTHON_PREFIX with your systems path.

Usage

Compile in the desired configuration (see above), e.g.

make FC=gfortran OPT_LEVEL=2 TIMER=CPU_TIME

Then call from the terminal with the desired configuration, e.g.

./test.exe m 100 10

Here the three input arguments are

  • implementation, choosing between
    • m: Fortran instrinsic matmul()
    • e: Fortran, nested loops
    • n: Numpy's np.matmul()
    • p: Python, nested loops
  • matrix edge length, resulting in edge ** 2 elements
  • repetitions of the same operation, a mean will be given

Alternatively you can compile using the RUN_SET keyword which will produce a binary that runs a hard coded set of implementations and matrix sizes. This is used in the run_set.sh.

Results

work in progress

matmul_benchmark's People

Contributors

suessspeise avatar

Watchers

James Cloos avatar  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.