Efficient Use of Limited-Memory Accelerators for Linear Learning on Heterogeneous Systems