Skip to content

Commit 6166e79

Browse files
authored
Merge pull request SciSharp#1335 from martindevans/update_llama_cpp_ff4affb4c1aa7eb4f28a0d9de1b205bd719802f2
Update llama.cpp February 2026
2 parents 1e0234a + 8953a3f commit 6166e79

23 files changed

Lines changed: 176 additions & 118 deletions

LLama.Benchmark/Constants.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ public static string ModelDir
1414
public static string Generative7BModelPath => Path.Combine(ModelDir, "llama-2-7b-chat.Q3_K_S.gguf");
1515
public static string EmbeddingModelPath => Path.Combine(ModelDir, "all-MiniLM-L12-v2.Q8_0.gguf");
1616

17-
public static string LLavaModelPath => Path.Combine("llava-v1.6-mistral-7b.Q3_K_XS.gguf");
18-
public static string LLavaMmpPath => Path.Combine("mmproj-model-f16.gguf");
19-
public static string LLavaImage => "Assets/extreme-ironing-taxi-610x427.jpg";
20-
2117
public static string TextCompletionPromptsFilePath => "Assets/TextCompletionPrompts.txt";
2218
}
2319
}

LLama.Unittest/MtmdWeightsTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System;
2-
using System.IO;
31
using LLama.Common;
42
using LLama.Native;
5-
using Xunit;
63

74
namespace LLama.Unittest
85
{

LLama.Unittest/NativeAbiTests.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.Runtime.InteropServices;
42
using LLama.Native;
5-
using Xunit;
63

74
namespace LLama.Unittest
85
{
@@ -79,27 +76,6 @@ public void ContextParamsSizeMatchesNative()
7976
Assert.Equal(expectedSize, Marshal.SizeOf<LLamaContextParams>());
8077
}
8178

82-
[Fact]
83-
public void MtmdContextParamsSizeMatchesNative()
84-
{
85-
var pointerSize = IntPtr.Size;
86-
var fields = new List<(int size, int align)>
87-
{
88-
(sizeof(sbyte), 1), // use_gpu
89-
(sizeof(sbyte), 1), // print_timings
90-
(sizeof(int), 4), // n_threads
91-
(pointerSize, pointerSize), // image_marker
92-
(pointerSize, pointerSize), // media_marker
93-
(sizeof(int), 4), // flash_attn_type
94-
(sizeof(sbyte), 1), // warmup
95-
(sizeof(int), 4), // image_min_tokens
96-
(sizeof(int), 4), // image_max_tokens
97-
};
98-
99-
var expectedSize = ComputeSize(fields);
100-
Assert.Equal(expectedSize, Marshal.SizeOf<NativeApi.mtmd_context_params>());
101-
}
102-
10379
[Fact]
10480
public void ModelParamsBoolBlockMatchesNative()
10581
{

LLama.Web/Common/ModelOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public class ModelOptions
4141
/// <inheritdoc />
4242
public bool UseMemorymap { get; set; } = true;
4343

44+
/// <inheritdoc />
45+
public bool UseDirectIO { get; }
46+
4447
/// <inheritdoc />
4548
public bool UseMemoryLock { get; set; } = false;
4649

LLama/Abstractions/ILLamaExecutor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Threading;
33
using LLama.Native;
44

@@ -14,8 +14,8 @@ public interface ILLamaExecutor
1414
/// </summary>
1515
public LLamaContext Context { get; }
1616

17-
// LLava Section
18-
//
17+
// Multimodal Section
18+
1919
/// <summary>
2020
/// Identify if it's a multi-modal model and there is a image to process.
2121
/// </summary>

LLama/Abstractions/IModelParams.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public interface IModelParams
5454
/// </summary>
5555
bool UseMemorymap { get; }
5656

57+
/// <summary>
58+
/// Use direct io, takes precedence over use_mmap when supported
59+
/// </summary>
60+
bool UseDirectIO { get; }
61+
5762
/// <summary>
5863
/// Use mlock to keep model in memory (use_mlock)
5964
/// </summary>

LLama/Common/ModelParams.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public record ModelParams
3434
/// <inheritdoc />
3535
public bool UseMemorymap { get; set; } = true;
3636

37+
/// <inheritdoc />
38+
public bool UseDirectIO { get; set; }
39+
3740
/// <inheritdoc />
3841
public bool UseMemoryLock { get; set; }
3942

LLama/Extensions/IModelParamsExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static IDisposable ToLlamaModelParams(this IModelParams @params, out LLam
3838

3939
result.use_mlock = @params.UseMemoryLock;
4040
result.use_mmap = @params.UseMemorymap;
41+
result.use_direct_io = @params.UseDirectIO;
4142
result.vocab_only = @params.VocabOnly;
4243
result.check_tensors = @params.CheckTensors;
4344

LLama/LLamaExecutorBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public abstract class StatefulExecutorBase : ILLamaExecutor
6969
/// </summary>
7070
protected AntipromptProcessor AntipromptProcessor { get; }
7171

72-
// LLava Section
73-
//
72+
// Multimodal Section
73+
7474
/// <inheritdoc />
7575
public bool IsMultiModal
7676
{

LLama/LLamaSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</ItemGroup>
5858

5959
<PropertyGroup>
60-
<BinaryReleaseId>506bb6e01009058f355</BinaryReleaseId>
60+
<BinaryReleaseId>ff4affb4c1aa7eb4_v3</BinaryReleaseId>
6161
</PropertyGroup>
6262

6363
<PropertyGroup>

0 commit comments

Comments
 (0)