diff --git a/intermediate_source/torch_compile_tutorial.rst b/intermediate_source/torch_compile_tutorial.rst index e065df6c2cc..b8a824f43b9 100644 --- a/intermediate_source/torch_compile_tutorial.rst +++ b/intermediate_source/torch_compile_tutorial.rst @@ -184,6 +184,10 @@ much as possible, and so we chose ``"reduce-overhead"``. For your own models, you may need to experiment with different modes to maximize speedup. You can read more about modes `here `__. +For general PyTorch benchmarking, you can try using ``torch.utils.benchmark`` instead of the ``timed`` +function we defined above. We wrote our own timing function in this tutorial to show +``torch.compile``'s compilation latency. + Now, let's consider comparing training. .. code-block:: python diff --git a/intermediate_source/torch_compile_tutorial_.py b/intermediate_source/torch_compile_tutorial_.py index 2715259e95e..69e96c8b3b1 100644 --- a/intermediate_source/torch_compile_tutorial_.py +++ b/intermediate_source/torch_compile_tutorial_.py @@ -187,6 +187,10 @@ def evaluate(mod, inp): # you may need to experiment with different modes to maximize speedup. You can # read more about modes `here `__. # +# For general PyTorch benchmarking, you can try using ``torch.utils.benchmark`` instead of the ``timed`` +# function we defined above. We wrote our own timing function in this tutorial to show +# ``torch.compile``'s compilation latency. +# # Now, let's consider comparing training. model = init_model()