cache sampler in pickle