optimize attention and gemv kernels (#776)