ptrblck:


I think the first 3(?) iterations are used for the optimizations.





As the performance analysis chart show, the third iterations are used for the optimizations . I am confused about this phenomenon, what are the second iterations doing at the beginning ?


Generally speaking, the first iterations will take some time to do the optimizations, and then there is no need to do the same thing later, except for other optimized contents. I don’t know if this assumption is correct ?


I did an experiment a moment ago, I run the code ‘torch::jit::GraphOptimizerEnabledGuard _optimize_guard(true);’ before the ‘module.forward’ function. I want to make the module do the optimizations actively, But It didn’t seem to work.