Skip to content

AMD Zen5 Architecture Support #8592

@changhoon-sung

Description

@changhoon-sung

Context

Currently, Halide does not support the AMD Zen5 architecture, and the fallback mechanism is not functioning correctly. The fallback categorizes the Zen5 as Intel Sapphire Rapids. While these two architectures share many features, there are notable differences. Specifically, Zen5 does not support Intel AMX (Advanced Matrix Extensions) or AVX512-FP16.

When Zen4 was added (#7840), the subset/superset relationship was clear, allowing for a straightforward appending of features. In the case of Zen5, it can be simply treated as a superset of Zen4 and a subset of Sapphire Rapids with AMX and AVX512-FP16 removed. However, Zen5 also includes features that Sapphire Rapids does not have (AVX512VP2INTERSECT, PREFETCHI, etc.), and similar cases are likely to arise in the future. Therefore, it would be beneficial to make some preliminary improvements while adding support for Zen5.

Test Failure

Halide preliminarily supports AMX, and I observed that the test case correctness_tiled_matmul fails on an AMD Ryzen 9950X processor.

root@ef90f76caebd:/opt/halide/bin# ./get_host_target
x86-64-linux-avx-avx2-avx512-avx512_cannonlake-avx512_sapphirerapids-avx512_skylake-f16c-fma-sse41

root@ef90f76caebd:~/Halide/build/test/correctness# ./correctness_tiled_matmul
Running AMX matmul (signed/signed)
Illegal instruction (core dumped)

If no one is currently working on this and it’s not an urgent matter, would it be okay for me to contribute? Also, if you have any specific improvement directions in mind, please let me know.

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