Skip to content

PhoqueEberlue/hmmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMMM - Hypercube Matrix-Matrix Multiplication

Implementation of a Systolic algorithm for Matrix-Matrix Multiplication with Hypercube Architecture.

Structure of the project

Two different Implementations have been realised for this project:

  • Pure Rust with a CLI display in folder cli-hmmm/
  • WebAssembly + Rust displaying the Hypercube via Plotly in folder wasm-hmmm/

Running pure Rust project

Install rust and run the following command in cli-hmmm\:

cargo run

Each point of the hypercube represent a processor and each of them have 3 registers A, B and C. The hypercube have been split into 3 for better readability of the registers.

Example result:

Register A      Register B      Register C
      0 0 0 0         0 1 2 0         0 0 0 0 
    3 3 3 3         0 1 2 0         0 3 6 0 
  2 2 2 2         0 1 2 0         0 2 4 0 
0 0 0 0         0 1 2 0         0 0 0 0 
      0 0 0 0         1 0 1 2         0 0 0 0 
    1 1 1 1         1 0 1 2         1 3 7 2 
  0 0 0 0         1 0 1 2         0 2 4 0 
2 2 2 2         1 0 1 2         2 0 2 4 
      2 2 2 2         0 3 2 0         0 6 4 0 
    1 1 1 1         0 3 2 0         1 6 9 2 
  0 0 0 0         0 3 2 0         0 2 4 0 
0 0 0 0         0 3 2 0         2 0 2 4 
      1 1 1 1         1 2 2 0         1 8 6 0  <--| Product result
    0 0 0 0         1 2 2 0         1 6 9 2 <-----| of the two
  1 1 1 1         1 2 2 0         1 4 6 0 <-------| input matrices.
0 0 0 0         1 2 2 0         2 0 2 4 <---------| 

Running WebAssembly app

Follow the setup for compiling Rust WebAssembly apps.

Then in wasm-hmmm/ build the project with

wasm-pack build

Go in wasm-hmmm/www/ and install npm dependencies

npm install

or

yarn

And launch the server

npm run start

or

yarn start

Yarn worked better for me in term of dependency resolving, but it's up to you, anyways I'm not a Webdev idk what I'm doing 💀

Here is an example of what it looks like:

example-wasm

About

Hypercube Matrix-Matrix Multiplication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published