Managing sparsity, time, and quality of inference in topic models