diff --git a/01_Code/physical_computing_interface/AI/app.js b/01_Code/physical_computing_interface/AI/app.js new file mode 100644 index 0000000000000000000000000000000000000000..f48977c0708fcc707518a48611b70673657797e9 --- /dev/null +++ b/01_Code/physical_computing_interface/AI/app.js @@ -0,0 +1,240 @@ +// Amira Abdel-Rahman +// (c) Massachusetts Institute of Technology 2020 + +/////////////////function calls///////////////// +//todo when calling say which gridsize and grid type +var utils= new utilities(); +var GLOBALS=new globals(utils); + +// +var three=new threejs(GLOBALS,utils,'webgl','threejs1'); +three.init(); + + +initGraph();// todo enclose into class +initEditor();// todo enclose into class + +var assembler= new Assembler(three,GLOBALS,1,50,[new THREE.Vector3(0,0,0)],[new THREE.Vector3(GLOBALS.gridSize/2.0*GLOBALS.voxelSpacing,0,0)]); +assembler.run(); +var data={ + color:GLOBALS.color3 +}; +//GLOBALS.color3 +offsetX=0; +offsetY=5; +for(var i=0;i<6;i++){ + for(var j=0;j<11;j++){ + GLOBALS.addNode(i+offsetX,j+offsetY,0,false,data); + } +} +data={ + color:GLOBALS.color5 +}; + + +//0008.out +var nodes=[ + [0, 0], + [0, 1], + [0, 2], + [0, 3], + [0, 4], + [0, 5], + [5, 1], + [5, 2], + [5, 4], + [10, 3] +]; + +// //0072.out +// var nodes=[ +// [ 0, 0], +// [ 0, 1], +// [ 0, 2], +// [ 0, 3], +// [ 0, 4], +// [ 0, 5], +// [ 2, 1], +// [ 2, 2], +// [ 2, 4], +// [ 4, 3], +// [ 4, 5], +// [ 6, 4], +// [ 8, 2], +// [ 8, 4], +// [10, 3] +// ]; + +//0336.out +// var nodes=[ +// [0.0, 0], +// [0.0, 1], +// [0.0, 2], +// [0.0, 3], +// [0.0, 4], +// [0.0, 5], +// [1, 0], +// [1, 1], +// [1, 2], +// [1, 3], +// [1, 4], +// [1, 5], +// [2, 0], +// [2, 1], +// [2, 3], +// [2, 5], +// [3, 1], +// [3, 3], +// [3, 5], +// [4, 1], +// [4, 3], +// [4, 5], +// [5, 2], +// [5, 4], +// [6, 3], +// [7, 2], +// [7, 4], +// [8, 1], +// [8, 3], +// [8, 5], +// [9, 2], +// [10, 3] +// ]; + +for(var c=0;c<nodes.length;c++){ + i=nodes[c][1]; + j=nodes[c][0]; + GLOBALS.changeNodeColor(i+offsetX,j+offsetY,0,false,data); +} + + +// info={ +// name:"prediction", +// parent: 'CNN', +// classes: 'output', +// outputNeigh:-1 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 +// }; +// GLOBALS.addNode(0,12,0,false,info); +// info={ +// name:"categoricalCrossentropy", +// metrics: ['accuracy'], +// parent: 'CNN', +// classes: 'loss', +// outputNeigh:6 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,11,1,false,info); +// info={ +// name:"dense", +// inputShape:"(batch,256)", +// kernelInitializer: 'varianceScaling', +// activation: 'softmax', +// outputShape:"(batch,10)", +// numParams:2570, +// Trainable:true, +// parent: 'CNN', +// classes: 'layers', +// outputNeigh:4 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,11,0,false,info); + +// info={ +// name:"flatten", +// inputShape:"(batch,4,4,16)", +// outputShape:"(batch,256)", +// numParams:0, +// Trainable:true, +// parent: 'CNN', +// classes: 'layers', +// outputNeigh:6 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,10,1,false,info); + +// info={ +// name:"maxPooling2d", +// inputShape:"(batch,12,12,8)", +// poolSize:"[2,2]", +// strides:"[2,2]", +// outputShape:"(batch,4,4,16)", +// numParams:0, +// Trainable:true, +// parent: 'CNN', +// classes: 'layers', +// outputNeigh:4 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,10,0,false,info); + +// info={ +// name:"conv2d", +// inputShape:"(batch,12,12,8)", +// kernelSize:5, +// filters:16, +// strides:1, +// activation: 'relu', +// kernelInitializer: 'varianceScaling', +// outputShape:"(batch,8,8,16)", +// numParams:3216, +// Trainable:true, +// parent: 'CNN', +// classes: 'layers', +// outputNeigh:6 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,9,1 ,false,info); + +// info={ +// name:"maxPooling2d", +// inputShape:"(batch,24,24,8)", +// poolSize:"[2,2]", +// strides:"[2,2]", +// outputShape:"(batch,12,12,8)", +// numParams:0, +// Trainable:true, +// parent: 'CNN', +// classes: 'layers', +// outputNeigh:4 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,9,0 ,false,info); + +// info={ +// name:"conv2d", +// inputShape:"(batch,28,28,1)", +// kernelSize:5, +// filters:8, +// strides:1, +// activation: 'relu', +// kernelInitializer: 'varianceScaling', +// outputShape:"(batch,24,24,8)", +// numParams:208, +// Trainable:true, +// parent: 'CNN', +// classes: 'layers', +// outputNeigh:6 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 + +// }; +// GLOBALS.addNode(0,8,1 ,false,info); + +// var info={ +// name:"MNIST", +// imageSize:"(28,28)", +// numDatasets:65000, +// numTraining:55000, +// numTest:65000-55000, +// parent: 'CNN', +// classes: 'input', +// outputNeigh:4 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 +// }; +// GLOBALS.addNode(0,8,0 ,false,info); + +// info={ +// name:"Test", +// imageSize:"(1,28,28)", +// parent: 'CNN', +// classes: 'viz', +// outputNeigh:5 //-1:none,0:x+1,1:x-1,2:y+1,3:y-1,4:z+1,5:z-1,6:y+1&&z-1 +// }; +// GLOBALS.addNode(0,8,2 ,false,info); \ No newline at end of file diff --git a/01_Code/physical_computing_interface/demos/indexAI.html b/01_Code/physical_computing_interface/demos/indexAI.html new file mode 100644 index 0000000000000000000000000000000000000000..a4a1d793fde995d77512d86cd1f9d1c58eda6bcd --- /dev/null +++ b/01_Code/physical_computing_interface/demos/indexAI.html @@ -0,0 +1,210 @@ +<html> + +<head> + <title>Physical Computing Interface</title> + <link rel="stylesheet" type="text/css" href="style.css" media="screen"/> + <link rel="stylesheet" type="text/css" href="../lib/jsoneditor/jsoneditor.css" > + <!-- <link href="https://unpkg.com/font-awesome@5.8.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> --> + <!-- <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"> --> + <script src="https://kit.fontawesome.com/99c302ff33.js" crossorigin="anonymous"></script> + +</head> + +<body> + + <div id="threejs"> + <div id="threejs1"> + <div class="header1"> + <i> Assembly</i> + <!-- Three.js --> + </div> + + <div id="webgl"></div> + </div> + <div class="slidecontainer"> + <input type="range" min="0" max="0" value="1" class="slider" id="time"> + </div> + + </div> + + <div id="simulation"> + <div id="threejs1"> + <div class="header1"> + <i> Simulation</i> + </div> + <div class="dragbar2"></div> + <!-- <div id="webgl1"></div> --> + <!-- todo put this somewhere elseß --> + <div id=cyy> + + </div> + + </div> + + </div> + + + + <div id="graph"> + <div class="header2"> + <div class="dragbar"></div> + <i> Graph</i> + </div> + <div id=jsondiveditor> + + <div id="cy"></div> + </div> + <div class="dragbar"></div> + + + </div> + + <div id="json"> + + + <div class="header2"> + <div class="dragbar"></div> + <i> Node</i> + </div> + + + <div id=jsondiveditor> + + <br></br> + <!-- <p> + <button class="button" id="setJSON">Get Info</button> + <button class="button" id="getJSON">Set Info</button> + </p> --> + + <div id="jsoneditor"></div> + </div> + <div class="dragbar"></div> + <div class="dragbar1"></div> + + + + </div> + + <div class="footer1"> + <strong>left-click</strong>: place voxel/orbit, <strong>right-click</strong>: radial menu + </div> + + <div class="footer2"> + <!-- update change to more instructions/feedback --> + <i>instructions</i> + </div> + +</body> + +<!-- TODO: + Clean structure to modules? + Add another footer +--> + + +<!-- libraries --> +<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> + +<!-- Import TensorFlow.js --> +<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0/dist/tf.min.js"></script> +<!-- Import tfjs-vis --> +<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis@1.0.2/dist/tfjs-vis.umd.min.js"></script> + + + +<script src="../lib/cytoscape.min.js"></script> +<script src="../lib/cytoscape-cxtmenu.js"></script> +<script src="https://unpkg.com/layout-base/layout-base.js"></script> +<script src="https://unpkg.com/cose-base/cose-base.js"></script> +<script src="https://unpkg.com/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"></script> +<script src="../lib/cytoscape-expand-collapse.js"></script> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.js"></script><!-- edge handling--> +<script src="../lib/cytoscape-edgehandles.js"></script><!-- edge handling--> + + +<script src="../lib/jsoneditor/jsoneditor.js"></script> + + +<script src="../lib/three.min.js"></script> +<script src="../lib/OrbitControls.js"></script> +<script src="../lib/dat.gui.min.js"></script> +<script src="../lib/TransformControls.js"></script> + +<script src="../assembly/InverseKinematic.js"></script><!-- TODO LOCATION --> +<script src="../assembly/voxel.js"></script><!-- TODO CHANGE TO DICE PIECES --> + + +<!-- code --> +<script src="../globals.js"></script> <!-- event handling and GLOBALS,UTILS --> +<script src="../threejs/grid.js"></script><!-- threejs visualization --> +<script src="../assembly/assembly.js"></script><!-- robot assembly --> +<script src="../assembly/replay.js"></script><!-- assembly and timestep handling --> + +<script src="../graph/graph.js"></script><!--graph flow visualization--> + + + + + +<script src="../json/json.js"></script><!-- json --> + +<script src="../AI/app.js"></script><!-- threejs visualization --> + + + + + +<!-- windows control --> +<script> + var i = 0; + $('.dragbar').mousedown(function(e){ + + e.preventDefault(); + $(document).mousemove(function(e){ + // $('#position').html(e.pageX +', '+ e.pageY); + $('#threejs').css("width",e.pageX+2); + + $('#simulation').css("width",e.pageX+2); + + $('#graph').css("left",e.pageX+2); + $('#json').css("left",e.pageX+2); + $('.footer1').css("width",e.pageX+2); + $('.footer2').css("left",e.pageX+2); + + }) + // onWindowResize();//todo change location + }); + + $('.dragbar1').mousedown(function(e){ + e.preventDefault(); + // $('#mousestatus').html("mousedown" + i++); + $(document).mousemove(function(e){ + $('#graph').css("height",e.pageY+2); + $('#json').css("top",e.pageY+2); + + }) + }); + + $('.dragbar2').mousedown(function(e){ + e.preventDefault(); + // $('#mousestatus').html("mousedown" + i++); + $(document).mousemove(function(e){ + $('#threejs').css("height",e.pageY+2); + $('#simulation').css("top",e.pageY+2); + + }) + // onWindowResize();//todo change location + }); + + $(document).mouseup(function(e){ + $(document).unbind('mousemove'); + }); + + +</script> + + + + +</html> diff --git a/01_Code/physical_computing_interface/demos/indexDNN.html b/01_Code/physical_computing_interface/demos/indexDNN.html index 696213e4787b3afb8d9359e26df86a41fc289463..06228a268c7913298a41970d9e1307ac00c5bb20 100644 --- a/01_Code/physical_computing_interface/demos/indexDNN.html +++ b/01_Code/physical_computing_interface/demos/indexDNN.html @@ -149,7 +149,7 @@ <script src="../json/json.js"></script><!-- json --> -<script src="./app1.js"></script><!-- threejs visualization --> +<script src="../dnn/app.js"></script><!-- threejs visualization --> diff --git a/01_Code/physical_computing_interface/demos/app1.js b/01_Code/physical_computing_interface/dnn/app.js similarity index 100% rename from 01_Code/physical_computing_interface/demos/app1.js rename to 01_Code/physical_computing_interface/dnn/app.js diff --git a/01_Code/physical_computing_interface/globals.js b/01_Code/physical_computing_interface/globals.js index 0559d46b32ec766da6828e8449df69504bcd8c03..449727bbeb577273f8b2579395389905dfbb49de 100644 --- a/01_Code/physical_computing_interface/globals.js +++ b/01_Code/physical_computing_interface/globals.js @@ -263,7 +263,7 @@ function globals(utils){ }; - this.grid=this.gridPresets.Dice; + this.grid=this.gridPresets.Cubic; this.utils=utils; this.occupancy=[]; @@ -398,6 +398,29 @@ globals.prototype.adjustTimeStep=function (addRemove,x,y,z){ document.dispatchEvent(adjustTimeStepEvent); }; +globals.prototype.changeNodeColor=function (x,y,z,replay=false,data={}){ + x=parseInt(x); + y=parseInt(y); + z=parseInt(z); + [p_x ,p_y ,p_z ,s_x ,s_y,s_z,r_y]=this.utils.getTransforms(this.grid,x, y,z); + var addNodeEvent = new CustomEvent('changeNodeColor', { + detail: + { + x:x, + y:y, + z:z, + id:'[' +x +"," +y+","+z+']', + posX:p_x, + posY:p_y, + posZ:p_z, + rotY:r_y, + replay:replay, + data:data + } + }); + document.dispatchEvent(addNodeEvent); +}; + globals.prototype.selectNode=function (x,y,z){ var selectNodeEvent = new CustomEvent('selectNode', { detail: diff --git a/01_Code/physical_computing_interface/threejs/grid.js b/01_Code/physical_computing_interface/threejs/grid.js index 8c7bd1144a9583624f28100d788520fc766b322f..beb8de935e4d9a87d31dd4df6eb46a96e3176764 100644 --- a/01_Code/physical_computing_interface/threejs/grid.js +++ b/01_Code/physical_computing_interface/threejs/grid.js @@ -127,7 +127,7 @@ threejs.prototype.init=function() { this.sphereGeo = new THREE.SphereGeometry( this.voxelSpacing/2, 32, 32 ); - this.cubeMaterial = new THREE.MeshPhongMaterial( { color: 0x1c5c61 } ); + this.cubeMaterial = new THREE.MeshPhongMaterial( { color: this.color3 } ); // grid var gridHelper = new THREE.GridHelper( (this.gridSize)*this.voxelSpacing, this.gridSize ); @@ -544,6 +544,20 @@ document.addEventListener('addNode', function (e) { }, false); +document.addEventListener('changeNodeColor', function (e) { + + //deleteHelper Meshes + var name='[' +e.detail.x +"," +e.detail.y+","+e.detail.z+']'; + var object = three.scene.getObjectByName( name ); + var mat=three.cubeMaterial.clone(); + mat.color.setHex(e.detail.data.color); + // three.cubeMaterial.color=GLOBALS.color5; + object.material=mat; + + +}, false); + + document.addEventListener('selectNode', function (e) { var obj=e.detail; [p_x ,p_y ,p_z ,s_x ,s_y,s_z,r_y]=utils.getTransforms(three.grid,obj.x, obj.y,obj.z); diff --git a/02_Presentation/AI_that_grows/AI_grow.md b/02_Presentation/AI_that_grows/AI_grow.md new file mode 100644 index 0000000000000000000000000000000000000000..06c0ca511ea39b761383d277b7eff4db154b6000 --- /dev/null +++ b/02_Presentation/AI_that_grows/AI_grow.md @@ -0,0 +1,50 @@ +# AI that Grows + +Research and development of workflows for the co-design reconfigurable AI software and hardware. + + +## [Weight Agnostic Neural Networks (WANN)](https://weightagnostic.github.io/) + +- "focus on finding minimal architectures". +- "By deemphasizing learning of weight parameters, we encourage the agent instead to develop ever-growing networks that can encode acquired skills based on its interactions with the environment". + + + + +<img src="./square_biped.png" width="50%" /><img src="./square_biped.gif" width="50%" /> + +## Case Study Implementation: Cart-Pole Swing Up + + + +One of the most famous benchmarks of non-linear control, there is lots of approaches including standard q-learning using a discretized state space, [deep Q-learning](http://ml.informatik.uni-freiburg.de/former/_media/publications/riesmc05.pdf) or [linear Q-learning](https://pdfs.semanticscholar.org/94ef/b6e4238c078ca0c443a1a538a52a54fa1e73.pdf) with continuos state space. + +WANN is interesting as it tries to get the simplest network that uses the input sensors (position, rotation and their derivatives) to the output (force). It focuses on learning **principles** and **not only tune weights**. + +<img src="./swing_best.png" width="100%" /> + +This is one of the outputs of the network and you can see because of it's simplicity it's not a black box and one can deduce the principles learnt [[1]](https://towardsdatascience.com/weight-agnostic-neural-networks-fce8120ee829): +- the position parameter is almost directly linked to the force, there is only an inverter which means that if the cart is on right or left of the center (+- x), it always try to **go to in the opposite direction** to the center. +- Based on the weight (shared weight between them all) it learned that one inverter is not enough, so it **doubled** it. +- It shows that it discovered **symmetry**: Most of them pass by a gaussian filter which basically gives the same result for -x and x, which means it's agnostic to sign of the input. + +## Evolution and DICE Integration + +<img src="./wann_run.png" width="100%" /> + +<img src="./evol1.gif" width="75%" /> + + +<img src="./quick.gif" width="100%" /> + +## Next Steps: +- Implement WANN for rover +- Beyond WANN + - [Structure Learning](http://fab.cba.mit.edu/classes/864.20/people/amira/project/dynamic_system_optimization.html) + - Information gain using the ensemble method + - [Notebook](http://fab.cba.mit.edu/classes/864.20/people/amira/project/examples/Pendulum_Ensemble.html) + - Data driven differential equations + - [Sparse Identification of Nonlinear Dynamics](https://arxiv.org/abs/1906.10612) + - [Notebook](http://fab.cba.mit.edu/classes/864.20/people/amira/project/examples/Pendulum_Ensemble.html) +- Integrate shape and control search + \ No newline at end of file diff --git a/02_Presentation/AI_that_grows/WANN_operators.png b/02_Presentation/AI_that_grows/WANN_operators.png new file mode 100644 index 0000000000000000000000000000000000000000..ac8ee4dc87cb183b602f1769753bdee3f27cc18b Binary files /dev/null and b/02_Presentation/AI_that_grows/WANN_operators.png differ diff --git a/02_Presentation/AI_that_grows/WANN_schematic.png b/02_Presentation/AI_that_grows/WANN_schematic.png new file mode 100644 index 0000000000000000000000000000000000000000..2b2bec7c808b3601f12d0acc391a8fd153cb0e4e Binary files /dev/null and b/02_Presentation/AI_that_grows/WANN_schematic.png differ diff --git a/02_Presentation/AI_that_grows/evol.gif b/02_Presentation/AI_that_grows/evol.gif new file mode 100644 index 0000000000000000000000000000000000000000..b492661bd8b5b9fae3f92bc89fbdd4c2dd56d912 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol.gif differ diff --git a/02_Presentation/AI_that_grows/evol/0008.png b/02_Presentation/AI_that_grows/evol/0008.png new file mode 100644 index 0000000000000000000000000000000000000000..a37cfba19c442bc1c0abf95f4cde1adae2a990e5 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0008.png differ diff --git a/02_Presentation/AI_that_grows/evol/0016.png b/02_Presentation/AI_that_grows/evol/0016.png new file mode 100644 index 0000000000000000000000000000000000000000..9e81eb50fb33ab99b6a5f03e70efa59fe8f9c4eb Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0016.png differ diff --git a/02_Presentation/AI_that_grows/evol/0040.png b/02_Presentation/AI_that_grows/evol/0040.png new file mode 100644 index 0000000000000000000000000000000000000000..156f1e472ae1b68778084173d07444f24852a348 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0040.png differ diff --git a/02_Presentation/AI_that_grows/evol/0048.png b/02_Presentation/AI_that_grows/evol/0048.png new file mode 100644 index 0000000000000000000000000000000000000000..6f3aa3d25584262d748e5ad95bf2dcdd9b790b43 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0048.png differ diff --git a/02_Presentation/AI_that_grows/evol/0064.png b/02_Presentation/AI_that_grows/evol/0064.png new file mode 100644 index 0000000000000000000000000000000000000000..09edcce78410b95af4b0f0ee5d0d33f44273c644 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0064.png differ diff --git a/02_Presentation/AI_that_grows/evol/0072.png b/02_Presentation/AI_that_grows/evol/0072.png new file mode 100644 index 0000000000000000000000000000000000000000..2dfe1938bb2c7530e4be0e8ecc1102b8b8aef0c0 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0072.png differ diff --git a/02_Presentation/AI_that_grows/evol/0104.png b/02_Presentation/AI_that_grows/evol/0104.png new file mode 100644 index 0000000000000000000000000000000000000000..5a44fb9bab9916b63edd070b9e19ec4edfa65799 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0104.png differ diff --git a/02_Presentation/AI_that_grows/evol/0120.png b/02_Presentation/AI_that_grows/evol/0120.png new file mode 100644 index 0000000000000000000000000000000000000000..c9e2e223da545acbf32326adc85a752ccb2ed839 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0120.png differ diff --git a/02_Presentation/AI_that_grows/evol/0128.png b/02_Presentation/AI_that_grows/evol/0128.png new file mode 100644 index 0000000000000000000000000000000000000000..2a73c6a240501321c00db9b80241e4bbb5dfa70b Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0128.png differ diff --git a/02_Presentation/AI_that_grows/evol/0136.png b/02_Presentation/AI_that_grows/evol/0136.png new file mode 100644 index 0000000000000000000000000000000000000000..8dd056f808a79289068d61e26e50c510237020c9 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0136.png differ diff --git a/02_Presentation/AI_that_grows/evol/0144.png b/02_Presentation/AI_that_grows/evol/0144.png new file mode 100644 index 0000000000000000000000000000000000000000..8c48a4d2d56531ab8bcd7d64b8edb23cfc526e23 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0144.png differ diff --git a/02_Presentation/AI_that_grows/evol/0168.png b/02_Presentation/AI_that_grows/evol/0168.png new file mode 100644 index 0000000000000000000000000000000000000000..42ef0f9af0a01d46c07257a1d8b49c1f7fab0875 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0168.png differ diff --git a/02_Presentation/AI_that_grows/evol/0240.png b/02_Presentation/AI_that_grows/evol/0240.png new file mode 100644 index 0000000000000000000000000000000000000000..42ef0f9af0a01d46c07257a1d8b49c1f7fab0875 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0240.png differ diff --git a/02_Presentation/AI_that_grows/evol/0248.png b/02_Presentation/AI_that_grows/evol/0248.png new file mode 100644 index 0000000000000000000000000000000000000000..146bef3444ab6f7327cc8495a308c96226c68fcb Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0248.png differ diff --git a/02_Presentation/AI_that_grows/evol/0328.png b/02_Presentation/AI_that_grows/evol/0328.png new file mode 100644 index 0000000000000000000000000000000000000000..146bef3444ab6f7327cc8495a308c96226c68fcb Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0328.png differ diff --git a/02_Presentation/AI_that_grows/evol/0336.png b/02_Presentation/AI_that_grows/evol/0336.png new file mode 100644 index 0000000000000000000000000000000000000000..83688c6678e3916065c9e19853e40aae5ed53c2e Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0336.png differ diff --git a/02_Presentation/AI_that_grows/evol/0360.png b/02_Presentation/AI_that_grows/evol/0360.png new file mode 100644 index 0000000000000000000000000000000000000000..94c8ec5985c61e731ff22c693b5ec8ecdb677779 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0360.png differ diff --git a/02_Presentation/AI_that_grows/evol/0376.png b/02_Presentation/AI_that_grows/evol/0376.png new file mode 100644 index 0000000000000000000000000000000000000000..56b40731ca8fadee167bdd89d6ed91d815bd2c30 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0376.png differ diff --git a/02_Presentation/AI_that_grows/evol/0440.png b/02_Presentation/AI_that_grows/evol/0440.png new file mode 100644 index 0000000000000000000000000000000000000000..56b40731ca8fadee167bdd89d6ed91d815bd2c30 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0440.png differ diff --git a/02_Presentation/AI_that_grows/evol/0448.png b/02_Presentation/AI_that_grows/evol/0448.png new file mode 100644 index 0000000000000000000000000000000000000000..20e11e01a79ab9f0b06fe04da26cfe2c3fe20353 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0448.png differ diff --git a/02_Presentation/AI_that_grows/evol/0464.png b/02_Presentation/AI_that_grows/evol/0464.png new file mode 100644 index 0000000000000000000000000000000000000000..c5e2b91228344be66f93f4f1ebcad1a539329a78 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0464.png differ diff --git a/02_Presentation/AI_that_grows/evol/0592.png b/02_Presentation/AI_that_grows/evol/0592.png new file mode 100644 index 0000000000000000000000000000000000000000..c5e2b91228344be66f93f4f1ebcad1a539329a78 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0592.png differ diff --git a/02_Presentation/AI_that_grows/evol/0600.png b/02_Presentation/AI_that_grows/evol/0600.png new file mode 100644 index 0000000000000000000000000000000000000000..683c6d1fe7d50254c000511a18f234fa66a1392f Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0600.png differ diff --git a/02_Presentation/AI_that_grows/evol/0624.png b/02_Presentation/AI_that_grows/evol/0624.png new file mode 100644 index 0000000000000000000000000000000000000000..683c6d1fe7d50254c000511a18f234fa66a1392f Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0624.png differ diff --git a/02_Presentation/AI_that_grows/evol/0632.png b/02_Presentation/AI_that_grows/evol/0632.png new file mode 100644 index 0000000000000000000000000000000000000000..7331f50a0b118eb3156ea9a3aeac69c39a12733b Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0632.png differ diff --git a/02_Presentation/AI_that_grows/evol/0648.png b/02_Presentation/AI_that_grows/evol/0648.png new file mode 100644 index 0000000000000000000000000000000000000000..24b69204701d64e3cecbe490a9d432972a27f326 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0648.png differ diff --git a/02_Presentation/AI_that_grows/evol/0744.png b/02_Presentation/AI_that_grows/evol/0744.png new file mode 100644 index 0000000000000000000000000000000000000000..24b69204701d64e3cecbe490a9d432972a27f326 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol/0744.png differ diff --git a/02_Presentation/AI_that_grows/evol1.gif b/02_Presentation/AI_that_grows/evol1.gif new file mode 100644 index 0000000000000000000000000000000000000000..e2ddd08f3cf1e1d39b5c313b151c9e3c92ee4858 Binary files /dev/null and b/02_Presentation/AI_that_grows/evol1.gif differ diff --git a/02_Presentation/AI_that_grows/quick.gif b/02_Presentation/AI_that_grows/quick.gif new file mode 100644 index 0000000000000000000000000000000000000000..6f95f9fdec472ebac783fc19c965c7f2537eca3f Binary files /dev/null and b/02_Presentation/AI_that_grows/quick.gif differ diff --git a/02_Presentation/AI_that_grows/quick.mp4 b/02_Presentation/AI_that_grows/quick.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..3e379ebead2242348ba81bfd1c95742a7db99c46 Binary files /dev/null and b/02_Presentation/AI_that_grows/quick.mp4 differ diff --git a/02_Presentation/AI_that_grows/quick.pptx b/02_Presentation/AI_that_grows/quick.pptx new file mode 100644 index 0000000000000000000000000000000000000000..44b77cf7c7ca53f0d35b98fceb2ad72bf183aa3f Binary files /dev/null and b/02_Presentation/AI_that_grows/quick.pptx differ diff --git a/02_Presentation/AI_that_grows/square_biped.gif b/02_Presentation/AI_that_grows/square_biped.gif new file mode 100644 index 0000000000000000000000000000000000000000..fee9eb748da57806de48dd0feccce204669df417 Binary files /dev/null and b/02_Presentation/AI_that_grows/square_biped.gif differ diff --git a/02_Presentation/AI_that_grows/square_biped.png b/02_Presentation/AI_that_grows/square_biped.png new file mode 100644 index 0000000000000000000000000000000000000000..fc629d352e5fa3ed13f6ee08d2a2a2c718964874 Binary files /dev/null and b/02_Presentation/AI_that_grows/square_biped.png differ diff --git a/02_Presentation/AI_that_grows/swing.gif b/02_Presentation/AI_that_grows/swing.gif new file mode 100644 index 0000000000000000000000000000000000000000..aa0302e23a55d746c84431f27ed0e3e40b713210 Binary files /dev/null and b/02_Presentation/AI_that_grows/swing.gif differ diff --git a/02_Presentation/AI_that_grows/swing_best.png b/02_Presentation/AI_that_grows/swing_best.png new file mode 100644 index 0000000000000000000000000000000000000000..d0634d0537cd04c1b129aa8155fc7edfdc48cd89 Binary files /dev/null and b/02_Presentation/AI_that_grows/swing_best.png differ diff --git a/02_Presentation/AI_that_grows/wann_run.png b/02_Presentation/AI_that_grows/wann_run.png new file mode 100644 index 0000000000000000000000000000000000000000..8f39406338aca57b5e14be3b940cbd5a808689cf Binary files /dev/null and b/02_Presentation/AI_that_grows/wann_run.png differ diff --git a/02_Presentation/200508_CNN.png b/02_Presentation/CNN/200508_CNN.png similarity index 100% rename from 02_Presentation/200508_CNN.png rename to 02_Presentation/CNN/200508_CNN.png diff --git a/02_Presentation/CNN/CNN.md b/02_Presentation/CNN/CNN.md new file mode 100644 index 0000000000000000000000000000000000000000..85492c9d2b587da6df2e173f0e79c8562a80a781 --- /dev/null +++ b/02_Presentation/CNN/CNN.md @@ -0,0 +1,29 @@ +# DICE for CNN + + + +- [Convolutional Neural Network (CNN) Demo](https://amiraa.pages.cba.mit.edu/physical-computing-design-tools/01_Code/physical_computing_interface/demos/indexDNN.html) + + +Another important application for DICE is to create reconfigurable computing systems for machine learning. Deep Neural Networks (DNNs) are currently used in countless applications, and through time, the models are becoming deeper and more sophisticated. In an attempt to benchmark and compare the training performance of variably sized and shaped DNNs on different hardware architectures (CPUs, GPUs or TPUs), its was concluded that there were no winners [1]. TPUs had the highest throughput and worked best with large batches, GPUs were more flexible for small problems and irregular computations, and CPUs were the most programmable and were the only ones to support larger models [1]. There is an increased need for accelerators and application-specific hardware in order to reduce data movement, one of the main bottlenecks of deep learning training, without compromising accuracy, throughput and cost [2]. + +Consequently, joint hardware/software design workflows are essential for developing a deep learning system, where spatial computing architectures are tailored to the depth and shape of the DNNs, as well as to the size of the training data. This will minimize the data movement and shared memory access, which dominates the energy consumption in traditional computing architectures. + +As a first step to address this problem, a machine learning add-on was implemented as part of the integrated physical computing design tools. There, one is able to choose and add different kinds of DNN layers and specify their size, activation function, and parallelism strategy. The add-on also has a real-time graphical visualization of the training progress showing the updated accuracy of the model though time. + +In order to benchmark and estimate the computing requirements for DICE to train DNNs, we chose AlexNet, a Convolutional Neural Network (CNN) that is widely used for benchmarking hardware as it was the first CNN to win the ImageNet challenge [3]. +AlexNet consists of five convolutional (CONV) layers and three fully connected (FC) layers. For a 227x227 input image, it requires 61M weights and 724M multiply-and-accumulates (MACs). Similar to most DNN architectures, the FC layers have significantly more weights than CONV layers (58.6M vs 2.3M) and CONV layers are more computationally expensive than FC layers (666M MACs vs 58.6M MACs). + +Assuming complete data parallelism, a number of challenges arise when naively trying to map AlexNet onto a DICE system that uses only one type of node (the SAMD51 processor prototype). Since each processor has only 256Kb of RAM, for FC layers, one might need up to 2300 nodes just to store the weights and perform the calculations, which will result in a communication overhead of more than 1600\%. Therefore, specialized node types are required to efficiently map AlexNet, or any DNN, into a DICE architecture in an effort to minimize data movement, maximize number of parallel computations, and minimize the number of idle nodes. One is to design hierarchical memory allocation and access. Dedicated memory nodes could store data (filters, weights or input images) which is hierarchically broadcast based on the layer architecture. This enables temporal and spatial data reuse, where the data is read only once from the expensive memory and is sent to the small local cheap memory for reuse. Moreover, the number of weights stored and computation performed can be pruned by introducing specialized nodes that address the sparsity generated when using the `ReLU' as an activation function. For example, AlexNet's layers have around 19-63\% sparsity. This has proven to reduce the energy cost by 96\% using similar spatial architecture hardware [4]. If these changes were implemented, in addition to using the projected Summit MCU instead of the SAMD51, the computation speed will increase by 85x and the average communication overhead for FC layers will decrease to 33\%. + +Even though the performance of the first generation DICE demonstration for deep learning applications does not outperform current specialized HPC architectures, advances in Internet of Things and embodied computing require computation to be physically near sensors and data collection devices in order to minimize large data transfer. The modularity and ease of assembly of DICE will facilitates this system integration along with specialized robotic and electro-mechanical input and output modules for data collection, actuation and output visualization. + +Furthermore, one key aspect of DICE modules is their reconfigurability; this means that in addition to changing the hardware modules to fit different types of networks, one can reconfigure the hardware itself as a system learns. Recent research in deep learning is developing dynamic DNNs that not only optimize their weights but also their structure, which means that the hardware should be optimized to match at different stages of the training. This reconfigurability will also be essential for online learning and probabilistic inference tasks where the computing architecture grows as more data are presented or more analysis is needed. + +[1] Y. E. Wang, G.-Y. Wei, and D. Brooks, “Benchmarking tpu, gpu, and cpuplatforms for deep learning,”arXiv preprint arXiv:1907.10701, 2019. + +[2] V. Sze, Y.-H. Chen, T.-J. Yang, and J. S. Emer, “Efficient processing of deep neural networks: A tutorial and survey,”Proceedings of the IEEE,vol. 105, no. 12, pp. 2295–2329, 2017. + +[3] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Image net classification with deep convolutional neural networks,” inAdvances in neural information processing systems, 2012, pp. 1097–1105. + +[4] Y.-H. Chen, T. Krishna, J. S. Emer, and V. Sze, “Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural net-works,”IEEE journal of solid-state circuits, vol. 52, no. 1, pp. 127–138,2016 \ No newline at end of file diff --git a/02_Presentation/dice_design.png b/02_Presentation/dice_design.png new file mode 100644 index 0000000000000000000000000000000000000000..067277a4fe6147031b3764308693fd323aeca812 Binary files /dev/null and b/02_Presentation/dice_design.png differ diff --git a/02_Presentation/200114_simulation.PNG b/02_Presentation/macro_dice/200114_simulation.PNG similarity index 100% rename from 02_Presentation/200114_simulation.PNG rename to 02_Presentation/macro_dice/200114_simulation.PNG diff --git a/02_Presentation/macro_dice/assembly.gif b/02_Presentation/macro_dice/assembly.gif new file mode 100644 index 0000000000000000000000000000000000000000..17122bd38b806777371542e5923c578fafbf9fba Binary files /dev/null and b/02_Presentation/macro_dice/assembly.gif differ diff --git a/02_Presentation/macro_dice/dice_assembly.gif b/02_Presentation/macro_dice/dice_assembly.gif new file mode 100644 index 0000000000000000000000000000000000000000..f53c6eeb8bb0940243765b73d42436d98eb486d9 Binary files /dev/null and b/02_Presentation/macro_dice/dice_assembly.gif differ diff --git a/02_Presentation/macro_dice/macro_dice.md b/02_Presentation/macro_dice/macro_dice.md new file mode 100644 index 0000000000000000000000000000000000000000..e588fdce4d6ef5c0ea86dc2b09ec6dbbd84182f1 --- /dev/null +++ b/02_Presentation/macro_dice/macro_dice.md @@ -0,0 +1,40 @@ +# Digital Material Modeling and Simulation + +Case study of the design and optimization of Macro-DICE. + +Hardware Implementation: +- [VoxRob](https://gitlab.cba.mit.edu/bej/voxrob) +- [rover](https://gitlab.cba.mit.edu/ccameron/rover) +- [DM3](https://gitlab.cba.mit.edu/bej/dm3) + + +## Structure Simulation Integration + +Using the [MetaVoxel simulation tool](https://gitlab.cba.mit.edu/amiraa/metavoxels): + + + +## Robotics Design + +<img src="./dice_assembly.gif" width="100%" /><br/> + +## Assembly +- Option for different kinds of assembly (swarm assembly) +<img src="./assembly.gif" width="100%" /> <br/> + +## Control +<img src="./rover1.gif" width="75%" /> +<img src="./rover2.gif" width="75%" /><br/> + +<img src="./r.gif" width="75%" /><br/> + +<img src="./rr.gif" width="75%" /><br/> + + +## Optimization + +- Two level optimization + - Shape (body) => [Hierarchal Local Online Shape Optimization](https://gitlab.cba.mit.edu/amiraa/metavoxels/-/blob/master/02_Presentation/top_opt/search.md) + - Control (mind) => [AI that grows](../AI_that_grows/AI_grow.md) + - Simultaneous optimization of shape and control + diff --git a/02_Presentation/macro_dice/r.gif b/02_Presentation/macro_dice/r.gif new file mode 100644 index 0000000000000000000000000000000000000000..253598e88dc47750ad023196d1b5fec58acba56a Binary files /dev/null and b/02_Presentation/macro_dice/r.gif differ diff --git a/02_Presentation/macro_dice/rover1.gif b/02_Presentation/macro_dice/rover1.gif new file mode 100644 index 0000000000000000000000000000000000000000..d831f6f6ed16e730b720261e5a5f1acd1e1ae2ae Binary files /dev/null and b/02_Presentation/macro_dice/rover1.gif differ diff --git a/02_Presentation/macro_dice/rover2.gif b/02_Presentation/macro_dice/rover2.gif new file mode 100644 index 0000000000000000000000000000000000000000..ca258b468696c931ddb66934b379944519ead7fb Binary files /dev/null and b/02_Presentation/macro_dice/rover2.gif differ diff --git a/02_Presentation/macro_dice/rover3.gif b/02_Presentation/macro_dice/rover3.gif new file mode 100644 index 0000000000000000000000000000000000000000..253598e88dc47750ad023196d1b5fec58acba56a Binary files /dev/null and b/02_Presentation/macro_dice/rover3.gif differ diff --git a/02_Presentation/macro_dice/rr.gif b/02_Presentation/macro_dice/rr.gif new file mode 100644 index 0000000000000000000000000000000000000000..9973036f1a6d3c1ab84d27e69f36dce4aa89570c Binary files /dev/null and b/02_Presentation/macro_dice/rr.gif differ diff --git a/02_Presentation/pp.png b/02_Presentation/prob/pp.png similarity index 100% rename from 02_Presentation/pp.png rename to 02_Presentation/prob/pp.png diff --git a/02_Presentation/ppp.png b/02_Presentation/prob/ppp.png similarity index 100% rename from 02_Presentation/ppp.png rename to 02_Presentation/prob/ppp.png diff --git a/02_Presentation/prob/prob.md b/02_Presentation/prob/prob.md new file mode 100644 index 0000000000000000000000000000000000000000..ebcead3878aa6a134e29777583233c96af1d7ee9 --- /dev/null +++ b/02_Presentation/prob/prob.md @@ -0,0 +1,73 @@ +# Probabilistic Programming + +- [Gamalon](https://gamalon.com/) +- Using Dice pieces to do **inference** + - in order to find the best configuration based on its performance + - other tasks +- [WebPPL: ](http://webppl.org/) probabilistic programming for the web +- Probabilistic Graphical Models + + + + +In order to map the hardware architecture to an input dataflow program or computation graph, I modeled the hardware and software models as probabilistic graphical model, and used probabilistic programming to infer the best hardware architecture choices that will optimize the speed, energy and cost of the system. + +I used [WebPPL](http://dippl.org/chapters/02-webppl.html) a probabilistic programming language in javascript. I model the variables I want to infer as if they come from different types of distributions that integrate our priors in them. In the following example I am using markov chain monte carlo as an inference method. + +[The demo lives here.](https://amiraa.pages.cba.mit.edu/physical-computing-design-tools/01_Code/physical_computing_interface/probabilisticProjections/index.html) + +The structure of the probabilistic program looks like this: + +```javascript +var model=function (){ + + var chipType=function () { return uniformDraw(["STM32F412","samd51j19","samd51j20","MAX32660","STM32F412","XMEGA"])}; + var chip=processors.type[chipType()]; + //display(chip.name); + + var ram=chip.ram; + var cyclesPerSecond =chip.cyclesPerSecond; + var bitsPerSecond =chip.bitsPerSecond ; + var costPerChip =chip.costPerChip ; + var flopsPerWatt =chip.flopsPerWatt ; + + var interconnect=mem(function (model) { return uniformDraw([2,4,6])}); + var nodesNumber= mem(function (model) { return uniformDraw([10,20,30,40,50])}); + + var dataExchangeSize=mem(function (model) {return gaussian(1e3, 10)}); + var memoryPerComputation=mem(function (model) {return gaussian(10e3, 10)}); + var numberofComputations=mem(function (model) {return gaussian(200, 10)}); //nodes of similar computations + var computation = mem(function (model) {return gaussian(100, 20)}); + var maxNumberOfInterconnects= mem(function (model) {return gaussian(10, 2)}); + + doCalculation(); + + + var speed=computationTime+communicationTime; //frame + var cost=nodesNumber("DICE")*costPerChip; + var energy= 1 / flopsPerWatt*numberofNodesNeeded*computationTime;//per frame + + + condition(speed<0.0012 && cost<180); + // return [speed,cost,energy] + + if(result==1){ + return chip.name; + + }else if(result==2){ + return interconnect("DICE"); + + }else{ + return nodesNumber("DICE"); + } +} + +var result=3; +var options = {method: 'MCMC', kernel: 'MH', samples: 10000} +var dist = Infer(options, model) +viz(dist) + +display('Expected nodesNumber: ' + expectation(dist)) +expectation(dist) +``` +Until now I have a dummy computation model. Next steps would be to get a complex computational graph and for each part infer the best hardware architecture for it. Moreover, if the computation graph changes through time one can also alter the hardware architecture to respond to these changes. \ No newline at end of file diff --git a/02_Presentation/ref.bib b/02_Presentation/ref.bib new file mode 100644 index 0000000000000000000000000000000000000000..c75679fc8a3a397cdeabf4063b64c4b6b0f1da4e --- /dev/null +++ b/02_Presentation/ref.bib @@ -0,0 +1,317 @@ +references for all sections of the paper + +\bibliographystyle{./IEEEtran} +\bibliography{./IEEEabrv,./IEEEexample} + +@article{moore2020chiplets, + title={Chiplets are the future of processors: Three advances boost performance, cut costs, and save power}, + author={Moore, Samuel K}, + journal={IEEE Spectrum}, + volume={57}, + number={5}, + pages={11--12}, + year={2020}, + publisher={IEEE} +} + +@article{henry1956project, + title={Project Tinkertoy: a system of mechanized production of electronics based on modular design}, + author={Henry, R}, + journal={IRE Transactions on Production Techniques}, + volume={1}, + number={1}, + pages={11--11}, + year={1956}, + publisher={IEEE} +} + +@misc{Gibson:2018, + title = {Revisiting the 2008 Exascale Computing Study at SC18}, + author = {Scott Gibson}, + howpublished = {HPC Wire}, + URL = {\url{https://www.hpcwire.com/2018/11/29/revisiting-the-2008-exascale-computing-study-at-sc18/}}, + year = {Nov. 29, 2018. Accessed on: June 15, 2020)} +} + +@misc{Strohmaier:2019, + title = {Top 500 The List}, + author = {Strohmaier,Erich and Dongarra,Jack and Simon,Horst and Meuer,Martin and Meuer,Hans}, + howpublished = {Top 500}, + URL = {\url{https://www.top500.org/lists/2019/11/}}, + year = {Nov. 2019. Accessed on: June 13, 2020)} +} + +@misc{Green500, + URL = {\url{https://www.top500.org/green500}} + } + +@book{Gershenfeld:1998, + author = {Neil Gershenfeld}, + title = {The Nature of Mathematical Modeling}, + publisher = {Cambridge University Press; 1st edition}, + year = {Nov. 1998}, +} + +@article{Soloviev:2017, + title={Beyond Moore’s technologies: operation principles of a superconductor alternative}, + volume={8}, + ISSN={2190-4286}, + url={http://dx.doi.org/10.3762/bjnano.8.269}, + DOI={10.3762/bjnano.8.269}, + journal={Beilstein Journal of Nanotechnology}, + publisher={Beilstein Institut}, + author={Soloviev, Igor I and Klenov, Nikolay V and Bakurskiy, Sergey V and Kupriyanov, Mikhail Yu and Gudkov, Alexander L and Sidorenko, Anatoli S}, + year={2017}, + month={Dec}, + pages={2689–2710} +} + +@article{Takeuchi:2019, +author = {Takeuchi,Naoki and Yamae,Taiki and Ayala,Christopher L. and Suzuki,Hideo and Yoshikawa,Nobuyuki }, +title = {An adiabatic superconductor 8-bit adder with 24kBT energy dissipation per junction}, +journal = {Applied Physics Letters}, +volume = {114}, +number = {4}, +pages = {042602}, +year = {2019}, +doi = {10.1063/1.5080753}, +URL = { + https://doi.org/10.1063/1.5080753 +}, +eprint = { + https://doi.org/10.1063/1.5080753 +} +} + +@inproceedings{Arvanitou:2020, +author = {Arvanitou, Elvira Maria and Ampatzoglou, Apostolos and Nikolaidis, Nikolaos and Tsintzira, Angeliki and Ampatzoglou, Areti and Chatzigeorgiou, Alexander}, +year = {2020}, +month = {08}, +pages = {}, +booktitle = {46th Euromicro Conference on Software Engineering and Advanced Applications (SEAA 20)}, +title = {Investigating Trade-offs between Portability, Performance and Maintainability in Exascale Systems} +} + +@article{sze2017efficient, + title={Efficient processing of deep neural networks: A tutorial and survey}, + author={Sze, Vivienne and Chen, Yu-Hsin and Yang, Tien-Ju and Emer, Joel S}, + journal={Proceedings of the IEEE}, + volume={105}, + number={12}, + pages={2295--2329}, + year={2017}, + publisher={Ieee} +} + +@mastersthesis{Langford:2014, + title={Electronic Digital Materials}, + author={Langford, William K}, + year={2014}, + school={Massachusetts Institute of Technology}, + url={http://cba.mit.edu/docs/theses/14.08.Langford.pdf} +} + +@article{Henry:2003, + title={Project Tinkertoy}, + journal={Journal of the Franklin Institute}, + volume={256}, + number={6}, + pages={598--599}, + year={2003}, + author={Henry, R. L.} +} + +@article{Burks:1969, + title={Von Neumann's Self-Reproducing Automata}, + journal={University of Michigan Technical Report}, + year={1969}, + author={Burks, A. W.} +} + +@misc{Fried:2018, + title = {Adafruit Feather M4 Express}, + author = {Fried, Limor}, + howpublished = {Adafruit Learning System}, + URL = {\url{https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51}}, + year = {July 2018. Accessed on: June 18, 2020} +} + +@misc{Microchip:2020, + title = {ATSAMD51J20A - 32-Bit SAM Microcontrollers}, + author = {Microchip}, + URL = {\url{https://www.microchip.com/wwwproducts/en/ATSAMD51J20A}}, + year = {Accessed on: June 18, 2020} +} + +@misc{Molex:2020, + title = {SlimStack Board-to-Board Connectors}, + author = {Molex}, + URL = {\url{https://www.molex.com/molex/products/family/slimstack\_fine\_pitch \_smt\_board\_to\_board\_connectors}}, + year = {Accessed on: June 18, 2020} +} + +@misc{Arm:2020, + title = {GNU Toolchain}, + author = {ARM}, + URL = {\url{https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm}}, + year = {Accessed on: June 19, 2020} + } + +@inproceedings{Dalrymple:2008, + title={Asynchronous logic automata.}, + author={Dalrymple, David and Gershenfeld, Neil and Chen, Kailiang}, + booktitle={Automata}, + pages={313--322}, + year={2008} +} + +@article{Gershenfeld:2010, + title = {Reconfigurable Asynchronous Logic Automata: (RALA)}, + author = {Gershenfeld, Neil and Dalrymple, David and Chen, Kailiang and Knaian, Ara and Green, Forrest and Demaine, Erik D. and Greenwald, Scott and Schmidt-Nielsen, Peter}, + year = {2010}, + issue_date = {January 2010}, + publisher = {Association for Computing Machinery}, + address = {New York, NY, USA}, + volume = {45}, + number = {1}, + issn = {0362-1340}, + url = {https://doi.org/10.1145/1707801.1706301}, + doi = {10.1145/1707801.1706301}, + journal = {SIGPLAN Not.}, + month = {January}}, + pages = {1–6}, + numpages = {6}, +} + +@inproceedings{Kung:1979, + title={Systolic arrays (for VLSI)}, + author={Kung, HT and Leiserson, Charles E}, + booktitle={Sparse Matrix Proceedings 1978}, + volume={1}, + pages={256--282}, + year={1979}, + organization={Society for industrial and applied mathematics} +} + +@article{Peterson:1977, + title={Petri nets}, + author={Peterson, James L}, + journal={ACM Computing Surveys (CSUR)}, + volume={9}, + number={3}, + pages={223--252}, + year={1977}, + publisher={ACM New York, NY, USA} +} + +@article{Flynn:1972, + title={Some computer organizations and their effectiveness}, + author={Flynn, Michael J}, + journal={IEEE transactions on computers}, + volume={100}, + number={9}, + pages={948--960}, + year={1972}, + publisher={IEEE} +} + +@article{Day:1983, + title={The OSI reference model}, + author={Day, John D and Zimmermann, Hubert}, + journal={Proceedings of the IEEE}, + volume={71}, + number={12}, + pages={1334--1340}, + year={1983}, + publisher={IEEE} +} + +@techreport{plimpton:1993, + title={Fast parallel algorithms for short-range molecular dynamics}, + author={Plimpton, Steve}, + year={1993}, + institution={Sandia National Labs., Albuquerque, NM (United States)} +} + +@article{shaw:2005, + title={A fast, scalable method for the parallel evaluation of distance-limited pairwise particle interactions}, + author={Shaw, David E}, + journal={Journal of computational chemistry}, + volume={26}, + number={13}, + pages={1318--1328}, + year={2005}, + publisher={Wiley Online Library} +} + +@article{wang2019benchmarking, + title={Benchmarking TPU, GPU, and CPU platforms for deep learning}, + author={Wang, Yu Emma and Wei, Gu-Yeon and Brooks, David}, + journal={arXiv preprint arXiv:1907.10701}, + year={2019} +} + +@inproceedings{krizhevsky2012imagenet, + title={Imagenet classification with deep convolutional neural networks}, + author={Krizhevsky, Alex and Sutskever, Ilya and Hinton, Geoffrey E}, + booktitle={Advances in neural information processing systems}, + pages={1097--1105}, + year={2012} +} + +@INPROCEEDINGS{Amerson:1995, + + author={R. {Amerson} and R. J. {Carter} and W. B. {Culbertson} and P. {Kuekes} and G. {Snider}}, + + booktitle={Proceedings IEEE Symposium on FPGAs for Custom Computing Machines}, + + title={Teramac-configurable custom computing}, + + year={1995}, + + volume={}, + + number={}, + + pages={32-38},} + + +@ARTICLE{Saint-Lauren:2015, + author={M. {Saint-Laurent} and P. {Bassett} and K. {Lin} and B. {Mohammad} and Y. {Wang} and X. {Chen} and M. {Alradaideh} and T. {Wernimont} and K. {Ayyar} and D. {Bui} and D. {Galbi} and A. {Lester} and M. {Pedrali-Noy} and W. {Anderson}}, + journal={IEEE Journal of Solid-State Circuits}, + title={A 28 nm DSP Powered by an On-Chip LDO for High-Performance and Energy-Efficient Mobile Applications}, + year={2015}, + volume={50}, + number={1}, + pages={81-91},} + + @article{Barrio:2014, +author = {Del Barrio, Alberto A. and Bagherzadeh, Nader and Hermida, Rom\'{a}n}, +title = {Ultra-Low-Power Adder Stage Design for Exascale Floating Point Units}, +year = {2014}, +issue_date = {March 2014}, +publisher = {Association for Computing Machinery}, +address = {New York, NY, USA}, +volume = {13}, +number = {3s}, +issn = {1539-9087}, +url = {https://doi.org/10.1145/2567932}, +doi = {10.1145/2567932}, +journal = {ACM Trans. Embed. Comput. Syst.}, +month = mar, +articleno = {105}, +numpages = {24}, +keywords = {Floating point unit, multispeculation, multiply accumulation} +} + +@article{chen2016eyeriss, + title={Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural networks}, + author={Chen, Yu-Hsin and Krishna, Tushar and Emer, Joel S and Sze, Vivienne}, + journal={IEEE journal of solid-state circuits}, + volume={52}, + number={1}, + pages={127--138}, + year={2016}, + publisher={IEEE} +} + diff --git a/02_Presentation/~$Slide_hpc.pptx b/02_Presentation/~$Slide_hpc.pptx deleted file mode 100644 index 6791372cd806bf45aa9c97e95fbda8ba86157636..0000000000000000000000000000000000000000 Binary files a/02_Presentation/~$Slide_hpc.pptx and /dev/null differ diff --git a/README.md b/README.md index 2a9ff74b20921c100bf7d6a5894ba21036620e33..f3eb83b29ebae92ad7192e291afd723908637d9a 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,21 @@ -# Physical Computing Design Tools - - - +# Physical Computing Design Tools (PC Tools) + ## Description The Physical Computing Design tool is an integrated design tool for the design, simulation, optimization and fabrication of reconfigurable computing systems. -Traditional electronics design workflows follow a three stage sequential linear process that starts with the design of the system, then the analysis and simulation, and finally the fabrication and testing of these systems. Very often these stages are executed independently from each other, using different tools and sometimes different teams, making it very hard to translate the feedback from the simulation or testing stages into viable design amendments. This results in the design workflow, which is an inherently iterative process, being be a very tedious and inefficient process. - -Therefore, we present an integrated, closed loop physical computing design tool where one can design, simulate, optimize and fabricate reconfigurable computing systems. +Traditional electronics design workflows follow a sequential linear process that starts with design, then analysis and simulation, and finally system fabrication and testing. Often these stages are executed independently from each other, using different tools, making it hard to translate the feedback from the simulation or testing stages into viable design amendments. This adds considerable inefficiency to an inherently iterative design workflow. As an alternative, we developed an integrated, closed loop DICE design tool where one can design, simulate, optimize and fabricate re-configurable computing systems The following steps explain in detail the proposed design workflow: 1. **Design**: The first step is to place the DICE nodes and visualize the 3D assembly of the computing system. -2. **Programming**: Next, one should select each node and specify the node details (code/program, processor, connected neighbors, starting state.. etc). -3. **Analysis**: While placing multiple parts (an assembly), an analysis of the whole computation graph is automatically generated in realtime (average computation per frame, communication bottlenecks, connectivity graph, hierarchal graph), and custom code for application specific analysis could be added. Based this analysis, design recommendation are generated and displayed. For example, using another type of processor, adding extra nodes to divide the computation of overloaded nodes into two, finding more efficient routing for data transfer. -4. **Optimization**: If one wants to further optimize the reconfigurable computing system, the performance projection graph tool visualizes how each hardware and software decision/variable is affecting the projected performance (energy use, speed, cost). There, one describes each input variable as a distribution (normal, categorical..) and a probabilistic programming model is used to infer what is the optimal hardware configuration for the given software workflow. -5. **Simulation**: The simulation window has a visualization of the state and output of the DICE computation. This is either the output of the simulation of DICE computation on the computer before assembling and building the system or later visualizing the data sent back from the DICE system. -6. **Fabrication**: In parallel to the previous steps, the assembly realtime control window makes it very easily to control the assembler and fabricate, program, test the designed systems in realtime and to get feedback and amend the system accordingly. - +2. **Programming**: The user then selects individual nodes to specify details, such as processor type, connected neighbors, program, number of operations, maximum token size, and so forth. During these steps, a connectivity graph is generated in real-time, showing the average computation and communication cost of each node based on these preprogrammed node details. In the future, these numbers could be automatically calculated by pre-compiling and profiling code for each node. +3. **Analysis**: By treating the computation graph as a flow network, graphical algorithms are used to find and highlight computation and communication bottlenecks. Based on this analysis, design recommendations are generated and displayed, including suggestions for different processors, extra nodes, or alternative routing. +4. **Optimization**: If the user wants to further optimize the reconfigurable computing system, the performance projection graph tool visualizes the effect of each hardware and software decision on projected overall system performance. A generative probabilistic programming model is used to draw samples from these inputs and project the cost, energy use, and speed of the system. Using classic inference techniques one is able to infer the optimal hardware configuration for a given software workflow. In the future this could be extended to additionally perform hardware architecture discovery. +5. **Simulation**: the simulation window allows the user to visualize the state and output of the DICE computation. Currently, this shows the output of a simulated computation provided on the host computer prior to physical assembly. In the future, this framework will be used to visualize data from the DICE network. +6. **Fabrication**: In parallel with the previous steps, the real-time assembly control window provides a simple mechanism for controlling the mechanical DICE assembler. Using this feature, systems can be fabricated, programmed, and tested in real-time to quickly pull in feedback and amend the system architecture accordingly. This novel integrated design workflow paves the way for the design of discrete integrated circuits but also reconfigurable computing systems that can change and evolve while execution as needed. @@ -42,6 +37,19 @@ This novel integrated design workflow paves the way for the design of discrete i   +---- + +## Applications + +### - Digital Material Modeling and Simulation ([Macro-DICE](02_Presentation/macro_dice/macro_dice.md)) + +### - [AI that Grows](02_Presentation/AI_that_grows/AI_grow.md) + +### - [Convolutional Neural Networks](02_Presentation/CNN/CNN.md) + +### - [Hardware Architecture Inference and probabilistic programming](02_Presentation/prob/prob.md) + +--- ### Capabilities and Updates - Design @@ -68,101 +76,6 @@ This novel integrated design workflow paves the way for the design of discrete i - voxel design tools - Convolutional neural networks ---- - -## Applications -- The most efficient applications for dice are those who need reconfiguration white running, examples: - - probabilistic programming (Gamalon) - - more computing power while assembling voxels - - Neural Networks? - -### 1- Voxel Simulation - - - -### 2- Convolutional Neural Networks - - - - ---- - -## Hardware Architecture Inference - -#### Probabilistic Programming - -- [Gamalon](https://gamalon.com/) -- Using Dice pieces to do **inference** - - in order to find the best configuration based on its performance - - other tasks -- [WebPPL: ](http://webppl.org/) probabilistic programming for the web -- Probabilistic Graphical Models - - - - -In order to map the hardware architecture to an input dataflow program or computation graph, I modeled the hardware and software models as probabilistic graphical model, and used probabilistic programming to infer the best hardware architecture choices that will optimize the speed, energy and cost of the system. - -I used [WebPPL](http://dippl.org/chapters/02-webppl.html) a probabilistic programming language in javascript. I model the variables I want to infer as if they come from different types of distributions that integrate our priors in them. In the following example I am using markov chain monte carlo as an inference method. - -[The demo lives here.](https://amiraa.pages.cba.mit.edu/physical-computing-design-tools/01_Code/physical_computing_interface/probabilisticProjections/index.html) - -The structure of the probabilistic program looks like this: - -```javascript -var model=function (){ - - var chipType=function () { return uniformDraw(["STM32F412","samd51j19","samd51j20","MAX32660","STM32F412","XMEGA"])}; - var chip=processors.type[chipType()]; - //display(chip.name); - - var ram=chip.ram; - var cyclesPerSecond =chip.cyclesPerSecond; - var bitsPerSecond =chip.bitsPerSecond ; - var costPerChip =chip.costPerChip ; - var flopsPerWatt =chip.flopsPerWatt ; - - var interconnect=mem(function (model) { return uniformDraw([2,4,6])}); - var nodesNumber= mem(function (model) { return uniformDraw([10,20,30,40,50])}); - - var dataExchangeSize=mem(function (model) {return gaussian(1e3, 10)}); - var memoryPerComputation=mem(function (model) {return gaussian(10e3, 10)}); - var numberofComputations=mem(function (model) {return gaussian(200, 10)}); //nodes of similar computations - var computation = mem(function (model) {return gaussian(100, 20)}); - var maxNumberOfInterconnects= mem(function (model) {return gaussian(10, 2)}); - - doCalculation(); - - - var speed=computationTime+communicationTime; //frame - var cost=nodesNumber("DICE")*costPerChip; - var energy= 1 / flopsPerWatt*numberofNodesNeeded*computationTime;//per frame - - - condition(speed<0.0012 && cost<180); - // return [speed,cost,energy] - - if(result==1){ - return chip.name; - - }else if(result==2){ - return interconnect("DICE"); - - }else{ - return nodesNumber("DICE"); - } -} - -var result=3; -var options = {method: 'MCMC', kernel: 'MH', samples: 10000} -var dist = Infer(options, model) -viz(dist) - -display('Expected nodesNumber: ' + expectation(dist)) -expectation(dist) -``` -Until now I have a dummy computation model. Next steps would be to get a complex computational graph and for each part infer the best hardware architecture for it. Moreover, if the computation graph changes through time one can also alter the hardware architecture to respond to these changes. - --- ## TODO and Next Steps: