Sunday, 24 January 2010

Day 55

Hi. Here's my to-do list for the first implementation. Everything in green is successfully implemented (accomplished), yellow - not required any more or not my responsibility and red - failures.
  1. Modify the topographica script so that it runs with mpiexec

  2. Make a new subclass of CFProjection, e.g. MultiProcessorCFProjection , that will be a plug-in replacement for CFProjection but with parallel capabilities. At first, MultiProcessorCFProjection does exactly the same thing as CFProjection. Make your test .ty file(s) use this class instead of CFProjection.

  3. To make the rest of the steps easier, turn off optimization (remove _opt from the various components in your copy of tiny.ty or other testing file), so that you don't have to worry about the C code's implicit assumptions. Also turn off learning, for now. Also turn off randomness in the initial weights -- use Gaussian patterns for now.

  4. Find out how to instantiate CFProjection

  5. Once that works, change the constructor or other initialization routines, if any, for MultiProcessorCFProjection to divide the work between compute nodes from the start, so that each node only has a copy of the weights relevant to the processing that it has to do. At first, it's probably easiest if the master node (rank 0) has a copy of all the weights, while the others have only a subset. While in this stage, we can debug everything using the usual plotting and analysis mechanisms that use the data from the master node, without having to reimplement all of that just yet. Implementation plan:

    1. [Chris] Refactor CFProjection to replace the list of lists of cfs (self._cfs) with a flattened list (self.flatcfs?), to remove the assumption that all CFs are stored in 2D arrays. This will require changing all of the C code, which is a pain, but it should actually significantly simplify it.

    2. [Chris] Make the MaskedCFiter use self.flatcfs instead of the self.cfs numpy object array. Again, this should simplify the implementation of MaskedCFIter , while making it simpler to keep everything coherent. Actually, we should probably just make the mask update the flatcfs list whenever it changes, so that only unmasked cfs are in the list; otherwise we'll have a problem relating the 2D mask to the 1D list. Up to this point, none of the changes should involve multiprocessing at all.

    3. When multiprocessing (or on a single processor just for testing), split up the list and distribute it to multiple Python processes, so that any operation invoked on MultiprocessorCFProjection is actually distributed across all processors and run on MultiprocessorCFProjection running on that processor, using its local list of cfs. It's probably best just to assert numpy.alltrue(mask) (or whatever is syntactically correct), and not worry about masks at all.

      1. Find out what exactly CFSheet consists of, and how to distribute it

        1. Figure out what topo.sim['V1'].activity is

        2. Read through the rest of the class

        3. Read through the ProjectionSheet class

      2. Figure out how simulation.connect and simulation.run work

      3. Find out how exactly CFProjection is dotproducting cfs

      4. Figure out what input_sheet_slice.submatrix() is

      5. Figure out how CFIter works and how to iterate from and to a certain point in matrix

      6. Create the s/r mechanism

      7. Using the s/r mechanism, send cfs to slave nodes and store. Check if sending and receiving work

      8. Create new activate() method in MPI_CFProjection

        1. At each call broadcast the input_activity matrix

          1. Create according method in MPI_io

          2. Create according method in MPI_client

          3. Add broadcasting to MPI_CFProjection.activate()

        2. Send an appropriate portion of CF's to each node

          1. Create according method in MPI_io

          2. Create according method in MPI_client

          3. Add broadcasting to MPI_CFProjection.activate()

        3. Gather resulting activities into one matrix

          1. Compute activity on all nodes

          2. Create methods (io,client?) for sending back resulting activities

          3. Gather activities into new matrix at MPI_CFProjection

            1. Transform the non-zero part into a list

            2. Send

            3. Gather at master node and put into the activity array, calculating appropriate position for gathered activity values

      9. Commit to GIT

      10. Debug

      11. Commit again

      12. Test, test, test...

      13. Talk to Jim and Chris

No comments:

Post a Comment