fix bugs and improve compute performance

fix bugs and improve compute performance