Skip to content

drm/asahi: enable compute preemption by default on M1 Max - #3779

Closed
DanteCpp wants to merge 1 commit into
aurora-silicon:mainfrom
DanteCpp:feat/m1-max-compute-preemption
Closed

DanteCpp wants to merge 1 commit into
aurora-silicon:mainfrom
DanteCpp:feat/m1-max-compute-preemption

Conversation

@DanteCpp

@DanteCpp DanteCpp commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

What: Let the firmware preempt compute work by default on M1 Max. On my 16-inch M1 Max, the desktop stays responsive during heavy Qwen3.8-Flash-Next prefills in DS4.

Tested: On J316c, median prefill was 2.2% lower and generation 1.4% lower with preemption enabled on the same DS4 kernel. I had btop open during part of testing, and desktop redraw activity was uncontrolled. The display driver logged one-second fence waits in 3 of 5 warm prefills with preemption off and 0 of 5 with it on. The saved prefill logits matched. The ARM64 driver at c8995b2c6ffa builds with the DS4 configuration and passes all 10,800 host policy checks. A/B numbers and configuration

Risk: Two-way door · M1 Max. An earlier Gemma MoE test on M1 Max measured 20% lower decode throughput with preemption enabled. The explicit aurora.compute_preempt=0 override still takes precedence. Original measurements

Not yet: Frame-presentation timings and a hardware boot of this exact PR head in automatic mode. The A/B used explicit overrides on 7.3.0-ds4-ARCH.

Implementation and checks

DS4 requests a low-priority Vulkan queue. The driver now preserves the requested firmware priority in automatic mode on the C variant of G13 and G14X. This selects M1 Max and M2 Max. The variant also distinguishes M1 Ultra, which shares the G13C core with M1 Max.

The host test covers compute, vertex and fragment queues, the four priorities, invalid priorities, explicit overrides and the Debug0 opt-in. The previous default and all four mutated policies fail the checks as expected. Upstream qualification discussion

DS4 requests a low-priority Vulkan compute queue so the compositor can
run during long Qwen prompt prefills. On M1 Max, automatic mode pins two
firmware priority fields regardless of the requested queue priority.

Use the C GPU variant on the legacy G13 and G14X paths to select the
M1 Max and M2 Max. The variant distinguishes the single-die M1 Max from
M1 Ultra even though both use the G13C core. Keep explicit overrides and
the Debug0 opt-in.

Signed-off-by: Dante Loi <[email protected]>
@DanteCpp

DanteCpp commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

I ran Qwen3.8-Flash-Next Q2 in DS4 on the same 32-core M1 Max (J316c) with GPU compute preemption off and on. Both boots used the same DS4 kernel and Mesa driver.

Metric Off On Change
Prompt prefill (tokens/s) 352.79 (352.44–353.09) 344.92 (344.79–345.05) -2.2%
Generation (tokens/s) 33.65 (33.61–33.66) 33.19 (32.90–33.20) -1.4%
Wayland sync p95 during prefill (ms) 0.06 0.09 +45.2%

Each column gives the median of five warm runs after one warm-up, with throughput ranges in parentheses. I used one boot per setting, an 8,192-token prompt, 1,024-token prefill chunks and 128 teacher-forced generation steps. The saved prefill logits matched across both arms. Wayland sync measures compositor event-loop response. Frame presentation and input-to-display latency require separate measurements.

Kernel 7.3.0-ds4-ARCH (build ID 52eb45b3fbc37e119797d524f0ba8eb50a2585eb), Mesa 19c3abf8d9f, DS4 099bf8b943bf, low-priority Vulkan compute queue, power 100%.

During the timed prefills, the kernel display driver waited one second for a GPU fence in 3 of 5 warm runs with preemption off and 0 of 5 with it on. That matches my experience of the desktop staying responsive. These measurements also show a small throughput cost in DS4.

I had btop open during part of testing. Desktop redraw activity was uncontrolled on these boots, so these deltas can include contention with the compositor. I’m repeating the comparison with a monitored static desktop.

@DanteCpp DanteCpp closed this Dec 1, 2026
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.

1 participant