#6485 [Engine] Add experimental gfx90a HIP build

open · @wujian47 · 0 comentarios · En GitHub

Setup & installAMD / HIPNVIDIA / CUDAModels & quantsSecurityLinux

Descripción

## Problem and result

Strata's existing HIP builds target RDNA Wave32 and gfx906 Wave64. This adds an opt-in Linux source build for AMD Instinct MI210 (gfx90a Wave64), including the main Flash-Next engine, the device utility, and parity targets. The gfx90a device summary uses the existing setup parser's architecture and VRAM field order, and the self-test checks the GPU fill pattern and a small transfer round trip.

## Related discussion

The opt-in gfx90a proposal and request for community hardware validation are tracked in [#5704](https://github.com/Niko1221/Strata/issues/5704).

This draft continues the work from [#6482](https://github.com/Niko1221/Strata/pull/6482), which was closed by its author.

## Approach

Reuse the Wave64 HIP compatibility layer with a separate gfx90a selector and device check. Use the portable AVX2 CPU baseline in the gfx90a presets and compile the existing GDN and QSA coverage alongside the gfx90a parity targets. The gfx90a CI job builds and inspects the HIP targets without a GPU.

## Validation

Tested commit `8345ef427e232dd89343169f2a78352a0f6aba84` over `3142b66b96e9c0e775e30f620b11b191a1427c2a` on Linux x86-64 with ROCm 7.2.4 and AMD Clang 22. The build SDK came from AMD's `7.2.4-complete` image. The host had no `/dev/kfd`. The pin, configure arguments, and results are recorded in the [patch repository validation record](https://github.com/wujian47/strata-gfx90a/blob/255163519413a29ca7a4f372d71e5112e490adef/VALIDATION.md).

**Passed**

- From `engine/`, `cmake --preset hip-gfx90a-tests` with the ROCm compiler and prefix arguments in the record, then `cmake --build --preset hip-gfx90a-tests --parallel 2`. The engine, device tool, host test, and nine GPU parity executables linked. All eleven HIP ELFs resolved `libamdhip64` and contained gfx90a code objects.
- `python3 ../tools/test_gfx90a_build_files.py --compile-commands build/hip-gfx90a-tests/compile_commands.json` checked 68 HIP source commands. The 15 GGML CPU compile commands used AVX2 and omitted `-march=native`. Configuration rejection checks and the existing gfx906 build-file checks passed.
- `cmake --build build/hip-gfx90a-tests --target quant_selftest type_geometry_oracle quant_parity` and `ctest --test-dir build/hip-gfx90a-tests -R '^(hip_device_policy_test|quant_selftest|type_geometry_oracle|quant_parity)$' --output-on-failure`. All four host tests passed. The AMD setup suite passed 53 tests with `python3 terminal/tools/test_setup_amd.py` from the repo root.
- A host-side HIP stub supplied a gfx90a device record and injected fill and transfer mismatches. The existing setup parser read gfx90a and 64 GiB from the revised CLI. The normal fixture passed and each injected mismatch returned exit 1. This exercised host control flow and diagnostics.
- The gfx906 and gfx1100 `strata-device` regression targets compiled and linked.

**Failed**

- The pre-fix host regression on `ff1574b` reproduced the unknown architecture and zero GiB parse, and the self-test accepted both injected data mismatches. The revised CLI passed these checks.

**Not run**

- Physical MI210 self-test, GPU numerical parity, model inference, long-context concurrency, and throughput measurements.
- Full CUDA, RDNA, gfx906, SYCL, and Metal engine regression builds.

## Limits

Experimental, single selected GPU per process. The MFMA test checks instruction parity on hardware when run. Production MFMA dispatch and model performance remain separate validation work.

En el sitio

Enlaces a install, modelos, releases.