Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/performance/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ def parse_cli_args():
help="Enable torch profiler. Disabled by default",
action="store_true",
)
parser.add_argument(
"-tpo",
"--torch_profile_out_path",
type=str,
help="Path to the output file of torch profiling",
required=False,
default=None,
)
parser.add_argument(
"-tb",
"--tensorboard",
Expand Down
4 changes: 3 additions & 1 deletion scripts/performance/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,9 @@ def build_torch_profiler_plugin(args):
return PyTorchProfilerPlugin(
start_step=start_iter,
end_step=end_iter,
output_path=args.log_dir, # a subdir torch_profiles will be created here.
output_path=os.environ.get(
'TORCH_PROFILES_DIR', args.torch_profile_out_path
), # a subdir torch_profiles will be created here.
profiler_kwargs={
"with_stack": os.environ.get('TORCH_PROFILER_WITH_STACK', '0') == '1',
},
Expand Down