Skip to content

Enable GPU memory trace dump#276

Merged
fujunwei merged 1 commit into
webmachinelearning:mainfrom
bbernhar:gpgmm_trace
Jun 20, 2022
Merged

Enable GPU memory trace dump#276
fujunwei merged 1 commit into
webmachinelearning:mainfrom
bbernhar:gpgmm_trace

Conversation

@bbernhar
Copy link
Copy Markdown
Contributor

How to collect:

  1. Add webnn_enable_resource_dump = true to args.gn.
  2. Run any executable (chrome.exe, end2end, etc).
  3. Open gpgmm_event_trace.json in chrome://tracing.

How to analyze:

You basically want GPU allocation utilization to be always 100% and GPU memory utilization to be always under 100%. The former means NO allocation is being wasted and the latter means NO memory is being paged-out to the OS. GPU memory free reports waste due to fragmentation, this should be small.

How does it work:
GPGMM tracks how much actual resource memory was used. For example, if you create 1GB heap, that contains a 1 byte resource, this will correctly reported as 1B used. OS tools like WPA just report 1GB being used, not very helpful.

@fujunwei @mingmingtasd

Adds `webnn_enable_resource_dump = true` to create a trace dump. Then open the dump in chrome://tracing to analyze GPU memory usage.
Copy link
Copy Markdown
Collaborator

@fujunwei fujunwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merge it.

@fujunwei fujunwei merged commit b030a61 into webmachinelearning:main Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants