Pyro: multi-chain mcmc fails for PriorKernel

Created on 4 Jan 2019  路  4Comments  路  Source: pyro-ppl/pyro

Tests in test_mcmc will fail if we set num_chains > 1. I will add more context about this error later.

bug testing

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fritzo picture fritzo  路  4Comments

martinjankowiak picture martinjankowiak  路  3Comments

ahmadsalim picture ahmadsalim  路  3Comments

fehiepsi picture fehiepsi  路  4Comments

fritzo picture fritzo  路  5Comments