add cache to kernelsgd