Skip to content

Commit 6f5a7ab

Browse files
authored
C++ & multithreaded batching (#18)
* started cpp skeleton * Fix compilation errors - don't return temporary from +, - (r)matvec - apply clangformat for style - use c++11 in CMake * Explicitly name return type for lambdas (Eigen segfaults otherwise) * Add a couple more return types * some fixes to linop * lsqr done * changed gitignore, added deriv interface, and added aslinearoperator to linop * added .vscode to ignore * added pybind wrapper and modified setup file' * WIP cones * fixed deriv and made setup much simpler * Initial implementation of cones * minor fixes to cones * fix some bugs * update * initialize array * fix fn definition * move exponential cone projection into cones.cpp * updated wrapper * add a ctor for Cone * added enum * initialize t * working from python! * Test cpp dprojection in tests.py - also fix minor bugs in cpp dprojection for exp cone - TestConeProgDiff.test_dpi passes * Fix memory error in linop.cpp, hello_world.py works * mildly relax tolerance for unit test, looks correct by inspection * Get all tests passing also delete code that's now unused * Don't recompute `M` on every derivative application - compute M before forming the callables `derivative` and `adjoint_derivative` - expose c++ lsqr function to python - call LSQR directly with M in Python - remove _solve_derivative and _solve_derivative_adjoint (these functions just call lsqr) - add const qualifiers to methods in LinearOperator - apply clang-format everywhere * Rebase cpp on top of sbarratt/dense (#12) * added sparse and dense options * fixed some bugs and added test for adjoint * added prof, updated sdp defaults, and changed iters * it refinement working * Update README.md * Update README.md * Fix typo in README bibtex * Update README.md * Update diffcp citation in README (for JANO) * added error for not solved, along with test (#4) * added error for not solved, along with test * added error to docstring, changed test, and exposed SolverError Exception class * updated readme * changed link location * updated README * Remove reference to where SolverError is defined no need to tell users where SolverError is defined * Fix Moreau decomp for exp cone * do not overwrite x in exp cone, fix unit test * more fixes for the exp cone * more exp fixes * fix spacing * fixed exponential cone derivative bug * removed unnecessary reshape * started cpp skeleton * Fix compilation errors - don't return temporary from +, - (r)matvec - apply clangformat for style - use c++11 in CMake * Explicitly name return type for lambdas (Eigen segfaults otherwise) * Add a couple more return types * some fixes to linop * lsqr done * changed gitignore, added deriv interface, and added aslinearoperator to linop * added .vscode to ignore * added pybind wrapper and modified setup file' * WIP cones * fixed deriv and made setup much simpler * Initial implementation of cones * minor fixes to cones * fix some bugs * update * initialize array * fix fn definition * move exponential cone projection into cones.cpp * updated wrapper * add a ctor for Cone * added enum * initialize t * working from python! * Test cpp dprojection in tests.py - also fix minor bugs in cpp dprojection for exp cone - TestConeProgDiff.test_dpi passes * Fix memory error in linop.cpp, hello_world.py works * mildly relax tolerance for unit test, looks correct by inspection * Get all tests passing also delete code that's now unused * Last few tweaks for rebasing * Add pi back to cones * stub in dense/sparse C++ interfaces * remove accidentally-committed bit * fix MT in the adjoint_derivative stub * Fix placement * fill in the dense pass * Add dense_np to tests * Performance tweaks. Make the dense solve take M/MT as inputs * Fix col * Use PSD linop for now in sparse mode * Use a const ref to the op * Remove unnecessary include. * Run clang-format * Test more parts of the dense mode * tweak wrapper * Add efficiency comment. * Run clang-format on the includes as well * dpi_explicit -> dpi_sparse * Remove dense_np mode * ->sparse_matrix * Tweaks. * Optionally compile without openmp The compiler shipped with mac os x does not support openmp * 80 cols * delete unused variable * Fix bug in exponential cone dproj * Delete unused proj.c * added lsqr_sparse and test * clang-format * actually call test * remove .c files from setup * changed setup.py * fixed test, passes now * sparse_matrix->sparse * removed unnecessary functions and files * added test, removed sparse stuff, added batched solve_and_derivative, added example for batch, added random seed before every random test due to indeterminism * set omp thread limit to 1 and modified test * need it before scs import actually * to omp_num_threads instead * using threadpoolctl * updated batch docstring * took line out of assert statement * constexpr --> const * fixed k in SDP cone projection derivative * removed print * subtract 1 from k * fix psd dproj * updated test and fixed (x)_- = -min(x,0) * changed == 0 to <= CONE_THRESH
1 parent 4fdc89c commit 6f5a7ab

File tree

1,634 files changed

+321287
-495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,634 files changed

+321287
-495
lines changed

.gitignore

+507
Large diffs are not rendered by default.

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
develop:
2+
rm -f *.so
3+
python setup.py clean --all
4+
python setup.py develop

cpp/external/eigen/.hg_archival.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
repo: 8a21fd850624c931e448cbcfb38168cb2717c790
2+
node: 323c052e17310984a40dda9426e0435bed7178fa
3+
branch: 3.3
4+
tag: 3.3.7

cpp/external/eigen/.hgeol

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[patterns]
2+
*.sh = LF
3+
*.MINPACK = CRLF
4+
scripts/*.in = LF
5+
debug/msvc/*.dat = CRLF
6+
debug/msvc/*.natvis = CRLF
7+
unsupported/test/mpreal/*.* = CRLF
8+
** = native
9+
10+
[repository]
11+
native = LF

cpp/external/eigen/.hgignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
syntax: glob
2+
qrc_*cxx
3+
*.orig
4+
*.pyc
5+
*.diff
6+
diff
7+
*.save
8+
save
9+
*.old
10+
*.gmo
11+
*.qm
12+
core
13+
core.*
14+
*.bak
15+
*~
16+
*build*
17+
*.moc.*
18+
*.moc
19+
ui_*
20+
CMakeCache.txt
21+
tags
22+
.*.swp
23+
activity.png
24+
*.out
25+
*.php*
26+
*.log
27+
*.orig
28+
*.rej
29+
log
30+
patch
31+
a
32+
a.*
33+
lapack/testing
34+
lapack/reference

cpp/external/eigen/.hgtags

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2db9468678c6480c9633b6272ff0e3599d1e11a3 2.0-beta3
2+
375224817dce669b6fa31d920d4c895a63fabf32 2.0-beta1
3+
3b8120f077865e2a072e10f5be33e1d942b83a06 2.0-rc1
4+
19dfc0e7666bcee26f7a49eb42f39a0280a3485e 2.0-beta5
5+
7a7d8a9526f003ffa2430dfb0c2c535b5add3023 2.0-beta4
6+
7d14ad088ac23769c349518762704f0257f6a39b 2.0.1
7+
b9d48561579fd7d4c05b2aa42235dc9de6484bf2 2.0-beta6
8+
e17630a40408243cb1a51ad0fe3a99beb75b7450 before-hg-migration
9+
eda654d4cda2210ce80719addcf854773e6dec5a 2.0.0
10+
ee9a7c468a9e73fab12f38f02bac24b07f29ed71 2.0-beta2
11+
d49097c25d8049e730c254a2fed725a240ce4858 after-hg-migration
12+
655348878731bcb5d9bbe0854077b052e75e5237 actual-start-from-scratch
13+
12a658962d4e6dfdc9a1c350fe7b69e36e70675c 3.0-beta1
14+
5c4180ad827b3f869b13b1d82f5a6ce617d6fcee 3.0-beta2
15+
7ae24ca6f3891d5ac58ddc7db60ad413c8d6ec35 3.0-beta3
16+
c40708b9088d622567fecc9208ad4a426621d364 3.0-beta4
17+
b6456624eae74f49ae8683d8e7b2882a2ca0342a 3.0-rc1
18+
a810d5dbab47acfe65b3350236efdd98f67d4d8a 3.1.0-alpha1
19+
304c88ca3affc16dd0b008b1104873986edd77af 3.1.0-alpha2
20+
920fc730b5930daae0a6dbe296d60ce2e3808215 3.1.0-beta1
21+
8383e883ebcc6f14695ff0b5e20bb631abab43fb 3.1.0-rc1
22+
bf4cb8c934fa3a79f45f1e629610f0225e93e493 3.1.0-rc2
23+
da195914abcc1d739027cbee7c52077aab30b336 3.2-beta1
24+
a8e0d153fc5e239ef8b06e3665f1f9e8cb8d49c8 before-evaluators
25+
09a8e21866106b49c5dec1d6d543e5794e82efa0 3.3-alpha1
26+
ce5a455b34c0a0ac3545a1497cb4a16c38ed90e8 3.3-beta1
27+
69d418c0699907bcd0bf9e0b3ba0a112ed091d85 3.3-beta2
28+
bef509908b9da05d0d07ffc0da105e2c8c6d3996 3.3-rc1
29+
04ab5fa4b241754afcf631117572276444c67239 3.3-rc2
30+
26667be4f70baf4f0d39e96f330714c87b399090 3.3.0
31+
f562a193118d4f40514e2f4a0ace6e974926ef06 3.3.1
32+
da9b4e14c2550e0d11078a3c39e6d56eba9905df 3.3.2
33+
67e894c6cd8f5f1f604b27d37ed47fdf012674ff 3.3.3
34+
5a0156e40feb7c4136680b493c6e433d91a6f355 3.3.4
35+
b3f3d4950030e3fa2e8fde6b68405106ae5685e1 3.3.5
36+
b70bf4fad46787bce88d17d6f80d22f70ac882a1 3.3.6

0 commit comments

Comments
 (0)