Skip to content
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

[GPT][PROFILER] gpt support flops profiler #1003

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion examples/transformer/models/GPT/docs/hybrid_profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ cd PaddleFleetX/examples/transformer/models/GPT # 如果已在此目录下,则
```
python -m paddle.distributed.launch \
./pretrain/run.py -c \
./pretrain/configs/pretrain_gpt_1.3B_dp8.yaml -o Profiler.enable=True
./pretrain/configs/pretrain_gpt_1.3B_dp8.yaml -o Profiler.enable=True -o Global.max_steps=6

```

Expand Down
4 changes: 3 additions & 1 deletion examples/transformer/utils/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def build_profiler(profiler_config):
profiler_log = profiler_config.get('profiler_log', './profiler_log')
record_shapes = profiler_config.get('record_shapes', True)
profile_memory = profiler_config.get('profile_memory', True)
with_flops = profiler_config.get('with_flops', True)
profiler = paddle.profiler.Profiler(
targets=[
paddle.profiler.ProfilerTarget.CPU,
Expand All @@ -159,7 +160,8 @@ def build_profiler(profiler_config):
scheduler=scheduler,
on_trace_ready=paddle.profiler.export_chrome_tracing(profiler_log),
record_shapes=record_shapes,
profile_memory=profile_memory)
profile_memory=profile_memory,
with_flops=with_flops)
profiler.start()
logger.warning("Profiler is enabled, do not enable it in production.")

Expand Down