[RFC] Make fr trace script a console scripts (#134729)

We want to make fr analyzer script a command after users `pip install torch`, that's why we want to mimic what torchrun is doing.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134729
Approved by: https://github.com/c-p-i-o, https://github.com/malfet
ghstack dependencies: #134528, #134780
This commit is contained in:
fduwjj
2024-08-29 20:25:14 -07:00
committed by PyTorch MergeBot
parent a0d0c6b7e6
commit bdfa94b787

View File

@ -1103,6 +1103,12 @@ def configure_extension_build():
"default = torch.distributed.elastic.multiprocessing:DefaultLogsSpecs",
],
}
if cmake_cache_vars["USE_DISTRIBUTED"]:
# Only enable fr_trace command if distributed is enabled
entry_points["console_scripts"].append(
"torchfrtrace = tools.flight_recorder.fr_trace:main",
)
return extensions, cmdclass, packages, entry_points, extra_install_requires