Hardware-software co-design for AI performance