https://github.com/imciner2/chopblas
Basic linear algebra routines implemented using the chop rounding function
https://github.com/imciner2/chopblas
arithmetic bfloat16 half-precision matlab matrix rounding stochastic-rounding
Last synced: 9 months ago
JSON representation
Basic linear algebra routines implemented using the chop rounding function
- Host: GitHub
- URL: https://github.com/imciner2/chopblas
- Owner: imciner2
- License: bsd-2-clause
- Created: 2022-05-10T16:03:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T17:03:09.000Z (almost 3 years ago)
- Last Synced: 2025-03-30T10:23:15.862Z (10 months ago)
- Topics: arithmetic, bfloat16, half-precision, matlab, matrix, rounding, stochastic-rounding
- Language: MATLAB
- Homepage:
- Size: 1.7 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChopBLAS - A Matlab library for mixed-precision and stochastically rounded linear algebra
[](https://github.com/imciner2/ChopBLAS/actions/workflows/ci.yml)

ChopBLAS is a MATLAB library that implements the functions contained inside the BLAS (Basic Linear Algebra Subsystem) specification
with each operation rounded using the [chop](https://github.com/higham/chop) MATLAB library.
This allows for the easy simulation of linear algebra operations/algorithms in low precision floating-point and with stochastic rounding.
## BLAS Functions
### Level 1
| Function | Operation | Description |
|----------|:-----------------------------------------|:------------------------------------------------------------------------|
| chscal | $x_{out} = \alpha x$ | Scale all entries of the vector $x$ by $\alpha$ |
| chaxpy | $x_{out} = \alpha x + y$ | Add the scaled vector $x$ to the vector $y$ |
| chdot | $x_{out} = x'y$ | Compute the dot product between $x$ and $y$ |
| chnrm2 | $x_{out} = \lVert x \rVert_{2}$ | Compute the 2-norm of the vector $x$ |
| chasum | $x_{out} = \sum_{i} \lvert x_{i} \rvert$ | Compute the sum of the absolute value of the elements of the vector $x$ |
### Level 2
| Function | Operation | Description |
|----------|:----------------------------------------------------------------------|:----------------------------------------------------------------------|
| chgemv | $x_{out} = \alpha A x + \beta y$ or $x_{out} = \alpha A' x + \beta y$ | Compute the matrix-vector product $Ax + y$ |
| chtrmv | $x_{out} = A x$ or $x_{out} = A' x$ | Compute the matrix-vector product $Ax$ when $A$ is a triangular matrix |
| chtrsv | Find $x$ in $A x = b$ or $A' x = b$ | Compute the solution to the triangular system of equations given by $A$ and $b$ when $A$ is a triangular matrix |
| chger | $X = \alpha x y^{T} + A$ | Compute the rank-1 update of $A$ using the outer product between $x$ and $y$ |
## License
This library is licensed under the BSD 2-Clause license, provided inside the `LICENSE` file in this repository.