Towards Hardware-Aware Tractable Learning of Probabilistic Models