pytorch
48397cdd - [inductor] Fix benchmark_compiled_module codegen with CppWrapperCodeGen (#98608)

Commit
2 years ago
[inductor] Fix benchmark_compiled_module codegen with CppWrapperCodeGen (#98608) The python function `benchmark_compiled_module` ends up using C++ expression printer to print the size for `rand_strided`, so you get a set e.g. `{2, 17}` instead of a tuple `(2, 17)`. Here is a complete example from master: ```python def benchmark_compiled_module(times=10, repeat=10): from torch._dynamo.testing import rand_strided from torch._inductor.utils import print_performance arg0_1 = rand_strided({2, 17}, {17, 1}, device='cpu', dtype=torch.float32) arg1_1 = rand_strided({2, 17}, {17, 1}, device='cpu', dtype=torch.uint8) return print_performance(lambda: call([arg0_1, arg1_1]), times=times, repeat=repeat) ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/98608 Approved by: https://github.com/ngimel
Author
Committer
Parents
Loading