Skip to content

Increase llama.cpp performance - strategies for AMD Ryzen AI Max 395+ #5

Description

@geerlingguy

I've gotten most things working on the Ryzen iGPU, and it's fast enough... but there are a few things that can make it go faster / harder (many mentioned in this Reddit thread on the Ryzen AI Max 395+ for LLM inference):

  • NPU Support: Utilizing the 50 TOPS NPU at all
  • ROCm:
    • Getting ROCm working with llama.cpp (might need rocmwmma, and a recent patch that allows llama.cpp to be built with -DGGML_HIP_ROCWMMA_FATTN=1 (for flash attention)
    • All that's needed is installing the latest version of ROCm in Fedora Rawhide, and compiling llama.cpp with -DGGML_HIP=ON DAMDGPU_TARGETS="gfx1151" in addition to RPC if needed.
    • See Test ROCm with llama.cpp on Fedora Rawhide #7
  • VRAM Allocation:
  • llama.cpp tweaks:
    • Using --no-mmap and --no-warmup on RPC runs since that can add to the model loading time substantially (and mmap in particular can cause errors when the model filesize is too large to fit in one system's RAM.

Vulkan is already giving good results, but I believe efficiency on this APU can be increased substantially with some tweaks. Especially in a clustered configuration (which I'm investigating with llama.cpp RPC in #2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions