Optimizing Mixture of Experts using Dynamic Recompilations