Coder Social home page Coder Social logo

sunshaoce / rvv-bench Goto Github PK

View Code? Open in Web Editor NEW

This project forked from camel-cdr/rvv-bench

0.0 0.0 0.0 123 KB

A collection of RISC-V Vector (RVV) benchmarks to help developers write portably performant RVV code

License: MIT License

Shell 0.20% C++ 0.32% C 45.40% Assembly 52.74% Makefile 1.33%

rvv-bench's Introduction

RISC-V Vector benchmark

A collection of RISC-V Vector (RVV) benchmarks to help developers write portably performant RVV code.

Benchmark results can be found at: https://camel-cdr.github.io/rvv-bench-results

Benchmarks (./bench/)

Contains a bunch of benchmark of different implementations of certain algorithms.

RVV code is currently only written in assembly, and uses ./thirdparty/rvv-rollback.S to support RVV 0.7.1 and RVV 1.0.

Instruction cycle count (./instructions/)

Measures the cycle count of RVV instructions by unrolling and looping over the given instruction repeatedly.

Getting started

Start by configuring ./config.mk, such that make works and optionally ./run.sh, which allows you to compile and run using make run.

The default configuration should work with all recent clang builds and doesn't require a full cross compilation toolchain, because it builds in freestanding mode. This means it will only work on linux, or linux syscall compatible OS. You can either modify the platform specific code at the beginning of ./nolibc.h, or configure ./config.mk to build a hosted build.

If you have a rvv 0.7.1 supporting board (which is as of now almost certain), make sure to use a rvv 0.7.1 compatible toolchain. I've used this one for development.

Running benchmarks (./bench/)

To run the benchmarks, first look through (./bench/config.h) and adjust it to your processor (e.g. set HAS_E64). If it takes too long to execute, try lowering MAX_MEM, which is used to scale the benchmark, and play around with the other constants until it executes in a reasonable amount of time and gives a relatively smooth graph.

Now you can just run the benchmarks using make run in the (./bench/) directory, or make to just build the executables.

Measuring cycle count (./instructions/)

To run the cycle count measurement, first configure instructions/rvv-1.0/config.h to your processor.

Now you can run the measurement using make run in the (./instructions/rvv-1.0/) directory, or make to just build the executables.

For RVV 0.7.1 use the (./instructions/thead-0.7.1/) directory instead.

Contributing

Here are some suggestions of things that still need to be done.

  • contribute a measurement of a new CPU to: https://github.com/camel-cdr/rvv-bench-results
    You can just create an issue with a single json file, which contains all concatenated ./bench/ results. (after proper setup, make run > out.json should do the trick). \
  • implement non memory bound benchmarks
  • implement more benchmarks
  • better cycle count measurements: throughput vs latency (also: can we figure out the execution port configuration?)
  • cycle count for load/stores
  • cycle count for vsetvl

License

This repository is licensed under the MIT LICENSE.

rvv-bench's People

Contributors

camel-cdr avatar furuame avatar omaghiarimg 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.