Skip to content

RDNA 3 on Linux: Model M 0.5 ms faster with a create-time FP16 weight copy, needs two extra translator opcodes #303

Backlog

Description

@j0nsh1n
What Frame time
Before 7.306 ms
After 6.789 ms

I have a developer-only Model M speed-up for RDNA 3 on Linux and can open it as a PR.
On an RX 7900 XT with RADV, at 1440p Quality (1706x960 -> 2560x1440), nine interleaved rounds gave a median per-round delta of -0.513 ms and were faster in 9/9 rounds. The profiled block kernel went from 1.447 to 0.742 ms. A no-card compiler check reduced instructions by 28.1% and spills from 74 to 14. Output stayed byte-identical to the Model M reference: 279/279 files at three sizes.

The change packs an FP16 copy of the FP8 weights at creation time. The block kernel loads matrix operands directly instead of staging and widening the FP8 weights in every wave. Values and accumulation order are unchanged.

It depends on a separate dxil-spirv translator patch, about 36 lines in dxil_ags.cpp, which can be shared on request. The patch adds two mixed FP16/FP8 AGS WMMA opcodes, 0x7d and 0x7c, behind the existing wmma_rdna3_raw_fp8 option. It applies on top of the patched dxil-spirv already needed by the RDNA 3 route: upstream PR #362 raw fragments plus local patches. That combination is not in any Proton release. Without the translator patch, the new kernel's PSO fails.

The WrongGPU side is off by default and requires WG_DEV_GFX11_M1=enc1 with WG_DEV_GFX11_NATIVE_K. With it off, every existing kernel's DXIL is byte-identical.

Not tested: Windows, real model weights, or RDNA 3 boards other than Navi 31 / RX 7900 XT. These opcodes are not AMD's, so Windows drivers would not recognize them.

How would you like this handled?

  1. Would you take the WrongGPU kernel, packer, and runtime gate as a developer-only PR while the translator patch stays with our Linux vkd3d-proton/dxil-spirv build, or should it wait until a translator route is upstream?
  2. Are you comfortable with WrongGPU defining the two non-AMD AGS opcode numbers 0x7d and 0x7c, beyond AMD's list like the existing 0x7e, or would you prefer another mechanism?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions