Profiling args are missing on the main brench
Describe the bug
A clear and concise description of what the bug is. Tag the @mcore-oncall to get oncall's attention to this issue.
- the development branch has useful tooling like
--profilethat is missing on the main branch. Is this a purposeful exclusion? Or an oversight. This makes it difficult to run profiling on stable commits on the main branch.
Steps/Code to reproduce bug
Please list minimal steps or code snippet for us to be able to reproduce the bug.
A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.
--profile is not included on the main branch
Expected behavior
A clear and concise description of what you expected to happen.
--profile and related args included on the main branch. Alternatively, if this is useful it would be great to annotate these args as dev only somewhere in the doc string in the arguments.py or the dataclass refactor for the config system.
Additional context
Add any other context about the problem here.
Have you tried running pretrain_gpt.py --help ? I think the arguments will still be usable, they are just automatically generated now, instead of explicitly defined.
See this PR
This looks stale on current main — the --profile flag and the rest
of the profiling args are present, just no longer registered via a
literal add_argument('--profile', ...) call, which is presumably why
a direct search for that string doesn't find them.
They're now generated from a dataclass:
megatron/training/config/common_config.pydefinesProfilingConfig, whoseuse_nsys_profilerfield carriesmetadata={"argparse_meta": {"arg_names": ["--profile"], "dest": "profile"}}, alongsideprofile_step_start,profile_step_end,use_pytorch_profiler,profile_ranks,nvtx_ranges, etc.megatron/training/arguments.py::_add_training_args()wires this in for real:ArgumentGroupFactory(ProfilingConfig).build_group(parser, "profiling").megatron/training/training.pyreadsargs.profile,args.profile_step_start/end,args.profile_ranks,args.use_pytorch_profiler, andargs.nvtx_rangesthroughout the training loop (e.g. around the profiler-start/stop logic).
So --profile and friends are live on main today via the
dataclass-driven argparse system rather than the classic direct
add_argument() calls. Given that, this can probably be closed unless
there's a specific flag from dev that's still missing — happy to be
pointed at one if so.