Skip to content

Feature: A unified configure (and build) process for llama.cpp #5890

Closed as not planned
@cebtenzzre

Description

@cebtenzzre

An Example, For Context

The best solution for the issue fixed in #5889 is to conditionally define a _mm256_set_m128i fallback. This would prevent the mistake of using _mm256_set_m128i instead of MM256_SET_M128I, breaking the gcc 7 build.

Of course, _mm256_set_m128i is not a macro, so we can't directly test for it in the preprocessor. We can use a compiler version check, but this is a maintenance burden, because every supported compiler (at least gcc, clang, icc, and msvc) should be handled in each of these cases.

The elegant solution is a configure-time check that will set e.g. #define HAVE_MM256_SET_M128I 1 in our config.h, so that the fallback will be defined when HAVE_MM256_SET_M128I is not defined. Wait... what configure time? What config.h?

The Solution?

Adding these kinds of steps to the build is very high friction right now because they have to be written in three separate languages - CMake, the Makefile, and build.zig.

My question is simple - does it have to be this way? Is there a future in which llama.cpp can standardize on CMake or Meson as its sole build system, with a straightforward way to add conftests in a single location? I would be happy to contribute the necessary changes if we decide this is feasible. (Zig is not a limitation is far as I know - you can use zig cc as a toolchain with CMake or Meson. We obviously cannot standardize on the Makefile without losing support for native MSVC builds on Windows.)

Otherwise, it seems like we will always have to hack around the lack of a robust configure step and ignore the problem.

tl;dr I want to make a PR that removes the Makefile. Change my mind.

cc @ggerganov @slaren @LostRuins

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions