Skip to content

Commit

Permalink
Remove cached triplet vector reservation (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jan 8, 2025
1 parent e751c50 commit fb0c46d
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 41 deletions.
10 changes: 5 additions & 5 deletions cart-pole-scalability-results-casadi.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Samples,Setup time (ms),Solve time (ms)
100,47.153,1914.93
150,64.018,3802.23
200,96.311,4964.47
250,131.245,7329.57
300,174.603,9585.46
100,37.982,1817.05
150,62.631,3538.11
200,93.572,4730.58
250,131.368,6979.29
300,171.915,9165.62
10 changes: 5 additions & 5 deletions cart-pole-scalability-results-sleipnir.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Samples,Setup time (ms),Solve time (ms)
100,2.002,475.82
150,1.116,1464.44
200,1.553,2476.12
250,2.016,3191.24
300,3.198,4993
100,1.811,446.437
150,1.107,1375
200,1.576,2232.37
250,2.043,2974.71
300,2.973,4796.49
Binary file modified cart-pole-scalability-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions flywheel-scalability-results-casadi.csv
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Samples,Setup time (ms),Solve time (ms)
100,2.896,25.332
200,3.603,38.506
300,5.34,55.479
400,7.125,76.048
500,8.748,102.399
600,10.528,123.726
700,12.087,145.943
800,14.18,167.021
900,17.655,190.359
1000,19.321,217.394
2000,36.311,542.894
3000,55.684,1041.77
4000,74.973,1566.55
5000,91.793,2192.74
100,2.26,21.589
200,3.68,37.663
300,5.473,55.8
400,7.321,76.244
500,9.066,102.233
600,10.995,123.434
700,12.595,145.869
800,14.305,165.89
900,19.464,187.642
1000,20.532,207.349
2000,38.611,540.584
3000,58.263,1004.7
4000,75.814,1520.31
5000,93.927,2135.78
28 changes: 14 additions & 14 deletions flywheel-scalability-results-sleipnir.csv
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Samples,Setup time (ms),Solve time (ms)
100,0.246,2.175
200,0.103,4.39
300,0.157,9.2
400,0.225,10.752
500,0.299,15.764
600,0.365,21.53
700,0.44,20.887
800,0.562,24.153
900,0.523,28.516
1000,0.615,31.44
2000,1.515,68.652
3000,1.943,137.328
4000,2.887,227.069
5000,3.902,296.625
100,0.252,2.696
200,0.102,4.051
300,0.16,6.284
400,0.222,8.799
500,0.277,13.618
600,0.349,16.677
700,0.408,17.603
800,0.471,21.988
900,0.528,23.504
1000,0.588,28.041
2000,1.99,68.67
3000,2.049,123.864
4000,2.992,185.715
5000,4.542,294.688
Binary file modified flywheel-scalability-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions include/sleipnir/autodiff/Jacobian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class SLEIPNIR_DLLEXPORT Jacobian {
m_graphs.emplace_back(variable.expr);
}

// Reserve triplet space for 99% sparsity
m_cachedTriplets.reserve(m_variables.Rows() * m_wrt.Rows() * 0.01);

for (int row = 0; row < m_variables.Rows(); ++row) {
if (m_variables(row).Type() == ExpressionType::kLinear) {
// If the row is linear, compute its gradient once here and cache its
Expand Down

0 comments on commit fb0c46d

Please sign in to comment.