TensorStack-AI / OnnxStack

C# Stable Diffusion using ONNX Runtime
Apache License 2.0
221 stars 33 forks source link

System.Numerics.TensorPrimitives for Cpu math #72

Closed saddam213 closed 11 months ago

saddam213 commented 11 months ago

Latest OnnxRuntime includes System.Numerics.TensorPrimitives which has some Span based Tensor math operations

This PR will aim to move all possible CPU tensor math to use these new functions, mainly TensorHelper, Scheduler and Diffuser classes

saddam213 commented 11 months ago

After TensorHelper update gained about 5-10% performance

LCM 6 Steps: 1280ms -> 880ms avg 100 images