Commit Graph

34 Commits

Author SHA1 Message Date
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
5a851083ed Fix some Clippy warnings 2021-07-27 22:00:38 -07: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
50301e1b5b Optimize query_non_zero_columns()
This reduces the time spent in the fourth phase from ~6% of encoding
time to ~1%, according to perf, and improves overall throughput by 3-4%
on large symbol counts.
2020-11-29 09:51:56 -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
6245ab1c9a Fix over-allocation of memory for dense U section of matrix
The previous code had an off by one error leading to an extra word being
allocated for each row
2020-11-28 17:22:50 -08:00
Christopher Berner
3a4068a726 Fix typo in spelling of "access" 2020-11-28 17:22:50 -08:00
Christopher Berner
9a849add9b Optimize vector creation in get_sub_row_as_octets()
Improves performance by ~5%
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
b9dde8e167 Optimize columnar storage in sparse matrix
This reduces memory usage for large symbol counts by 10%+
2020-01-19 11:08:40 -08:00
Christopher Berner
f0177f9311 Convert column iterator to return only 1-valued rows 2020-01-19 11:08:40 -08:00
Christopher Berner
e2ede5e61a Add assertions to check that column index is always accurate 2020-01-19 11:08:40 -08:00
Christopher Berner
87f8e7ae81 Remove logic to update column index 2020-01-19 11:08:40 -08:00
Christopher Berner
7766fa4d7f Further optimize memory usage of column mapping
Reduces memory usage by ~3% for large symbol counts
2020-01-19 11:08:40 -08:00
Christopher Berner
d720cd7968 Optimize index mapping storage for sparse matrix
This reduces memory usage by ~15% for large symbol counts
2020-01-19 11:08:40 -08:00
Christopher Berner
fd93b712c8 Optimize sparse vec with byte packing into u32
Reduces memory usage for large symbol counts by ~40%
2020-01-19 11:08:40 -08:00
Christopher Berner
886075c1b0 Optimize column index memory usage
Reduces memory usage by ~10% for large symbol counts
2020-01-19 11:08:40 -08:00
Christopher Berner
b60387a132 Remove unaccessed columns from X
Reduces memory usage by ~10%
2020-01-19 11:08:40 -08:00
Christopher Berner
083e634c7e Optimize sparse matrix to use 50-75% less memory 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
b61e4825c5 Remove unnecessary support for arbitrary width resizing 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
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
9d0af2dcad Appropriately size col index vectors 2020-01-06 18:27:02 -08:00
Christopher Berner
2fec2cb9d7 Remove useless loop 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