What does it mean can not pickle due to not finding function for parallel chain sampling

I tried running the example arbitrary_stochstic.py. It bumps out an error

CustomizablePickler(buffer, self._reducers).dump(obj)

AttributeError: Can’t pickle local object ‘build_model..logp’

There is one post which explains this is due to “it cannot pickle a function for parallel chain sampling”. This is code from git, I did not make any changes. Can someone explain what is wrong and how to fix. I see the same error in my own code and don’t get what is the problem. I do have an idea about parallel sampling, but how does this code violate parallel chain sampling?

Multiprocessing requires everything passed to thread to be picklable. Lambdas defined in local namespace are not picklable.

I submitted a PR today actually to fix the example https://github.com/pymc-devs/pymc3/pull/2947

Thank you, I fixed it according to the instructions.