1. A programmable computation device for performing an inference task specified by a plurality of variables and a plurality of factors, each factor being associated with a subset of the variables, the device comprising: a plurality of processing elements operable in parallel; a connectivity system coupled to each of the processing elements; a controller having an interface for a host system for accepting a specification of at least part of the inference task, and being coupled to the processing elements via the connectivity system; wherein each of the processing elements is configurable by the controller to perform a computation associated with one of the factors concurrently with other of the processing elements performing computation associated with different ones of the factors; and wherein each of the plurality of processing elements is coupled to the connectivity system to exchange messages via the connectivity system, the messages providing inputs and/or outputs to the computations associated with the factors and providing to the controller a result of performing of the at least part of the inference task.