This project provids an implementation of an Analog Matrix-Vector Multiplication (MVM) library, including classes and methods to manage matrices and vectors, quantize and dequantize their values, and perform MVM operations on a specified hardware infrastructure.
The core components of this project are:
- AnalogMatrix: Represents a matrix and provides methods for quantizing, printing, and other matrix operations compatible with MVM analog intrinsic calls.
- AnalogVector: Represents a vector and provides methods for quantizing, printing, and other vector operations compatible with MVM analog intrinsic calls.
- AnalogContext: Manages scaling factors for matrices and vectors.
- Analog Operations: Provides functions to set matrices and vectors to tiles, load vectors into tiles, perform computations on tiles, store vectors from tiles, and move vectors between tiles.
This project is intended to run with specific infrastructure and libraries. Ensure you have the following:
- Analog Library: https://github.com/PlatinumCD/analog-library (main branch)
- Custom LLVM: https://github.com/PlatinumCD/llvm-project (llvm-riscv branch)
- Custom SST Elements: https://github.com/PlatinumCD/sst-elements (refactor branch)
- Build Infrastructure: https://github.com/PlatinumCD/RISCV-Analog-Coprocessor (main branch)
analog/AnalogMatrix.h
: Contains theAnalogMatrix
class, which manages matrices and supports MVM operations.analog/AnalogVector.h
: Contains theAnalogVector
class, which manages vectors and supports MVM operations.analog/AnalogDataType.h
: Defines theAnalogDataType
class, a base class for data types used in analog computations.analog/AnalogContext.h
: Defines theAnalogContext
class, which tracks array scale factors for matrices and vectors.analog/analog_operations.h
: Contains functions for setting, loading, computing, storing, and moving vectors and matrices within tiles.analog/analog.h
: Includes the necessary headers and defines constants for the default matrix and vector sizes for the device.
Ensure you have all dependencies properly installed and set up as per the instructions in their respective repositories.
-
Clone the main repository:
git clone https://github.com/PlatinumCD/RISCV-Analog-Coprocessor.git cd RISCV-Analog-Coprocessor
-
Follow the build instructions provided in the
RISCV-Analog-Coprocessor
repository to set up the build infrastructure.
- Ensure all dependencies (Analog Library, Custom LLVM, Custom SST Elements) are properly checked out and built as per their respective instructions.
- Build the project using the provided build scripts from the
RISCV-Analog-Coprocessor
repository.
Contributions are welcome! Please fork the repository and open a pull request with your changes. Ensure that your code is properly documented and adheres to the coding standards of the project.