Efficient algorithms and hardware architectures for transformer model acceleration