Lightning-AI / Lightning-AI/pytorch-lightning

Total time in Simpleprofiler does not add up to the function run-times

Open
#15,334 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

profiler question won't fix
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

Bug description

Used the SimpleProfiler while training a model with DDP, and found that the constituent times of the functions did not add up to the total. Is this a bug?

Alternatively, do these calls each represent one GPU's worth of profiling? Like, should I multiply each of the function calls by my number of GPU's (4 in this case) to get a better estimate?

Alternatively alternatively, should I view the bulk of the 'total time' as the 'cost' of the DDP spin-up? If so, should this be documented somewhere?

Screen Shot 2022-10-26 at 11 49 35 AM

cc @carmocca @kaushikb11 @ninginthecloud @rohitgr7 @nbcsm @guotuofeng

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by reproducing the report with SimpleProfiler during DDP training, comparing total and constituent function times across the four GPUs. Done means determining whether the discrepancy is a profiling bug, expected DDP behavior, or missing documentation, then identifying the relevant project entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.