benchmark
cbcc103b - Fix benchmarks with self.autocast (#110490)

Commit
2 years ago
Fix benchmarks with self.autocast (#110490) Summary: Fixes https://github.com/pytorch/pytorch/issues/108173 The original error was that there was a type mismatch between the output of eager mode (float16) and from aot_compile (float32). This is because when we run the model eagerly in the benchmarks, we call [self.model_iter_fn](https://github.com/pytorch/pytorch/blob/main/benchmarks/dynamo/common.py#L2072-L2076) to run the model, rather than directly calling the model. In the case of timm models, it calls the model with [self.autocast()](https://github.com/pytorch/pytorch/blob/main/benchmarks/dynamo/timm_models.py#L321-L323), causing the eager model to return a float16 value. However, the model we export with aot_compile does not have the self.autocast context, so it returns float32. X-link: https://github.com/pytorch/pytorch/pull/110490 Approved by: https://github.com/desertfire Reviewed By: kit1980 Differential Revision: D50061164 Pulled By: angelayi fbshipit-source-id: d56d5192cf84c9fdbe67e7d60cbd6df2a5260b2f
Author
Parents
Loading