Fast Inference with Min-Sum Matrix Product