Import tensors and add methods to sbox#6450
Import tensors and add methods to sbox#6450ArtisticRoomba wants to merge 5 commits intospace-wizards:masterfrom
Conversation
also nuke spans as tey're too much to review rn
| NIndex: { All: True } | ||
| NRange: { All: True } |
There was a problem hiding this comment.
These are from Systems.Buffers, while they're in the numerics tensors assembly this works based on namespace.
Additionally, no consuming APIs are provided, so these shouldn't be either.
| Tensor: | ||
| Methods: | ||
| - "System.Numerics.Tensors.Tensor`1<!!0> Create<>(!!0[])" | ||
| - "System.Numerics.Tensors.Tensor`1<!!0> Create<>(!!0[], System.ReadOnlySpan`1<nint>)" | ||
| - "System.Numerics.Tensors.Tensor`1<!!0> Create<>(!!0[], System.ReadOnlySpan`1<nint>, System.ReadOnlySpan`1<nint>)" | ||
| - "System.Numerics.Tensors.Tensor`1<!!0> Create<>(!!0[], int, System.ReadOnlySpan`1<nint>, System.ReadOnlySpan`1<nint>)" | ||
| Tensor`1: | ||
| Methods: [] |
There was a problem hiding this comment.
No APIs are provided that can consume this type, so it shouldn't be provided.
There was a problem hiding this comment.
Without it, attempting to create a simple tensor using Tensor.Create(); will cause a sandbox violation:
Access to type not allowed: [System.Numerics.Tensors]System.Numerics.Tensors.Tensor`1
There was a problem hiding this comment.
Without it, attempting to create a simple tensor using
Tensor.Create();will cause a sandbox violation:Access to type not allowed: [System.Numerics.Tensors]System.Numerics.Tensors.Tensor`1
Okay but you can't use the Tensor, so why allow Tensor.Create either?
There was a problem hiding this comment.
Ah, right, I see what you mean now. Genius me.
| _tensorA = Tensor.Create(_inputA); | ||
| _tensorB = Tensor.Create(_inputB); | ||
| _tensorOutput = Tensor.Create(_output); |
CC @moonheart08
This PR adds
System.Numerics.Tensorsto the RT project and adds some methods to the sandbox.In general, Tensors is a much better way to take advantage of SIMD intrinsics on hardware without coding all of the methods ourselves (I felt really silly adding AVX512 impls to all of our current
NumericsHelpersmethods).Useful for Atmospherics in SS14.
Microbenchmarks shows improvement, but of course it doesn't paint a full picture:
Details
And the emitted assembly seems to show that AVX-512 instructions are being used in
BenchTensorcompared to AVX-256 instructions inBenchNumericsHelpers.