Tests in test_mcmc will fail if we set num_chains > 1. I will add more context about this error later.
As discussed, if num_chains > num_cpu, we set number of chains to num_cpu-1 reserving one for the main process. Since travis machines aren't multi core, we end up with num_chains=1 and throwing a UserWarning. For the time being, I think it is okay to test any functionality related to parallel chains locally, and capture the UserWarning so that travis does not complain (the test should pass exc. for the UserWarning).
There are some errors with the test in my system (on CPU):
_RuntimeError: Cowardly refusing to serialize non-leaf tensor which requires_grad, since autograd does not support crossing process boundaries. If you just want to transfer the data, call detach() on the tensor before serializing (e.g., putting it on the queue)._
When I replace x = pyro.param() by x = tensor(...) (which should be equivalent in MCMC), I get the following errors for different runs:
_UnboundLocalError: local variable 'val' referenced before assignment_
_Marginal y has shape 18x1, while it should be 2 x 10 x 1. In addition, I got a constant value for all y samples._
_Marginal y has no element`._
Thanks for explaining, I will take a look at this.
This is fixed in #1694