Repository navigation
OnnxRuntimeGenAIChatCompletionService seems broken? #10796
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Updated to the latest SK and ran some previously working chat completion code:
await foreach (var chatUpdate in m_Kernel.InvokePromptStreamingAsync<StreamingChatMessageContent>(
promptTemplate: @$"Question: {{{{$query}}}}{additionalContext}",
arguments: new KernelArguments()
{
{ "query", userInput.Content }
}))
and I get an exception:
Method not found: 'Void Microsoft.ML.OnnxRuntimeGenAI.GeneratorParams.SetInputSequences(Microsoft.ML.OnnxRuntimeGenAI.Sequences)'.
at Microsoft.SemanticKernel.Connectors.Onnx.OnnxRuntimeGenAIChatCompletionService.<RunInferenceAsync>d__13.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Microsoft.SemanticKernel.Connectors.Onnx.OnnxRuntimeGenAIChatCompletionService.<RunInferenceAsync>d__13.System.IAsyncDisposable.DisposeAsync()
at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.Enumerator.DisposeAsync() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConfiguredCancelableAsyncEnumerable.cs:line 76
at Microsoft.SemanticKernel.Connectors.Onnx.OnnxRuntimeGenAIChatCompletionService.<GetStreamingChatMessageContentsAsync>d__12.MoveNext()
at Microsoft.SemanticKernel.Connectors.Onnx.OnnxRuntimeGenAIChatCompletionService.<GetStreamingChatMessageContentsAsync>d__12.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at Microsoft.SemanticKernel.KernelFunctionFromPrompt.<InvokeStreamingCoreAsync>d__7`1.MoveNext() in Microsoft.SemanticKernel\KernelFunctionFromPrompt.cs:line 193
at Microsoft.SemanticKernel.KernelFunctionFromPrompt.<InvokeStreamingCoreAsync>d__7`1.MoveNext() in Microsoft.SemanticKernel\KernelFunctionFromPrompt.cs:line 193
at Microsoft.SemanticKernel.KernelFunctionFromPrompt.<InvokeStreamingCoreAsync>d__7`1.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at Microsoft.SemanticKernel.KernelFunction.<InvokeStreamingAsync>d__30`1.MoveNext() in Microsoft.SemanticKernel\KernelFunction.cs:line 276
at Microsoft.SemanticKernel.KernelFunction.<InvokeStreamingAsync>d__30`1.MoveNext() in Microsoft.SemanticKernel\KernelFunction.cs:line 265
at Microsoft.SemanticKernel.KernelFunction.<InvokeStreamingAsync>d__30`1.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
Could be related: microsoft/onnxruntime-genai#1230
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
- StatusShow more project fieldsSprint: Done
Activity
stephentoub commentedon Mar 4, 2025
What version of the ONNX Runtime GenAI component are you referencing? There was a change in that library. Try updating to the latest on nuget.
lilhoser commentedon Mar 4, 2025
stephentoub commentedon Mar 5, 2025
You're using an inconsistent set of packages, e.g. some SK packages version 1.40.1 and other 1.39.0-alpha, some ONNX packages 0.7.0-r1 and some 0.6.0.
Try moving all of them to be the latest versions on nuget.
lilhoser commentedon Mar 5, 2025
These are the latest packages according to Nuget package manager. However, I removed them and added them back and now have a different package lineup that looks more consistent:
I'm not sure why nuget did not indicate there was an updated version of 1.39.0-alpha.
It did the same thing for
OnnxRuntimeGenAI- claimed 0.6.0 was the latest for Cuda and DirectML (when actually 0.7.0-rc1 is the latest for all three).[-]Bug: OnnxRuntimeGenAIChatCompletionService seems broken?[/-][+]OnnxRuntimeGenAIChatCompletionService seems broken?[/+]