Refactor torchdynamo and inductor options
Summary:
Use `torch.compile()` interface to run with torchinductor.
Now we will read boolean configs directly from `torch._inductor.config` and apply them to the command line options.
All options have the prefix `--pt2-`, expect when users would like to explicitly disable an option, use prefix `--no-pt2-`.
For example, to set `triton.cudagraphs = True`, use `--pt2-triton-cudagraphs`. To set `triton.cudagraphs=False`, use `--no-pt2-triton-cudagraphs`.
| Old option | New option |
| ------------------------------------------- | ---------------------------------------------------------------------- |
| --torchdynamo inductor | --inductor |
| --full_graph | --nopython |
| --torchinductor_cudagraph | --pt2-triton-cudagraphs, --no-pt2-triton-cudagraphs |
| --torchinductor_fallback_random | --pt2-fallback_random, --no-pt2-fallback_random |
| --torchinductor_enable_group_fusion | deprecated |
| --torchinductor_enable_batch_fusion | deprecated |
| --torchinductor_enable_max_autotune_gemm | --pt2-max_autotune_gemm, --no-pt2-max_autotune_gemm |
| --torchinductor_enable_split_cat_fx_pass | --pt2-split_cat_fx_pass, --no-pt2-split_cat_fx_pass |
| --torchinductor_triton_unique_kernel_names | --pt2-triton-unique_kernel_names, --no-pt2-triton-unique_kernel_names |
| --dump_triton | --pt2-debug, --no-pt2-debug |
| --inductor-compile-mode max-autotune | --inductor-compile-mode max-autotune |
Fixes https://github.com/pytorch/benchmark/issues/2133
Reviewed By: dshi7
Differential Revision: D53491233
fbshipit-source-id: 832f3d5c028d4df3178ed68f2eee555432ac8ad0