Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccessViolationException #654

Open
Rabergsel opened this issue Apr 6, 2024 · 14 comments
Open

AccessViolationException #654

Rabergsel opened this issue Apr 6, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@Rabergsel
Copy link

Rabergsel commented Apr 6, 2024

I only copied the code from the ReadMe, I installed the LLama NuGet package with the CPU-Only backend, and it always returns

System.AccessViolationException: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

on reading the weights with LLamaWeights.LoadFromFile();

EDIT:
Additional information: Windows 10, .NET 8

@martindevans
Copy link
Collaborator

What model file are you trying to use?

@Rabergsel
Copy link
Author

Rabergsel commented Apr 6, 2024

Open LLama 3b
https://huggingface.co/SlyEcho/open_llama_3b_ggml
(I converted it to gguf)

@martindevans
Copy link
Collaborator

Depending on the exact version of llama.cpp you used to covnert it, you may be using a slightly incompatible file format. LLamaSharp is always a bit behind mainline llama.cpp.

Just to confirm everything else is working I'd suggest trying one of the models linked in the readme (e.g. Phi2).

@martindevans
Copy link
Collaborator

Did trying another model work?

@hswlab
Copy link
Contributor

hswlab commented May 5, 2024

I suspect the backend binaries do not match the version of the llamasharp library used. I just had the same error message. Version 0.11.02 finally worked together with the binaries you can download here.

https://github.com/SciSharp/LLamaSharp/actions/runs/8118890586

@AsakusaRinne
Copy link
Collaborator

@hswlab If I'm not misunderstanding it, you got an error when using LLamaSharp v0.11.2 and corresponding backend package, but everything goes well with LLamaSharp v0.11.2 and the downloaded binaries? Could you please post your log of native library loading here? To enable the full logs, please add the following code to the very beginning of your code.

var showLLamaCppLogs = true;
NativeLibraryConfig
   .Instance
   .WithLogCallback((level, message) =>
    {
        if (showLLamaCppLogs)
            Console.WriteLine($"[llama {level}]: {message.TrimEnd('\n')}");
    });

@daxnet
Copy link

daxnet commented May 6, 2024

I have the same issue on my first start program. Code below:

using LLama.Common;
using LLama;
using LLama.Native;


var showLLamaCppLogs = true;
NativeLibraryConfig
    .Instance
    .WithLogCallback((level, message) =>
    {
        if (showLLamaCppLogs)
            Console.WriteLine($"[llama {level}]: {message.TrimEnd('\n')}");
    });


string modelPath = @"C:\Users\1004975\Downloads\Phi-3-mini-4k-instruct-q4.gguf"; // change it to your own model path.

var parameters = new ModelParams(modelPath)
{
    ContextSize = 1024, // The longest length of chat as memory.
    GpuLayerCount = 1 // How many layers to offload to GPU. Please adjust it according to your GPU memory.
};
using var model = LLamaWeights.LoadFromFile(parameters);
using var context = model.CreateContext(parameters);
var executor = new InteractiveExecutor(context);

// Add chat histories as prompt to tell AI how to act.
var chatHistory = new ChatHistory();
chatHistory.AddMessage(AuthorRole.System, "Transcript of a dialog, where the User interacts with an Assistant named Bob. Bob is helpful, kind, honest, good at writing, and never fails to answer the User's requests immediately and with precision.");
chatHistory.AddMessage(AuthorRole.User, "Hello, Bob.");
chatHistory.AddMessage(AuthorRole.Assistant, "Hello. How may I help you today?");

ChatSession session = new(executor, chatHistory);

InferenceParams inferenceParams = new InferenceParams()
{
    MaxTokens = 256, // No more than 256 tokens should appear in answer. Remove it if antiprompt is enough for control.
    AntiPrompts = new List<string> { "User:" } // Stop generation once antiprompts appear.
};

Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("The chat session has started.\nUser: ");
Console.ForegroundColor = ConsoleColor.Green;
string userInput = Console.ReadLine() ?? "";

while (userInput != "exit")
{
    await foreach ( // Generate the response streamingly.
                   var text
                   in session.ChatAsync(
                       new ChatHistory.Message(AuthorRole.User, userInput),
                       inferenceParams))
    {
        Console.ForegroundColor = ConsoleColor.White;
        Console.Write(text);
    }
    Console.ForegroundColor = ConsoleColor.Green;
    userInput = Console.ReadLine() ?? "";
}

And the output was:

[llama Info]: NativeLibraryConfig Description:
- LibraryName: Llama
- Path: ''
- PreferCuda: True
- PreferredAvxLevel: AVX2
- AllowFallback: True
- SkipCheck: False
- SearchDirectories and Priorities: { ./ }
[llama Debug]: Loading library: 'llama'
[llama Info]: Detected OS Platform: 'WINDOWS'
[llama Debug]: Detected OS string: 'win-x64'
[llama Debug]: Detected extension string: '.dll'
[llama Debug]: Detected prefix string: ''
[llama Info]: Detected cuda major version -1.
[llama Debug]: Trying './runtimes/win-x64/native/avx2/llama.dll'
[llama Info]: Loaded './runtimes/win-x64/native/avx2/llama.dll'
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
   at LLama.Native.SafeLlamaModelHandle.llama_load_model_from_file(System.String, LLama.Native.LLamaModelParams)
--------------------------------
   at LLama.Native.SafeLlamaModelHandle.LoadFromFile(System.String, LLama.Native.LLamaModelParams)
   at LLama.LLamaWeights.LoadFromFile(LLama.Abstractions.IModelParams)
   at Program+<<Main>$>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
   at Program.<Main>$(System.String[])
   at Program.<Main>(System.String[])

@AsakusaRinne AsakusaRinne added the bug Something isn't working label May 6, 2024
@hswlab
Copy link
Contributor

hswlab commented May 7, 2024

@AsakusaRinne
I had downloaded binaies for a slightly older llamasharp version during my first test, probably by mistake. I then simply downloaded the binaries from the description for the major changes. This did not cause any problems with version 0.11.2. I can't remember which binaries I used before. I don't actually use the backends from the Nuget Package Manager. Instead, I always load the backend with NativeLibraryConfig.Instance.WithLibrary(llamaPath, null)

image

@AsakusaRinne
Copy link
Collaborator

@hswlab So the binary older than 0.11.1 works for you but binary after that doesn't?

@hswlab
Copy link
Contributor

hswlab commented May 8, 2024

I just tried the latest binaries "Update Binaries #37" with v0.11.2 of llamasharp, but with no success.
https://github.com/SciSharp/LLamaSharp/actions/runs/8886754252

The older binaries "Update Binaries #30" are working fine with v0.11.2
https://github.com/SciSharp/LLamaSharp/actions/runs/8118890586

Sometimes I'm not really sure which binaries to choose for which release version of llamasharp in this list. This is usually a try an error for me :)
https://github.com/SciSharp/LLamaSharp/actions/workflows/compile.yml

Below is the log I recieved when the following code was called with "Update Binaries #37"

       using LLamaWeights model = LLamaWeights.LoadFromFile(parameters);
       LLamaContext context = model.CreateContext(parameters);
[llama Info]: NativeLibraryConfig Description:
- LibraryName: Llama
- Path: '.\AppData\LLamaSharp\cu12.1.0\llama.dll'
- PreferCuda: True
- PreferredAvxLevel: AVX2
- AllowFallback: True
- SkipCheck: False
- SearchDirectories and Priorities: { ./ }
[llama Info]: Successfully loaded the library [.\AppData\LLamaSharp\cu12.1.0\lla
ma.dll] specified by user
[llama Info]: llama_model_loader: loaded meta data with 19 key-value pairs and 2
91 tensors from D:\Entwicklung\Test\KATI_LLAMA\LLM\vicuna-7b-v1.5.Q4_K_M.gguf (v
ersion GGUF V2)
[llama Info]: llama_model_loader: Dumping metadata keys/values. Note: KV overrid
es do not apply in this output.
[llama Info]: llama_model_loader: - kv   0:                       general.archit
ecture str              = llama
[llama Info]: llama_model_loader: - kv   1:                               genera
l.name str              = LLaMA v2
[llama Info]: llama_model_loader: - kv   2:                       llama.context_
length u32              = 4096
[llama Info]: llama_model_loader: - kv   3:                     llama.embedding_
length u32              = 4096
[llama Info]: llama_model_loader: - kv   4:                          llama.block
_count u32              = 32
[llama Info]: llama_model_loader: - kv   5:                  llama.feed_forward_
length u32              = 11008
[llama Info]: llama_model_loader: - kv   6:                 llama.rope.dimension
_count u32              = 128
[llama Info]: llama_model_loader: - kv   7:                 llama.attention.head
_count u32              = 32
[llama Info]: llama_model_loader: - kv   8:              llama.attention.head_co
unt_kv u32              = 32
[llama Info]: llama_model_loader: - kv   9:     llama.attention.layer_norm_rms_e
psilon f32              = 0.000010
[llama Info]: llama_model_loader: - kv  10:                          general.fil
e_type u32              = 15
[llama Info]: llama_model_loader: - kv  11:                       tokenizer.ggml
.model str              = llama
[llama Info]: llama_model_loader: - kv  12:                      tokenizer.ggml.
tokens arr[str,32000]   = ["<unk>", "<s>", "</s>", "<0x00>", "<...
[llama Info]: llama_model_loader: - kv  13:                      tokenizer.ggml.
scores arr[f32,32000]   = [0.000000, 0.000000, 0.000000, 0.0000...
[llama Info]: llama_model_loader: - kv  14:                  tokenizer.ggml.toke
n_type arr[i32,32000]   = [2, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, ...
[llama Info]: llama_model_loader: - kv  15:                tokenizer.ggml.bos_to
ken_id u32              = 1
[llama Info]: llama_model_loader: - kv  16:                tokenizer.ggml.eos_to
ken_id u32              = 2
[llama Info]: llama_model_loader: - kv  17:            tokenizer.ggml.unknown_to
ken_id u32              = 0
[llama Info]: llama_model_loader: - kv  18:               general.quantization_v
ersion u32              = 2
[llama Info]: llama_model_loader: - type  f32:   65 tensors
[llama Info]: llama_model_loader: - type q4_K:  193 tensors
[llama Info]: llama_model_loader: - type q6_K:   33 tensors
[llama Info]: llm_load_vocab: special tokens definition check successful ( 259/3
2000 ).
[llama Info]: llm_load_print_meta: format           = GGUF V2
[llama Info]: llm_load_print_meta: arch             = llama
[llama Info]: llm_load_print_meta: vocab type       = SPM
[llama Info]: llm_load_print_meta: n_vocab          = 32000
[llama Info]: llm_load_print_meta: n_merges         = 0
[llama Info]: llm_load_print_meta: n_ctx_train      = 4096
[llama Info]: llm_load_print_meta: n_embd           = 4096
[llama Info]: llm_load_print_meta: n_head           = 32
[llama Info]: llm_load_print_meta: n_head_kv        = 32
[llama Info]: llm_load_print_meta: n_layer          = 32
[llama Info]: llm_load_print_meta: n_rot            = 128
[llama Info]: llm_load_print_meta: n_embd_head_k    = 128
[llama Info]: llm_load_print_meta: n_embd_head_v    = 128
[llama Info]: llm_load_print_meta: n_gqa            = 1
[llama Info]: llm_load_print_meta: n_embd_k_gqa     = 4096
[llama Info]: llm_load_print_meta: n_embd_v_gqa     = 4096
[llama Info]: llm_load_print_meta: f_norm_eps       = 0.0e+00
[llama Info]: llm_load_print_meta: f_norm_rms_eps   = 1.0e-05
[llama Info]: llm_load_print_meta: f_clamp_kqv      = 0.0e+00
[llama Info]: llm_load_print_meta: f_max_alibi_bias = 0.0e+00
[llama Info]: llm_load_print_meta: f_logit_scale    = 0.0e+00
[llama Info]: llm_load_print_meta: n_ff             = 11008
[llama Info]: llm_load_print_meta: n_expert         = 0
[llama Info]: llm_load_print_meta: n_expert_used    = 0
[llama Info]: llm_load_print_meta: causal attn      = 1
[llama Info]: llm_load_print_meta: pooling type     = 0
[llama Info]: llm_load_print_meta: rope type        = 0
[llama Info]: llm_load_print_meta: rope scaling     = linear
[llama Info]: llm_load_print_meta: freq_base_train  = 10000.0
[llama Info]: llm_load_print_meta: freq_scale_train = 1
[llama Info]: llm_load_print_meta: n_yarn_orig_ctx  = 4096
[llama Info]: llm_load_print_meta: rope_finetuned   = unknown
[llama Info]: llm_load_print_meta: ssm_d_conv       = 0
[llama Info]: llm_load_print_meta: ssm_d_inner      = 0
[llama Info]: llm_load_print_meta: ssm_d_state      = 0
[llama Info]: llm_load_print_meta: ssm_dt_rank      = 0
[llama Info]: llm_load_print_meta: model type       = 7B
[llama Info]: llm_load_print_meta: model ftype      = Q4_K - Medium
[llama Info]: llm_load_print_meta: model params     = 6.74 B
[llama Info]: llm_load_print_meta: model size       = 3.80 GiB (4.84 BPW)
[llama Info]: llm_load_print_meta: general.name     = LLaMA v2
[llama Info]: llm_load_print_meta: BOS token        = 1 '<s>'
[llama Info]: llm_load_print_meta: EOS token        = 2 '</s>'
[llama Info]: llm_load_print_meta: UNK token        = 0 '<unk>'
[llama Info]: llm_load_print_meta: LF token         = 13 '<0x0A>'
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:   no
ggml_cuda_init: CUDA_USE_TENSOR_CORES: yes
ggml_cuda_init: found 1 CUDA devices:
  Device 0: NVIDIA GeForce GTX 1070, compute capability 6.1, VMM: yes
[llama Info]: llm_load_tensors: ggml ctx size =    0.30 MiB
[llama Info]: llm_load_tensors: offloading 5 repeating layers to GPU
[llama Info]: llm_load_tensors: offloaded 5/33 layers to GPU
[llama Info]: llm_load_tensors:        CPU buffer size =  3891.24 MiB
[llama Info]: llm_load_tensors:      CUDA0 buffer size =   619.02 MiB
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]: .
[llama Info]:
[llama Info]: llama_new_context_with_model: n_ctx      = 1024
[llama Info]: llama_new_context_with_model: n_batch    = 512
[llama Info]: llama_new_context_with_model: n_ubatch   = 4
[llama Info]: llama_new_context_with_model: freq_base  = 1.0
[llama Info]: llama_new_context_with_model: freq_scale = 1
Fatal error. System.AccessViolationException: Attempted to read or write protect
ed memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
   at LLama.Native.SafeLLamaContextHandle.llama_new_context_with_model(LLama.Nat
ive.SafeLlamaModelHandle, LLama.Native.LLamaContextParams)
--------------------------------
   at LLama.LLamaContext..ctor(LLama.LLamaWeights, LLama.Abstractions.IContextPa
rams, Microsoft.Extensions.Logging.ILogger)
   at LLama.LLamaWeights.CreateContext(LLama.Abstractions.IContextParams, Micros
oft.Extensions.Logging.ILogger)
   at KATI.Manager.LLamaSharpIOManager+<CreateNewTopic>d__14.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Can
on, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7ce
c85d7bea7798e]](System.__Canon ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.__Can
on, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7ce
c85d7bea7798e]](System.__Canon ByRef)
   at KATI.Manager.LLamaSharpIOManager.CreateNewTopic()
   at KATI.Manager.LLamaSharpIOManager+<DoChatAsync>d__16.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Can
on, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7ce
c85d7bea7798e]](System.__Canon ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon,
System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d
7bea7798e]].Start[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Cult
ure=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
   at KATI.Manager.LLamaSharpIOManager.DoChatAsync(System.String, OnUpdateCallba
ck)
   at KATI.Manager.LLamaSharpManager+<AskSemething>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Versi
on=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionContextC
allback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionCo
ntext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Versi
on=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext(System.T
hreading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Versi
on=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter+<>c.<OutputWaitEtwEvents>b__12
_0(System.Action, System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+ContinuationWrapper
.Invoke()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Ac
tion, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, Syst
em.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea
7798e]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading
.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=7cec85d7bea7798e]].SetExistingTaskResult(System.Threading.Tasks.
Task`1<System.Threading.Tasks.VoidTaskResult>, System.Threading.Tasks.VoidTaskRe
sult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult()
   at KATI.Manager.ChatProgressManager+<ShareProgress>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.
0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System
.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea77
98e]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionCo
ntext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.
0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System
.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea77
98e]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.
0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System
.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea77
98e]].MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter+<>c.<OutputWaitEtwEvents>b__12
_0(System.Action, System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+ContinuationWrapper
.Invoke()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Ac
tion, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.TrySetResult()
   at System.Threading.Tasks.Task+WhenAllPromise.Invoke(System.Threading.Tasks.T
ask)
   at System.Threading.Tasks.Task.RunOrQueueCompletionAction(System.Threading.Ta
sks.ITaskCompletionAction, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, Syst
em.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea
7798e]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading
.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=7cec85d7bea7798e]].SetExistingTaskResult(System.Threading.Tasks.
Task`1<System.Threading.Tasks.VoidTaskResult>, System.Threading.Tasks.VoidTaskRe
sult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult()
   at Microsoft.AspNetCore.SignalR.HubConnectionContext+<CompleteWriteAsync>d__7
3.MoveNext()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Thr
eading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallba
ck, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachine
Box`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.
0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.AspNetCore.S
ignalR.HubConnectionContext+<CompleteWriteAsync>d__73, Microsoft.AspNetCore.Sign
alR.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].Mo
veNext(System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

@AsakusaRinne
Copy link
Collaborator

@hswlab What is your CPU on your PC and your windows version? I have no idea about this problem yet but I'll look into that.

@hswlab
Copy link
Contributor

hswlab commented May 8, 2024

I'm Using fully updated Win 10.
cuda_12.4.r12.4
But, as already mentioned. I don't really have a problem when I use an older binary. Maybe the newer binaries just don't fit the version v0.11.2 of llamasharp anymore. :)

image

Edit: I also tested "Update Binaries #34" just now, this is the last version of the Binaries, which are working fine on my PC. "Update Binaries #35" and upwards are making errors.
https://github.com/SciSharp/LLamaSharp/actions/runs/8518332362

@AsakusaRinne
Copy link
Collaborator

Does this problem only appear when you are using cuda backend, or with all backends?

@martindevans
Copy link
Collaborator

Sometimes I'm not really sure which binaries to choose for which release version of llamasharp in this list.

To answer this specific question, you want to look at this section of the readme. It tells you the exact llama.cpp commit hash to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants