Commit Graph

343 Commits

Author SHA1 Message Date
Christopher Berner
b2399469b2 Fix decoding crash
Fixes an issue in column swapping logic, where non-zeros might be
swapped into the V matrix instead of zeros
2019-04-13 16:30:25 -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
228a3bdc7f Use sparse math more aggressively now that it's faster 2019-04-09 21:46:31 -07:00
Christopher Berner
5eb972c21f Extract constant from loop 2019-04-09 21:30:25 -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
1cc5502fe2 Expand matrix sparsity benchmark 2019-04-08 20:43:13 -07:00
Christopher Berner
c1b3be12c5 Remove dead code 2019-04-08 19:56:33 -07:00
Christopher Berner
44f529214c Optimize row selection when r=1 2019-04-08 19:08:09 -07:00
Christopher Berner
f57bca53bf Optimize constraint matrix generation 2019-04-08 18:15:21 -07:00
Christopher Berner
3a3f739fae Enable sparse matrix math at >= 1000 symbols 2019-04-07 21:40:01 -07:00
Christopher Berner
6e18062b03 Rename freeze_columns() 2019-04-07 21:02:53 -07:00
Christopher Berner
fbd59bf982 Add fast path to column swapping for sparse 2019-04-07 20:09:51 -07:00
Christopher Berner
58550e3dd3 Ensure that optimize introduce previously is safe
Commit that introduce this: 59e88ad7581c2f7352e1054b40629e8cb7a9c572
2019-04-07 19:59:17 -07:00
Christopher Berner
6e4f8ecf32 Make stats resizing more sparse friendly 2019-04-07 18:53:59 -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
e01a3b987c Move tests to fix Travis 2019-04-07 17:13:44 -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
Christopher Berner
e53e82d785 Fix bad optimization in sparse matrix
Note: setting zero isn't a no-op, since there might be a non-zero value
already
2019-04-07 11:26:33 -07:00
Christopher Berner
fca4f14c06 Add more sparse tests and framework for enabling sparse math 2019-04-07 10:30:12 -07:00
Christopher Berner
1ff495f445 Improve test coverage 2019-04-07 09:59:42 -07:00
Christopher Berner
21e2133f7f Optimize PI decoder to be more sparse friendly 2019-04-06 23:15:32 -07:00
Christopher Berner
b3b6ab0fe9 Add TODOs noting places that may need to be optimized for sparse 2019-04-06 21:02:30 -07:00
Christopher Berner
7906ec47fb Optimize first phase selection helper resize()
Because we always zero out all following rows in the leading column,
the work it was doing was unnecessary
2019-04-06 20:51:33 -07:00
Christopher Berner
a66b49d1e7 Optimize sparse matrix to elide zeros created by FMA 2019-04-06 20:06:40 -07:00
Christopher Berner
d12a2485bf Optimize column swapping in SparseOctetMatrix 2019-04-06 19:56:32 -07:00
Christopher Berner
28cad084e4 Refactor SparseOctetVec 2019-04-06 18:31:53 -07:00
Christopher Berner
953d0f6c8a Optimize SparseOctetVec.swap() 2019-04-06 16:25:48 -07:00
Dodo
f868265380 .keys() returns a DoubleEndedIterator 2019-04-06 15:32:02 -07:00
Christopher Berner
3787690112 Optimize SparseOctetVec to use a sorted Vec instead of a HashMap 2019-04-06 14:46:15 -07:00
Christopher Berner
30c27a62ca Refactor SparseOctetMatrix 2019-04-06 11:01:52 -07:00
Christopher Berner
4268e4b508 Add sparse matrix implementation
Note: Lots of room for optimization still!
2019-04-06 09:45:12 -07:00
Christopher Berner
5817ec9765 Refactor OctetMatrix into a trait 2019-04-05 21:18:25 -07:00
Christopher Berner
1cb16e4636 Refactor OctetMatrix interface to make it easier to sparsify 2019-04-05 20:13:00 -07:00
Luca Bruno
09a1db06d9 mulassign/fallback: make safety invariants explicit
This simplifies the non-SIMD mulassign, making its safety invariants
explicit and documented.
2019-03-30 16:04:21 -07:00
Luca Bruno
e61e1eb2d4 coded: consume symbol bytes
This allows Symbol bytes to be directly consumed by encoder and decoder,
avoiding some extra allocations.
2019-03-30 15:57:56 -07:00
Luca Bruno
9fe45d6d76 decoder: avoid zero-symbols casts
This replaces zero-symbols casts with statically checked "Into" type
conversions.
2019-03-30 15:57:56 -07:00
Luca Bruno
631e2f8f97 decoder: misc cleanups
This is a minor cleanup pass to avoid unnecessary cloning and
unwrapping in the decoder.
2019-03-29 19:09:41 -07:00
Luca Bruno
38df97cce1 raptorq: rustfmt whole project 2019-03-28 21:57:30 -07:00
Luca Bruno
a55116e637 rustfmt: do not format tables 2019-03-28 21:57:30 -07:00
Christopher Berner
c0d0e13b43 Add serialization methods 2019-03-23 21:12:47 -07:00
Christopher Berner
3bbe9b8ef1 Cleanup public interfaces 2019-03-23 20:35:28 -07:00
Christopher Berner
91fa69a130 Gate some public functions with "benchmarking" feature 2019-03-23 14:42:19 -07:00
Christopher Berner
ea913f0ddd Precompute P1
Improves performance by ~1% and removes primal dependency
2019-03-23 14:15:06 -07:00
Christopher Berner
2ec675065b Add unit test 2019-03-23 13:53:10 -07:00
Christopher Berner
497c1613ff Remove rand dependency 2019-03-23 13:48:11 -07:00
Christopher Berner
919b4a0f5b Reduce row swaps
Improves performance by ~1%
2019-03-23 13:29:00 -07:00
Christopher Berner
1431ace8bf Make test more robust and resolve TODO 2019-03-23 13:12:08 -07:00
Christopher Berner
dad38875a8 Replace petgraph with custom connected components code
Improves performance by ~20%
2019-03-23 12:22:27 -07:00
Christopher Berner
f288654525 Update to 2018 edition 2019-03-22 18:25:07 -07:00
Christopher Berner
2d92876aa4 Remove Octet::static_init() and use const fn instead 2019-03-21 23:24:53 -07:00
Christopher Berner
a8347df59d Switch to runtime SIMD detection 2019-03-21 21:50:21 -07:00
Christopher Berner
bb2f576453 Add conveniance call to Octet::static_init() in decoder and encoders 2019-03-20 17:49:54 -07:00
Christopher Berner
91c6745257 Make EncodingPacket public 2019-03-20 17:45:28 -07:00
Christopher Berner
0644794488 Add Encoder and Decoder that can span multiple blocks 2019-02-20 20:52:44 -08:00
Christopher Berner
7c361d698e Add Object Transmission Information struct 2019-02-18 23:25:56 -08:00
Christopher Berner
ca552aaa55 Move PI solver to separate file 2019-02-18 17:02:54 -08:00
Christopher Berner
5e2c7a9077 Optimize mul_row() implementation 2019-02-18 10:48:06 -08:00
Christopher Berner
a20f894c52 Support extra repair symbols when decoding 2019-02-18 10:34:43 -08:00
Christopher Berner
c8cddfca53 Address TODO 2019-02-17 22:36:39 -08:00
Christopher Berner
bf5a64815a Replace &Vec with &[u8] in octets.rs 2019-02-16 18:08:16 -08:00
Christopher Berner
fc0ae5d162 Keep histrogram to accelerate computation of "r"
Improves performance by 5%
2019-02-16 10:56:24 -08:00
Christopher Berner
35145f43c8 Reduce memory allocation for graph 2019-02-15 23:45:34 -08:00
Christopher Berner
0ccc423bfd Add specialized UsizeArrayMap 2019-02-15 23:25:40 -08:00
Christopher Berner
b5360175ee Fix initial end column in row selection stats 2019-02-15 22:48:23 -08:00
Christopher Berner
27d1e75ab9 Fix bug in row selection 2019-02-15 22:33:40 -08:00
Christopher Berner
ae26fbfe0d Refactor row selection code 2019-02-15 22:23:16 -08:00
Christopher Berner
123d5ab2c1 Optimize row selection stats tracking 2019-02-15 21:56:48 -08:00
Christopher Berner
dc5c4c9cce Replace panic!() with unreachable!() 2019-02-15 21:25:41 -08:00
Christopher Berner
2abaab93cb Restructure bin targets 2019-02-15 21:14:10 -08:00
Christopher Berner
c93140968e Document where HDPC rows are defined 2019-02-15 20:58:13 -08:00
Christopher Berner
c5b70b66c7 Replace HashSet with Vec
Improves perf 6%
2019-02-14 21:54:23 -08:00
Christopher Berner
34f6ba3a46 Reduce memory allocation
Improves perf by 10%
2019-02-14 21:32:09 -08:00
Christopher Berner
f61c13ec6f Replace Vec with array 2019-02-13 22:56:04 -08:00
Christopher Berner
36eca029a4 Use with_capacity when possible to create vectors
Improves perf ~3%
2019-02-13 22:41:42 -08:00
Christopher Berner
8622195e32 Optimize decoder to do less memory allocation
Improve decoder repair perf by ~15%
2019-02-13 22:29:15 -08:00
Christopher Berner
1831b7d97f Cleanup encoder code 2019-02-13 21:56:25 -08:00
Christopher Berner
f20204d045 Require borrowing for matmul 2019-02-13 21:39:35 -08:00
Christopher Berner
1f0a6639b4 Remove unneeded OctetMatrix methods 2019-02-13 21:35:26 -08:00
Christopher Berner
2937619983 Cleanup Octet tests 2019-02-13 21:31:09 -08:00
Christopher Berner
f85d6c5075 Remove excess clone()'ing
Improves performance by 15%
2019-02-12 23:04:30 -08:00
Christopher Berner
2efe39012f Replace drain() with truncate() 2019-02-12 23:01:41 -08:00
Christopher Berner
9dc023e0f2 Add new benchmark and reduce calls to .clone() 2019-02-12 22:01:35 -08:00
Christopher Berner
966ed6d666 Refactor first phase decoding 2019-02-12 21:18:19 -08:00
Christopher Berner
42fab82742 Prevent inlining some functions to make profiling easier 2019-02-12 21:07:05 -08:00
Christopher Berner
a7966934dd Add per phase tracking of symbol XOR and MUL ops 2019-02-12 18:08:24 -08:00
Christopher Berner
14ede8e96e Incrementally compute row selection stats for first phase
Improve performance by ~5%
2019-02-11 23:34:10 -08:00
Christopher Berner
195843fe66 Fix compiler warnings 2019-02-11 21:59:54 -08:00
Christopher Berner
5dd3a0bc18 Implement sorting by original degree 2019-02-11 18:21:52 -08:00
Christopher Berner
e84bdfbd41 Resolve ambiguity about graph construction 2019-02-11 17:59:10 -08:00
Christopher Berner
f8d8d53c52 Fix compiler warnings and add a test 2019-02-10 23:41:41 -08:00
Christopher Berner
cec0f2bdd1 Add SIMD implementation of ones and non-zeros counting 2019-02-10 23:09:13 -08:00
Christopher Berner
6853bda256 Add benchmark for first phase row selection 2019-02-10 23:06:19 -08:00
Christopher Berner
2ebe217f52 Replace HashMap with ArrayMap
Improve performance 1-2%
2019-02-10 16:03:44 -08:00
Christopher Berner
0c222a1f59 Optimize matrix multiplication operator
Improves performance by ~5%
2019-02-10 15:57:19 -08:00
Christopher Berner
4c8f607f3b Refactor first_phase to make profiling even easier 2019-02-10 14:15:49 -08:00
Christopher Berner
88f898d7df Refactor first_phase to make profiling easier 2019-02-10 14:03:43 -08:00
Christopher Berner
051e3c231f Replace HashMap usage in graph calculation
Improves performance by 7%
2019-02-10 13:49:57 -08:00
Christopher Berner
1e8ac28bfe Add ArrayMap class
Makes offset code easier to understand, and is more reusable as a
HashMap replacement
2019-02-10 13:44:51 -08:00
Christopher Berner
e95315dc78 Optimize submatrix multiplication
Improves performance by ~15%
2019-02-10 10:27:09 -08:00
Christopher Berner
c916efd0ae Fix typo in row selection
Reduces performance by ~15%. Should investigate whether this makes sense
2019-02-09 23:27:55 -08:00
Christopher Berner
d7b0e0bf37 Fix unused code warnings 2019-02-09 15:32:56 -08:00
Christopher Berner
c0a83d7853 Optimize first_phase_selection()
Improves performance by ~15%
2019-02-09 15:23:34 -08:00
Christopher Berner
ef4d87ba6d Refactor first decoding phase
Improves performance a couple percent
2019-02-09 14:58:32 -08:00
Christopher Berner
5b75f4c5cf Optimize submatrix multiplication
Improves performance by ~4%
2019-02-09 13:10:06 -08:00
Christopher Berner
3798090453 Optimize matrix row FMA operation
Improves performance by ~13%
2019-02-09 11:21:31 -08:00
Christopher Berner
8d07b10875 Fix bug in high bit shifting for mul and fma 2019-02-09 11:17:57 -08:00
Christopher Berner
e27351fb52 Add test for generated multiplication table 2019-02-09 11:17:08 -08:00
Christopher Berner
8796add902 Refactor OctetMatrix to use u8 instead of Octet 2019-02-07 22:50:00 -08:00
Christopher Berner
93467a9d6e Disable decode verification steps in release build
Improves performance by ~10%
2019-02-07 22:23:50 -08:00
Christopher Berner
06002938ed Refactor decoder to use OctetMatrix 2019-02-07 21:33:48 -08:00
Christopher Berner
fa8e6cae70 Refactor decoder to use OctetMatrix for X 2019-02-07 19:19:14 -08:00
Christopher Berner
8e9e098021 Remove unnecessary lifetimes 2019-02-07 19:07:00 -08:00
Christopher Berner
e9dec4b6c8 Remove From and Into for Octet 2019-02-07 19:06:08 -08:00
Christopher Berner
5fe8ac022d Simplify OctetMatrix::set() 2019-02-07 19:01:22 -08:00
Christopher Berner
16949d72b4 Refactor SIMD ops for Symbol to allow reuse 2019-02-07 18:38:51 -08:00
Christopher Berner
1c7e3dbb17 Fix various compiler warnings 2019-02-07 17:47:26 -08:00
Christopher Berner
6c056b827b Implement Symbol mul_scalar with AVX2
Improves perf by ~10x
2019-02-06 22:45:14 -08:00
Christopher Berner
9811566293 Add AVX2 implementation for Symbol FMA
Speeds up FMA by ~10x, and makes encoding/decoding ~35% faster
2019-02-06 22:45:14 -08:00
Christopher Berner
afaa92a65c Remove TODOs that don't actually seem important 2019-02-06 08:35:43 -08:00
Christopher Berner
5e7c9776a0 Add AVX2 implementation of Symbol +=
Improves performance of += by 27%
2019-02-05 23:12:28 -08:00
Christopher Berner
fd4576694f Optimize Symbol FMA
Improves performance ~11%
2019-02-04 22:53:10 -08:00
Christopher Berner
4d8405aa2a Precompute Octet multiplication table 2019-02-04 22:44:38 -08:00
Christopher Berner
208dff0152 Vectorize += for Symbols
This makes += ~8x faster, and encoding/decoding benchmarks ~15% faster
2019-02-04 18:42:58 -08:00
Christopher Berner
dfb700cdc4 Optimize repair packet generation and repair decoding
This improves repair performance by ~8%. Also, remove Symbol ops
that aren't needed
2019-02-03 23:19:09 -08:00
Christopher Berner
2b97474588 Optimize Symbol * scalar multiplication 2019-02-03 22:58:37 -08:00
Christopher Berner
f944404b3c Add Symbol benchmarks 2019-02-03 22:52:43 -08:00
Christopher Berner
d951e7c00c Add Octet benchmarks 2019-02-03 22:37:30 -08:00
Christopher Berner
aea5933a31 Prevent inlining of decoding phases
This makes profiling easier, since it retains the callstack, and has
essentially no performance impact
2019-02-03 21:56:44 -08:00
Christopher Berner
f6b12b3f58 Add more detailed reporting to sparsity calculation 2019-02-03 21:37:39 -08:00
Christopher Berner
27d07a2d26 Avoid multiplication by zero in decoder
Also add assertion, to catch inefficient code
2019-02-03 19:52:33 -08:00
Christopher Berner
5f34ebf9f7 Optimize mul_symbols 2019-02-03 19:52:20 -08:00
Christopher Berner
f0f68e64a1 Add tracking of Symbol add ops when decoding 2019-02-03 19:35:20 -08:00
Christopher Berner
4cb675c618 Optimize multiplication by X and fix mul op tracking 2019-02-03 19:31:20 -08:00
Christopher Berner
ece0c54244 Optimize fma_rows() to avoid multiplying by 1 2019-02-03 19:28:32 -08:00
Christopher Berner
414aacea77 Check optimized decoder efficiency in sparsity computation 2019-02-03 16:13:43 -08:00
Christopher Berner
e13c8738c5 Switch to optimized symbol decoding implementation 2019-02-03 15:24:10 -08:00
Christopher Berner
4e6b34282f Remove unnecessary mut modifier 2019-02-03 14:55:10 -08:00
Christopher Berner
4c084c03ef Make Symbol division test pass deterministically 2019-02-03 14:53:59 -08:00
Christopher Berner
950a575dd3 Remove workaround for unimplemented parts of decoding 2019-02-03 14:52:58 -08:00
Christopher Berner
44acea00d1 Fix fifth decoding phase 2019-02-03 14:52:23 -08:00
Christopher Berner
79a7c1a97e Implement fourth decoding phase 2019-02-03 14:24:57 -08:00
Christopher Berner
a5ce5324df Implement third decoding phase 2019-02-03 14:11:57 -08:00
Christopher Berner
b1696593e0 Add third phase verification 2019-02-03 13:27:26 -08:00
Christopher Berner
4eb8340bbb Add verification at beginning of second phase 2019-02-03 13:21:20 -08:00
Christopher Berner
3a3c22db5b Add verification of first phase 2019-02-03 13:17:03 -08:00
Christopher Berner
4a40b3bbd2 Enable optimized decoding test 2019-02-03 12:51:16 -08:00
Christopher Berner
2a41d04ab2 Fix decoding phase 5 2019-02-03 12:50:56 -08:00
Christopher Berner
5649d6eafb Fix definition of Octet::one() 2019-02-03 12:38:26 -08:00
Christopher Berner
51adac6d85 Refactor second phase 2019-02-03 12:09:26 -08:00
Christopher Berner
9c47ffe90a Some fixes to phase 1 decoding 2019-02-03 11:51:14 -08:00
Christopher Berner
8a5c543e14 Implement second decoding phase 2019-02-02 20:31:48 -08:00
Christopher Berner
623e651615 Implement decoding phase 1
However, there are at least two potential bugs with the graph
construction and the calculation of "original degree"
2019-02-02 19:22:39 -08:00
Christopher Berner
e34d121904 Implement decoding phase 5 2019-01-31 14:45:21 -08:00
Christopher Berner
3b30d29373 Make multiplicative_inverse test pass deterministically 2019-01-31 14:37:37 -08:00
Christopher Berner
73d0419625 Start on more efficient intermediate decoder 2019-01-31 14:31:52 -08:00
Christopher Berner
31ff0bb49c Add additional constraint matrix test 2019-01-30 18:48:13 -08:00
Christopher Berner
944add1835 Add matrix sparsity analysis tool 2019-01-29 23:12:21 -08:00
Christopher Berner
3c41b0b17f Implement FMA for Octet
Improves benchmark performance by ~7%
2019-01-29 19:07:16 -08:00
Christopher Berner
ec0a817bc7 Use get_unchecked() in Symbol FMA
Improves performance by ~10% on benchmarks
2019-01-29 18:56:26 -08:00
Christopher Berner
db8a5d61f7 Use get_unchecked in Octet Mul
This improves benchmark performance by ~10%
2019-01-29 18:32:57 -08:00
Christopher Berner
7cbf0dc485 Add FMA for Symbols 2019-01-29 18:20:36 -08:00
Christopher Berner
12f9948b39 Skip multiplications by zero 2019-01-29 09:53:24 -08:00
Christopher Berner
de38e60feb Add bounds check 2019-01-29 09:53:14 -08:00
Christopher Berner
9c597ee6da Optimize Symbol::mul_scalar 2019-01-28 23:14:17 -08:00
Christopher Berner
3deb34f613 Refactor Symbol to use Octet 2019-01-28 23:08:22 -08:00
Christopher Berner
2e1ae45d81 Fix warning about unused identity() method 2019-01-28 22:39:55 -08:00
Christopher Berner
58522a74d1 Optimize matrix vector multiply 2019-01-28 22:38:02 -08:00
Christopher Berner
33813fccb7 Implement decoding from repair symbols 2019-01-28 17:17:05 -08:00
Christopher Berner
5eeaa5c5cc Refactor constraint matrix for decoding 2019-01-27 10:51:36 -08:00
Christopher Berner
7ba50eb48b Fix various compiler warnings 2019-01-26 22:13:26 -08:00
Christopher Berner
74a77480fb Fix bug in calculation of d1 in Tuple[] 2019-01-26 22:12:59 -08:00
Christopher Berner
7355a6e8b2 Implement repair symbols 2019-01-26 22:04:17 -08:00
Christopher Berner
912330cd45 Refactor to use Symbol 2019-01-26 21:49:08 -08:00
Christopher Berner
ce04ceb1a8 Implement constraint matrix 2019-01-26 21:35:43 -08:00
Christopher Berner
02cf40b8b8 Implement intermediate symbols generation 2019-01-26 19:30:17 -08:00
Christopher Berner
ad44e2991b Implement octet matrix operations 2019-01-26 19:16:07 -08:00
Christopher Berner
3cab629405 Implement Enc[] function and add compliance test 2019-01-26 11:05:27 -08:00
Christopher Berner
8773208cc1 Implement basic arithmetic on symbols 2019-01-24 18:50:46 -08:00
Christopher Berner
8009b07fd3 Implement Tuple[K', X] 2019-01-23 22:49:22 -08:00
Christopher Berner
0f12cf6182 Implement calculation of L, P, and P1 2019-01-23 22:30:19 -08:00
Christopher Berner
12ac0988d9 Implement Deg function 2019-01-23 22:11:55 -08:00
Christopher Berner
44f8a2e75e Implement RNG and reorganize some code 2019-01-23 21:57:40 -08:00
Christopher Berner
f5e0c1ebe1 Add RNG constants and systematic indices 2019-01-23 21:21:48 -08:00
Christopher Berner
24632695ed Initial interfaces 2019-01-22 22:53:23 -08:00