Artificial intelligence algorithms, accelerator hardware architecture, and performance optimization software