Skip to content

Commit 4fab553

Browse files
authored
Merge pull request #1 from plancherb1/LCM_integration
ICRA 2019 Release
2 parents adbf424 + 84aa012 commit 4fab553

Some content is hidden

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

50 files changed

+8061
-1884
lines changed

DDPHelpers.cuh

Lines changed: 0 additions & 52 deletions
This file was deleted.

DDPHelpers/DDPWrappers.cuh

Lines changed: 160 additions & 16 deletions
Large diffs are not rendered by default.

DDPHelpers/LCMHelpers.cuh

Lines changed: 575 additions & 0 deletions
Large diffs are not rendered by default.

DDPHelpers/MPCHelpers.cuh

Lines changed: 534 additions & 459 deletions
Large diffs are not rendered by default.

DDPHelpers/bpHelpers.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void computeFSVars(T *b_ApBK, T *b_Bdu, T *s_AB, T *s_K, T *s_du, int ld_A){
306306
// multiply row kx of B by column ky of du store in (kx,ky) of d
307307
val += s_AB[OFFSET_B + kx + DIM_AB_r*j]*s_du[j];
308308
}
309-
b_Bdu[kx] = -val;
309+
b_Bdu[kx] = val;
310310
}
311311
}
312312
}
@@ -327,7 +327,7 @@ void computeExpRed(T *s_dJ, T *s_H, T *s_g, T *s_du){
327327
s_dJ[ind] += val1;
328328
s_dJ[DIM_du_r + ind] += val2;
329329
#else
330-
s_dJ[0] += val1;
330+
s_dJ[0] += val1;
331331
s_dJ[1] += val2;
332332
#endif
333333
}

DDPHelpers/fpHelpers.cuh

Lines changed: 238 additions & 89 deletions
Large diffs are not rendered by default.

DDPHelpers/nisInitHelpers.cuh

Lines changed: 173 additions & 84 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
# Parallel DDP for GPU/CPU #
22

3-
This repository holds the code supporting "[A Performance Analysis of Differential Dynamic Programming on a GPU](https://agile.seas.harvard.edu/publications/performance-analysis-parallel-differential-dynamic-programming-gpu)." It is also where experimental work is being done to extend this work.
3+
### Releases
4+
**```v0.1: WAFR 2018 Release```**
5+
holds the code supporting "[A Performance Analysis of Differential Dynamic Programming on a GPU](https://agile.seas.harvard.edu/publications/performance-analysis-parallel-differential-dynamic-programming-gpu)."
6+
7+
**```v0.2: ICRA 2019 Release```** extends the previous work by integrating LCM for hardware experiments and cleaning up the code base / interface. <!--An extended abstract describing the hardware experiments can be found [here]().-->
48

59
### Stucture of this Repository
6-
* ```WAFR_MPC_examples.cu``` and ```WAFR_MPC_examples.cu``` are the main files which run the experiments from the paper (see the comment at the top of each file for the compilation instructions)
7-
* ```config.h``` defines all of the settings (parallel level, plant, etc.) for an experiment
8-
* ```DDPHelpers.cuh``` imports all of the various helper functions and files from the following folders as needed
9-
* ```/DDPHelpers/*``` holds most of the functions as inlined templated CUDA header files
10+
* ```config.h``` defines all of the default settings (parallel level, plant, etc.) for an experiment and imports all of the various helper functions and files from the following folders as needed
11+
* ```/examples/*``` holds the scripts that run the WAFR examples and LCM examples (see the comment at the top of each file for the compilation instructions)
1012
* ```/plants/*``` holds custom rigid body dynamics and/or analytical dynamics and cost functions for currently supported plants
13+
* ```/DDPHelpers/*``` holds most of the functions for DDP as inlined templated CUDA header files
1114
* ```/utils/*``` holds a variety of support code for matrix multiplication, discrete time integrators, thread/CUDA support, etc.
12-
* ```/lcmtypes/*``` holds experimental LCM types for multi-computer / hardware communication
15+
* ```/test/*``` holds a variety of testing scripts for various function calls and derivatives (see the comment at the top of each file for the compilation instructions)
16+
* ```/lcmtypes/*``` holds LCM types for multi-computer / hardware communication
1317

1418
### Dependencies
15-
* [CUDA](https://developer.nvidia.com/cuda-zone) needs to be installed as code needs to be compiled with the NVCC comiler
16-
* For experimental multi-computer / hardware MPC code there is an additional communicaiton dependency: [LCM](https://lcm-proj.github.io/).
19+
* [CUDA](https://developer.nvidia.com/cuda-zone) needs to be installed as code needs to be compiled with the NVCC comiler. Currently, this code has been tested with CUDA 9 and X.
20+
* For multi-computer / hardware MPC code there is an additional communicaiton dependency: [LCM](https://lcm-proj.github.io/).
21+
22+
### Instalation Tips for CUDA
23+
https://askubuntu.com/questions/1077061/how-do-i-install-nvidia-and-cuda-drivers-into-ubuntu
24+
https://www.tensorflow.org/install/gpu
25+
26+
### To use with the Drake Kuka Simulator
27+
1) Install this fork of drake: [https://github.com/plancherb1/drake](https://github.com/plancherb1/drake)
28+
2) You need to put in you .bashrc ```export DRAKE_PATH_ROOT=<path_to_drake>```
29+
Then the scripts in the utils folder should launch the drake visualizer and simulator
1730

18-
### Known Bugs / Ongoing Development
19-
* Finite-Diff Derivatives are currently only partially implemented (and broken)
20-
* Small float rounding differences need to be investigated further (probably benign)
21-
* GPU RBDYN for Kuka only works in Euler mode -- need to introduce loops and reduce shared memory for Midpoint and RK3 (or use a brand new GPU which has double the shared memory)
22-
* LCM infrastructure for multi-computer / hardware MPC only partially developed (and currenlty commented out)
23-
* Need to catch up the CPU MPC to GPU MPC implementation
31+
### Known Bugs / Ongoing Development / Roadmap
32+
* On roadmap to develop a CPU/GPU hybrid (only the gradients on the GPU) and a fully serial CPU version without any instruction level parallelism
33+
* GPU RBDYN for Kuka only works in Euler mode -- need to introduce loops and reduce shared memory for Midpoint and RK3 (or use a brand new GPU which has double the shared memory) -- potential to also optimize the gradient calc to require less shared memory
34+
* CPU MPC suffers from resource contention when trajRunner and Goal are on same computer -- need to improve and provide seperate compile paths -- also CPU MPC Parallel Line Search has a subtle bug (in iLQR is identical to serial but diverges in MPC -- need to debug)
35+
* Constraint handling / penalities need further development - would like to add full AL constraints and/or projection methods
36+
* Final cost shift is in development and non-functional (tied to frequency and not last goal change / shift count)
37+
* SLQ implementation is currently broken (and EE version needs a cost kernel)
38+
* EEVel rpy derivatives are currently broken (may explore forced finite diff)
39+
* BFGS iters may improve / stabilize the EEPos/Vel cost and should be explored
40+
* Square root implementation of DDP should add numerical stability and should be explored
41+
* Want to develop URDF > transforms and inertias tool for Arm
42+
* Would be nice to add a runtime and not compile time switch for Hardware vs. Sim mode and for level of parallelism (M)

0 commit comments

Comments
 (0)