Comments (7)
The following pattern works when called in serial (using fall back to regular python map). It does not work in parallel due to the error below:
def test_to_model(local_test_methods,model):
import matplotlib.pyplot as plt
model.re_init(model.attrs)
local_test_methods(model)
print(local_test_methods)
plt.plot(model.results['t'], model.results['vm'])
plt.savefig(str(local_test_methods)+str('.png'))
plt.clf()
return model.results
def build_single(indexs):
attrs,name,rheobase=indexs
from scoop import futures
model.attrs=attrs
model.update_run_params(attrs)
model.update_run_params(model.attrs)
model.name = str(attrs)
get_neab.suite.tests[0].prediction={}
get_neab.suite.tests[0].prediction['value']=rheobase*qt.pA
judged = list(futures.map(test_to_model,local_test_methods,repeat(model)))
stderr
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/bootstrap/__main__.py", line 92, in main
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/bootstrap/__main__.py", line 285, in run
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/bootstrap/__main__.py", line 266, in futures_startup
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/futures.py", line 65, in _startup
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/_control.py", line 257, in runController
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/_types.py", line 409, in sendResult
File "/opt/conda/lib/python3.5/site-packages/scoop-0.7.2.0-py3.5.egg/scoop/_comm/scoopzmq.py", line 396, in sendResult
File "/opt/conda/lib/python3.5/site-packages/sciunit-0.1.5.6-py3.5.egg/sciunit/__init__.py", line 51, in __getstate__
for key in self.unpicklable:
AttributeError: 'InputResistanceTest' object has no attribute 'unpicklable'
/o
from neuronunit.
Before going any further in this direction, I want to understand why we should expect parallelizing the inside of the test suite to confer any advantage over just parallelizing the parameter search, given a fixed number of cores. Is there any reason to think that cores are sitting around unused if we don't parallelize inside the test suite?
As for the error, I can only imagine it results from the InputResistanceTest constructor not calling the sciunit.SciUnit constructor. I'm not sure why that is happening in serial but not in parallel. Or maybe in parallel when it unpickles that attribute disappears somehow, because it is not actually defined as an attribute of the class anywhere, only initialized in the constructor. Maybe you can try adding unpicklable
as an attribute to the sciunit.SciUnit
class, i.e. unpicklable = None
outside the constructor, just in the body of the class definition (and make sure to use that version of sciunit
).
from neuronunit.
Its not happening in serial because its only parallel mapping (future mapping that pickles), its iwith out futures.map
it just falls back to map which has no need to pickle. Pickling is used to collate results spread out across different CPUs onto rank 0
I think there is an advantage in spreading out the work load when ever a call to NEURON is involved.
Timing would be the only way to find out if this approach has real merit or not.
You are probably right that CPUs should only spread across different parameter spaces, and not the calculation of all of the different types of error.
I am happy to hold back and just assume everything we have done so far is sufficient.
from neuronunit.
More on this issue. If you look at SCOOPs logo which contains a prominent tree or a graph, you can actually see that the philosophy of SCOOP is about nested parallel calls. The easiest way to think about what I am proposing is that calls to futures.map inside futures.map is causing a branching and tree like network topology (its not a persistent topology, it only exists for the duration of the the nested calls to futures.map). The 'O' in or the root, is more like a broker, but sometimes its behaves like a serial processor as all the results are mapped back to it.
I guess my belief that the work loads will get done faster if jobs are spread out across the leaves of a tree (a hierarchal spread as opposed to just spread a flat spread) is only motivated by the philosophy of SCOOP. It may not actually be merit based.
from neuronunit.
Did you try the idea to list unpicklable
explicitly as an attribute of sciunit.SciUnit
?
from neuronunit.
I found where the unpicklable list was initialized as empty list inside an abstract base class inside sciunit. I thought from previous conversations the idea was to append things to this list. Presumably to append them to the list after the base classes object instances are made, and not inside the class definition code itself.
This is not an area that I have a lot of experience with and I can't really pretend to understand how this works.
from neuronunit.
Closing since we decided to focus on ipyparallel.
from neuronunit.
Related Issues (20)
- newer test class for passive elephant tests breaks parallelism in dask, in the case of brian2 backend. HOT 4
- Documenting all Score edge cases that break optimization gradients HOT 3
- A document Notice to debug set PARALLEL_CONFIDENT=False
- Test Suites should be dictionaries not lists. HOT 7
- Use standardized units throughout
- Sciunit judge no longer works with static Models. How can I opt of using the ProtocolToFeaturesTest? HOT 8
- Druckmann Tests are not proper tests
- Confirm that NeuronUnits jNeuromLB backend really can be regarded as a ground truth. HOT 7
- NU test.protocol should be flat or more predictable to traverse.
- Major NU interface redesigns could come with interface diagrams.
- documentation chapters of NeuronUnit should be upgraded to Unit Tests via pytest-ipynb
- 2.5 different code locations that determine sim_length need to be collapsed into one.
- Duplicated content injected current test protocol/parameter
- Installation Fails on Windows HOT 1
- create branch optimization based on dev, that I can merge pull requests into. HOT 2
- Migrate away from travis HOT 2
- Merge error in backend __init__.py HOT 2
- Missing closing ' HOT 1
- Relax constraints on install requirements HOT 1
- unresolved merge conflict in requirements.txt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuronunit.