Fix outdated GenAI APIs and add Windows ML guidance#249
Open
nmetulev wants to merge 1 commit intoMicrosoftDocs:docsfrom
Open
Fix outdated GenAI APIs and add Windows ML guidance#249nmetulev wants to merge 1 commit intoMicrosoftDocs:docsfrom
nmetulev wants to merge 1 commit intoMicrosoftDocs:docsfrom
Conversation
a3347ad to
b834953
Compare
- Update InferStreaming in get-started-models-genai.md to use current OnnxRuntimeGenAI 0.6+ APIs: - SetInputSequences -> generator.AppendTokenSequences (moved to Generator) - Remove ComputeLogits (handled by GenerateNextToken internally) These APIs were removed in the continuous decoding change: microsoft/onnxruntime-genai#1142 - Switch GenAI walkthrough from .DirectML to .WinML package for automatic hardware EP selection. Add alternative packages section. - Switch ONNX WinUI walkthrough from standalone ORT + SharpDX.DXGI to Windows ML (Microsoft.WindowsAppSDK.ML): - Replace manual DirectML adapter selection with EP Catalog - Remove SharpDX.DXGI dependency - Use async InitModelAsync with EnsureAndRegisterCertifiedAsync Co-authored-by: Copilot <[email protected]>
b834953 to
0dddb04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes broken code in the GenAI walkthrough and updates both model walkthroughs to use Windows ML APIs instead of standalone ONNX Runtime packages.
Changes
docs/models/get-started-models-genai.mdInferStreamingcode sample usesSetInputSequencesandComputeLogitswhich were removed from ONNX Runtime GenAI in v0.6.0 (continuous decoding change). Updated to:generatorParams.SetInputSequences(sequences)→generator.AppendTokenSequences(sequences)generator.ComputeLogits()(now handled internally byGenerateNextToken())Microsoft.ML.OnnxRuntimeGenAI.DirectMLto.WinMLfor automatic hardware EP selectiondocs/models/get-started-onnx-winui.mdMicrosoft.ML.OnnxRuntime.DirectML+SharpDX.DXGIwithMicrosoft.WindowsAppSDK.MLAppendExecutionProvider_DML+ SharpDX adapter selection withExecutionProviderCatalog.EnsureAndRegisterCertifiedAsync()Why
The
docs/models/walkthroughs are high-traffic entry points (they rank well in search for "WinUI ONNX model" queries). Currently they send developers to the standalone ONNX Runtime path, bypassing Windows ML's shared runtime and automatic EP management. These changes align the walkthroughs with the recommended Windows ML path documented indocs/new-windows-ml/.How this was validated
Built a WinUI 3 test app exercising both paths:
.WinML0.13.1