Skip to content

Update c0c7e147e7efa6c5858754b47259ba4880f8a906#1392

Open
martindevans wants to merge 4 commits into
SciSharp:masterfrom
martindevans:update_c0c7e147e7efa6c5858754b47259ba4880f8a906
Open

Update c0c7e147e7efa6c5858754b47259ba4880f8a906#1392
martindevans wants to merge 4 commits into
SciSharp:masterfrom
martindevans:update_c0c7e147e7efa6c5858754b47259ba4880f8a906

Conversation

@martindevans
Copy link
Copy Markdown
Member

@martindevans martindevans commented May 24, 2026

Updated to llama.cpp c0c7e147e7efa6c5858754b47259ba4880f8a906.

Testing:

  • Windows CUDA
  • Windows Vulkan
  • Linux CUDA
  • Linux Vulkan

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates LLamaSharp’s native interop layer to match llama.cpp commit c0c7e147e7efa6c5858754b47259ba4880f8a906, including new context parameters and updated MTMD interop signatures.

Changes:

  • Added support for new llama_context_params fields (n_rs_seq rollback snapshots and context_type / MTP support) and surfaced them through IContextParams and conversions.
  • Updated MTMD decoder position ABI (adds z component and introduces pos_0 argument in relevant P/Invokes).
  • Removed the llama_params_fit P/Invoke (and its status enum) and updated binary release ID to the new upstream snapshot.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
LLama/Native/SafeLLamaContextHandle.cs Exposes llama_n_rs_seq via a new managed property; adds minor ReSharper suppressions.
LLama/Native/NativeApi.Mtmd.cs Updates MTMD ABI: mtmd_decoder_pos gains z; decoder-pos APIs now take pos_0.
LLama/Native/NativeApi.cs Removes llama_params_fit P/Invoke.
LLama/Native/LLamaParamsFitStatus.cs Deletes the managed enum used by the removed llama_params_fit API.
LLama/Native/LLamaModelParams.cs Formatting/alignment changes in model param bool fields block (ABI-related structure).
LLama/Native/LLamaContextType.cs Introduces managed enum for llama_context_type (Default/Mtp).
LLama/Native/LLamaContextParams.cs Adds n_rs_seq and context_type to managed llama_context_params struct.
LLama/LLamaSharp.csproj Updates BinaryReleaseId for native runtime download.
LLama/Extensions/IContextParamsExtensions.cs Plumbs ContextType and RecurrentRollbackSnapshots into native LLamaContextParams.
LLama/Common/ModelParams.cs Adds ContextType; introduces RecurrentRollbackSnapshots property (currently non-configurable).
LLama/Abstractions/IContextParams.cs Adds new required interface members (ContextType, RecurrentRollbackSnapshots).
LLama.Web/Common/ModelOptions.cs Implements new interface members (ContextType currently hard-coded to Default).
LLama.Unittest/NativeAbiTests.cs Updates ABI size expectations for new context params fields; adjusts offset checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread LLama/Common/ModelParams.cs Outdated
Comment thread LLama.Web/Common/ModelOptions.cs
Comment thread LLama/Native/LLamaContextType.cs
Comment thread LLama.Unittest/NativeAbiTests.cs
Comment thread LLama/Abstractions/IContextParams.cs
Comment thread LLama/Native/NativeApi.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@m0nsky
Copy link
Copy Markdown
Contributor

m0nsky commented May 25, 2026

My tests are running fine on:

  • Windows CUDA
  • Windows Vulkan
  • Linux CUDA
  • Linux Vulkan

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants