Closed Bug 2091474 Opened 16 days ago Closed 7 days ago

Run Windows PGO profile generation on GPU workers

Categories

(Testing :: Performance, task, P3)

task

Tracking

(firefox163 fixed)

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: kshampur, Assigned: jmoss)

References

(Blocks 1 open bug, Regressed 3 open bugs)

Details

(Keywords: perf-alert, Whiteboard: [fxp][vision][operational][todo][est-1w])

Attachments

(1 external file)

our Windows generate-profile tasks run on VMs without a GPU (b-win2022), so PGO training ends up on software WebRender (SWGL) and WebGL/accelerated canvas get disabled. That means the hardware rendering paths most users actually hit (ANGLE/D3D11, DirectComposition, GPU canvas) basically don't get trained at all. (fwiw Android runs in an emulator with only GLES 2.0 so it's on software WebRender too, and really only macOS trains on a real GPU right now.)

A while back I ran Windows generate-profile on a GPU VM and saw a large MotionMark improvement and small SP3 improvements. RELOPS-2605 is for getting proper GPU builders, and this bug is the Bugzilla side for switching the tasks over once that's ready.

PGO profile counters for generate-profile-win64-shippable (rough magnitudes from merged.profdata):

Code VM no GPU (b-win2022) GPU VM (win11-64-25h2-gpu) Hardware (win11-64-24h2-hw)
Software WebRender (SWGL) 250.7M 0 0
RenderCompositorANGLE 0 57K 95K
ANGLE D3D11 (rx::Renderer11 / Context11) not in profile 865K / 1.14M 1.08M / 1.19M
WebGL (WebGLContext) ~0 10.4M 10.4M
Accelerated canvas (CanvasTranslator) ~0 1.52M 1.50M
DirectComposition (DCLayerTree) ~0 13K 21K
Overlap of functions executed vs hardware 90.5% 97.6%

so the GPU VM gets us most of the way to real hardware (the hardware run additionally hits some Media Foundation hw encode paths and slightly more compositor work).

Try runs:

Things to note:

  • the gecko-t GPU pools are fine for try experiments but shipping needs a level 3 builder pool with chain of trust (that's the RELOPS-2605 part). Once that exists the change here should mostly be swapping worker-type for the Windows tasks in taskcluster/kinds/generate-profile/kind.yml (win64 and nightlyasrelease too)
  • talking with :jnicol as well, WARP (Windows' software Direct3D) might be an alternative if the GPU pool takes a while, since it could get training onto the ANGLE/D3D11 paths without a GPU.

Linux

similarly I also tried checking the GPU situation on Linux PGO.

I ran generate-profile-linux64-shippable directly on the moonshots (t-linux-talos-2404, Intel Iris Pro P580, Mesa iris) with xvfb on and off. tl;dr it doesn't really change anything, so I think we keep Linux on the current VMs with xvfb.

:jnicol's explanation matches the data: on Linux under xvfb we still use hardware WebRender + WebGL, just on top of a software OpenGL implementation (presumably llvmpipe), so training executes fairly similarly to having a GPU (albeit some timings may be off). On Windows the missing GPU switches us to entirely different code paths.

Here are some findings from the profdata

Code Linux xvfb Linux real GPU (iris)
WebGL (WebGLContext) 9.35M 9.35M
Accelerated canvas (DrawTargetWebgl) 2.42M 2.42M
Software WebRender (SWGL) 0 0
Hardware WebRender compositor (EGL) 129K 142K
Overlap of functions executed 99.3%
  • gfxtest on the real display reported iris, and a system perf profile of the no xvfb run confirms Firefox was rendering through iris + i915 (I didn't log the renderer after xvfb started, so llvmpipe there is an assumption)
  • the biggest difference is DMABuf surface sharing (DMABufSurface 37 vs 10329, SharedSurface_DMABUF 0 vs 1360), plus a few hundred small WebRender/font/image functions (468 only hit with the real GPU, 272 only with xvfb)
  • rendering (renderer/compositor threads + Mesa/i915) is only ~3% of sampled CPU time in the training run, ~70% is content processes

Perf compare of a Linux build trained on the real GPU vs baseline (linux2404-64-shippable): https://perf.compare/compare-results?baseRev=8d32ccf644c2000ec06e3e3b31550383e5814c60&baseRepo=try&newRev=b31998fb120a9f2e9734710ccd2b0d71a76012ec&newRepo=try&initialized=1&framework=13&framework=15&framework=1

Area Delta Significant?
speedometer3 -0.1% marked confident, but tiny
motionmark 1.3 / htmlsuite -1.6% / +1.3% no
nav-bench overall +0.7% no
nav-bench google-nav-load -4.5% (faster) yes, only confident nav-bench site
talos webgl / bcv / svgr -1.2% to +2.1% no
offscreencanvas_webcodecs worker_webgl_h264 +6.8% regression yes (probably needs retriggers), other 9 webcodecs results flat
youtube-playback big swings no, dropped frame counts near zero so very noisy

i think this is mostly noise, the webcodecs might need a closer look

Linux try runs:

note: all the counters here are summed first block counters per group, so treat them as rough magnitudes

jmoss latest comment in Jira suggests we'll have the windows servers up soon, then we will need do a larger perfcompare to see perf impact

Blocks: perf-ci
See Also: → 2090025

just adding another data point (bug 2074305) where we saw an (expected) regression moving the mac PGO jobs to the tart VMs (tart VMs, from my limited knowledge, uses virtualized graphics through Apple's framework, not native GPU access)

See Also: → 2074305

AI disclaimer: Analyzed and drafted by claude-code-5.5 and reviewed by me.

I tried the WARP route from comment 0, without a GPU pool: a patch that makes profileserver.py set layers.d3d11.force-warp and spoof the Microsoft Basic Render Driver as the adapter (MOZ_GFX_SPOOF_VENDOR_ID=0x1414, DEVICE_ID=0x008c), opt-in via MOZ_PGO_FORCE_WARP=1 in the three b-win2022 generate-profile tasks.

Why the b-win2022 runs end up on SWGL: the worker’s display adapter is not on the vendor allowlist, so FEATURE_DIRECT3D_11_LAYERS is blocklisted, no D3D11 device is created (DeviceManagerDx::CreateCompositorDevice has zero counts in the Dh1lLBqzQyuMzOXlrsSBdQ profile), and everything below that falls back. WARP alone is not enough; the spoofed vendor is what gets D3D11 compositing past the blocklist.

Test setup: Windows Server 2022 VM (QEMU, no GPU, Microsoft Basic Display Adapter with vendor 0x1234), the instrumented build and pgo-extended-corpus from your no-GPU try push, the patched profileserver.py, run in the logged-in console session. The VM baseline reproduces the b-win2022 profile (identical counters in the gfx init functions, same groups below).

Summed entry counts per group (same grouping gives your numbers for the GPU VM):

Code b-win2022 (CI) VM, no WARP VM, WARP GPU VM (CI)
Software WebRender (SWGL) 16,654,010 17,279,993 540 749
RenderCompositorANGLE 0 0 60,485 56,706
ANGLE Renderer11 0 0 735,835 864,581
ANGLE Context11 0 0 940,630 1,144,051
WebGLContext 0 0 5,994,533 7,499,492
CanvasTranslator 2 2 1,188,839 1,506,091
DrawTargetWebgl 100 80 5,171,990 6,469,610
DCLayerTree (DComp) 2 2 24,785 23,299
GPU VM functions also run 93.2% 93.6% 99.2%

The functions still missing against the GPU VM are mostly not graphics (Hunspell, Windows 11 scrollbar drawing, DirectWrite palettes: Windows 11 vs Server 2022 image differences), plus video: WARP has no video device, so DComp video overlays are disabled (WebRender error 5) and the hardware decode paths stay untrained, as on b-win2022 today. The training run took 640 s instead of 544 s.

For bug 2074305 the measurable loss was MotionMark 1.3 Canvas Lines (-23 %, score -3.4 %) with Speedometer 3 unchanged, so Canvas Lines is the test to watch in a PerfCompare of a WARP-trained build. I have not pushed this to try yet. Please tell me, if I should.

Depends on: 2078960

Add the b-win2025-gpu worker alias and move the win32, win64 and win64
nightly-as-release generate-profile tasks to it, so PGO training uses
hardware rendering paths instead of software WebRender.

WIP: needs a try push on the GPU pools, a PerfCompare against the current
profile, and level-3 chain-of-trust acceptance before review.

Assignee: nobody → jmoss
Attachment #9685391 - Attachment description: WIP: Bug 2091474 - WIP: Run Windows PGO profile generation on GPU workers → Bug 2091474 - Run Windows PGO profile generation on GPU workers r?#taskgraph-reviewers
Status: NEW → ASSIGNED
Pushed by jmoss@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/355e12da61ef https://hg.mozilla.org/integration/autoland/rev/cdaeaf7ec070 Run Windows PGO profile generation on GPU workers r=taskgraph-reviewers,kshampur,bhearsum
Status: ASSIGNED → RESOLVED
Closed: 7 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
Regressions: 2097524
Regressions: 2097574
Regressions: 2098007
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: