microsoft / microsoft/onnxruntime

[Feature Request] using SetSeed on C# inference

Open
#25,570 0 comments 2 reactions 0 assignees View on GitHub
api:CSharp feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

Like #23306, but for C#.

I hope we can set the seed used in onnx's PRNG from our C# code when running onnx models.

### Describe scenario use case

I am a contributor to [OpenUtau](https://github.com/stakira/openutau) singing synthesizer's AI synthesis functionality. It uses a diffusion model, which produces different result each time. Currently we cache the generated audio on the user's PC to ensure the audio remained unchanged when they opens the project file next time. However, the cache is very large. Also the same file won't produce the same output on another user's PC. So I hope that the user can manually specify a random seed to produce deterministic output audio.

Contributor guide

Open the contributing guide

Research direction

Start by reading issue #23306 and the existing C# inference APIs to identify how random-number configuration is exposed. The work is done when C# callers can specify ONNX's PRNG seed and repeated inference produces deterministic output as described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.