compute same attention but optimize memory access