Commit Graph

98 Commits

Author SHA1 Message Date
Christopher Berner
eafdc58d0a Run cargo clippy --fix 2023-07-03 11:09:19 -07:00
Slesarew
5a720829fa
feat: support no_std (#143)
* feat: support no_std

`metal` feature supports `no_std` in configuration `default-features = false, features = ["metal"]`.
Float calculation is done via `micromath` crate.

All previously available functionality remains under default `std` feature.

Some tweaking of `python` and `wasm` features was done to compile tests.

* feat: get rid of floats (#2)

* feat: remove conversion to f64, fix features

* chore: uncomment symbols_required checker, fmt

* revert: add cdylib target for python support

* fix: generalize crate type

---------

Co-authored-by: varovainen <99664267+varovainen@users.noreply.github.com>
2023-02-02 18:07:41 -08:00
Christopher Berner
11d2de97f2 Update to rand 0.8 2020-12-19 13:14:12 -08:00
Christopher Berner
102c6a5a86 Optimize DenseBinaryMatrix
Switch to a single contiguous vector instead of vec of vecs

This improves performance by ~5%, especially for smaller symbol counts
2020-12-07 22:16:38 -08:00
Christopher Berner
d87e46c625 Optimize DenseBinaryMatrix.swap_columns()
Improves performance by 10-15% for symbol count = 100
2020-12-06 08:15:21 -08:00
Christopher Berner
3a05d7be3e Add BinaryOctetVec
Improves encoding speed of large symbol counts by ~5%
2020-12-06 08:15:21 -08:00
Christopher Berner
c4d227fba1 Optimize memory layout of dense U matrix
Previously we used column major ordering. Switch to row major to
optimize sequential access of rows which is much more common in the
first phase, and can also be used in the fourth phase

This improves performance by ~10% on large symbol counts
2020-11-28 21:08:35 -08:00
Christopher Berner
3a4068a726 Fix typo in spelling of "access" 2020-11-28 17:22:50 -08:00
Christopher Berner
8b462f5c83 Optimize processing of U matrix
Optimize Phases 2-5 to avoid writes to the first i columns.
Additionally, use pre-computed ops from first phase to implement third &
fifth phases

This improves encoding performance by ~15%, especially on large symbol
counts
2020-11-27 21:36:17 -08:00
Christopher Berner
95b6b5ae91 Make serde support optional 2020-08-30 09:39:39 -07:00
Christopher Berner
88a9d6d582 Fix Clippy style warning 2020-03-20 23:32:45 -07:00
Christopher Berner
f0177f9311 Convert column iterator to return only 1-valued rows 2020-01-19 11:08:40 -08:00
Christopher Berner
f95998b0ff Add approximate memory analysis 2020-01-19 11:08:40 -08:00
Christopher Berner
d8d8bc33ec Optimize dense binary matrix storage to use bitpacking 2020-01-19 11:08:40 -08:00
Christopher Berner
bf1291253b Remove unnecessary counting of values greater than one 2020-01-19 11:08:40 -08:00
Christopher Berner
059133c812 Document TODO 2020-01-19 11:08:40 -08:00
Christopher Berner
49448be936 Remove unnecessary support for non-binary values in binary matrices 2020-01-19 11:08:40 -08:00
Christopher Berner
5d57d3751e Separate binary and octet matrix classes 2020-01-19 11:08:40 -08:00
Christopher Berner
7ad2d331dd Remove dense row support from sparse matrix 2020-01-19 11:08:40 -08:00
Christopher Berner
7f3477d3de Separate HDPC rows from A matrix in PI solver
The HDPC rows are only non-binary values, so store them separately
to allow for more optimizations in the future.
2020-01-19 11:08:40 -08:00
Cem Karan
4a68f2529d feat: Derived serde::{Serialize, Deserialize} on all public types.
This should make it possible to use serde to serialize and deserialize
encoders/decoders while they are in use.  This is makes it possible to
ship them between processes as needed.
2020-01-09 19:34:21 -08:00
Christopher Berner
647e937c54 Optimize col index handling 2020-01-06 18:27:02 -08:00
Christopher Berner
63208df2b5 Improve dense row handling in sparse matrix
* support resize()
* use logical col indices
2020-01-06 18:27:02 -08:00
Christopher Berner
2bad8466fa Optimize HDPC row storage in sparse matrix 2020-01-06 18:27:02 -08:00
Christopher Berner
0cecda508c Split sparse matrix into separate file 2020-01-04 16:12:56 -08:00
Christopher Berner
b42b84a746 Refactor iterators into separate file 2020-01-04 16:12:56 -08:00
Christopher Berner
79ae52cfb1 Separate SparseValuelessVec from SparseOctetVec 2020-01-04 16:12:56 -08:00
Christopher Berner
4e1dc4fa93 Avoid accessing internal sparse vector fields in matrix 2020-01-04 16:12:56 -08:00
Christopher Berner
f0f0f98247 Merge SparseVec into SparseOctetVec 2020-01-04 16:12:56 -08:00
Christopher Berner
8f8637be8a Move SparseVec into separate file 2020-01-04 16:12:56 -08:00
Christopher Berner
876d3c5cac Refactor calls to binary_search into helper method 2020-01-04 16:12:56 -08:00
Christopher Berner
5b7f1b7441 Fix remaining Clippy warnings 2019-12-25 12:02:54 -08:00
Christopher Berner
ffd6160099 Fix various stylistic Clippy issues 2019-12-25 12:02:54 -08:00
Christopher Berner
c8fd9bcbff Format code with rustfmt and add format check 2019-12-23 12:04:05 -08:00
Christopher Berner
301f7ee03d Simplify and optimize sparse FMA 2019-04-14 13:18:31 -07:00
Christopher Berner
b32fa67e05 Optimize hint dense column 2019-04-11 22:27:06 -07:00
Christopher Berner
8286361f24 Optimize get_col_iter() 2019-04-11 17:51:18 -07:00
Christopher Berner
4cfef50cf3 Add more tests and verification code 2019-04-10 23:34:34 -07:00
Christopher Berner
6f95146bf8 Remove heuristic 2019-04-10 18:23:17 -07:00
Christopher Berner
3858944c18 Fix potentially incorrect col tracking in fma() 2019-04-10 18:21:10 -07:00
Christopher Berner
777218debd Optimize sparse matrix column swapping 2019-04-09 21:21:25 -07:00
Christopher Berner
e0ce5f3b55 Add logical row mapping
Improves perf by ~50% on large matrices
2019-04-09 18:38:07 -07:00
Christopher Berner
c1b3be12c5 Remove dead code 2019-04-08 19:56:33 -07:00
Christopher Berner
6e18062b03 Rename freeze_columns() 2019-04-07 21:02:53 -07:00
Christopher Berner
d4e16d8b98 Heuristic to optimize FMA on large sparse vectors 2019-04-07 18:44:38 -07:00
Christopher Berner
59e88ad758 Optimize to fifth PI phase for sparse 2019-04-07 17:55:51 -07:00
Christopher Berner
0d531de69e Further optimize PI solver for sparse matrices 2019-04-07 17:33:58 -07:00
Christopher Berner
6ab457f6a4 Optimize sparse FMA for most common case
This improves sparse perf by ~4x
2019-04-07 16:50:50 -07:00
Christopher Berner
f063d3114d Optimize sparse matrix density storage with more hinting 2019-04-07 16:18:29 -07:00
Christopher Berner
6c73ee267c Optimize sparse matrix with block dense right side 2019-04-07 15:31:00 -07:00