ggml-org/llama.cpp

llama : integer type consistency in `llama.h`

Offen

#4.574 geöffnet am 21.12.2023

 (4 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)C++ (21.825 Forks)batch import
enhancementgood first issuerefactoringroadmap

Repository-Metriken

Stars
 (124.401 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T 8h) (389 gemergte PRs in 30 T)

Beschreibung

Feature Description

llama.h should prefer to use sized (always) + signed (mostly) integers.

Motivation

The integer types in llama.h right now are.

Count Type
33 int
10 int32_t
24 uint32_t
2 int64_t
2 uint64_t

In #4540 there was a discussion around preferences for integer types on new methods.

Avoiding int makes cross platform code simpler at essentially no cost. Signed makes arithmetic simpler at the cost of some bits if you need something large.

Possible Implementation

  1. Change all int's to int32_t
  2. As code changes try to prefer signed integers.

We could also do some higher-impact things, but I'd take the lower-impact slower changes over a large find-and-replace.

Contributor Guide