Skip to content

Conversation

@BodhiHu
Copy link
Contributor

@BodhiHu BodhiHu commented Dec 11, 2024

Hi, this PR will:

  1. fix building for MUSA when targeting aarch64;

@github-actions github-actions bot added documentation Improvements or additions to documentation build Compilation issues Nvidia GPU Issues specific to Nvidia GPUs ggml changes relating to the ggml tensor library for machine learning labels Dec 11, 2024
@BodhiHu
Copy link
Contributor Author

BodhiHu commented Dec 11, 2024

HI @ggerganov , could you please help review this PR ?

@ggerganov
Copy link
Member

What errors do you get before this PR?

@BodhiHu
Copy link
Contributor Author

BodhiHu commented Dec 12, 2024

Hi,

I got these errors(with the full compile command printed):

image

image

To fix this, had to undefine __ARM_NEON on the cuda code when GGML_USE_MUSA is on:

#ifdef GGML_USE_MUSA
#undef __ARM_NEON
#endif

@slaren
Copy link
Member

slaren commented Dec 12, 2024

The -march etc flags should not be used to build the musa backend. I would try fixing that first.

if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
message(STATUS "Linux aarch64 detected")

set(MARCH_FLAGS "-march=armv8.2-a+fp16")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes 2 things:

  1. Every aarch64 CPU supports fp16. I think the code should look for fphp CPU feature.
  2. aarch64 will be at least armv8.2, in fact aarch64 implies only armv8

@BodhiHu
Copy link
Contributor Author

BodhiHu commented Dec 16, 2024

Hi @slaren , @kkontny , I had removed the CPU parts and -march on musa side, to just fix the compiler errors.
Not sure if it's a proper fix, or we should wait for musa arm sdk to support NEON :D

@BodhiHu BodhiHu closed this Dec 23, 2024
@BodhiHu
Copy link
Contributor Author

BodhiHu commented Dec 23, 2024

closed - as I think musa sdk should support arm neon.

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

Labels

build Compilation issues documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning Nvidia GPU Issues specific to Nvidia GPUs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants