Compiler and Runtime Techniques for Optimizing Deep Learning Applications