-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AutoParallel] add pipeline.auto_parallel_profiler to auto_config #7343
[AutoParallel] add pipeline.auto_parallel_profiler to auto_config #7343
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #7343 +/- ##
===========================================
- Coverage 57.59% 57.58% -0.02%
===========================================
Files 582 582
Lines 86912 86929 +17
===========================================
+ Hits 50061 50062 +1
- Misses 36851 36867 +16 ☔ View full report in Codecov by Sentry. |
3eedda1
to
e6be2cd
Compare
e6be2cd
to
0d7e0f2
Compare
…nto auto_parallel_profiler
…nto auto_parallel_profiler
…b.com/From00/PaddleNLP into auto_parallel_profiler
llm/llama/run_pretrain_auto.py
Outdated
if (step == job_schedule_profiler_start) and training_args.use_auto_parallel: | ||
engine.enable_job_schedule_profiler = True | ||
|
||
if (step == job_schedule_profiler_end) and training_args.use_auto_parallel: | ||
engine.enable_job_schedule_profiler = False | ||
sys.exit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可否写成guard的形式,类似nvprof_guard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我有考虑过实现成 nvprof_guard 的方式,但是 nvprof_guard 的实现里面是直接调用的 c++ api,因为它只需要做push和pop即可,但是我们需要在开启的step之后通过改变传入参数的方式去启动 profiler,感觉 nvprof 的方式就不太适用了
paddlenlp/trainer/training_args.py
Outdated
@@ -325,6 +325,10 @@ class TrainingArguments: | |||
Whether skip profile timer, timer will record time usage of forward/ backward/ step, etc. | |||
distributed_dataloader (`bool`, *optional*): | |||
Whether to use distributed dataloader. Default is `False`. | |||
job_schedule_profiler_start (`int`, *optional*): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命令行参数可以复用pipeline_parallel_config
吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命令行参数可以复用
pipeline_parallel_config
吗?
好像不行,pipeline_parallel_config 里面只能放布尔值
…nto auto_parallel_profiler
@@ -27,6 +27,7 @@ | |||
import paddle | |||
import paddle.distributed as dist | |||
import paddle.distributed.auto_parallel as auto | |||
from paddle.utils.profiler import job_schedule_profiler_range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from paddle.profiler.utils import job_schedule_profiler_range
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Description
在 PR PaddlePaddle/Paddle#58313 中为Paddle添加了可视化静态图模式下流水并行时序图的功能,本 PR 将 pipeline.auto_parallel_profiler 添加上 auto_config 中使得用户可以通过命令行参数启动该功能;
GPT-3 测试用例
运行示例:
其中
Distributed.pipeline.auto_parallel_profiler=1
为开启语句。后续使用解析脚本生成json文件:
在 https://ui.d.dev/ 中打开 pipeline_profile_perfetto.json 效果如下:
Llama2 测试用例
可视化结果:
依赖 pr: