You could try to use a DistributedSampler for the Hogwild example as described in this post.
DistributedSampler