Comments (24)
@fdncred I've read this article, I realized that Span<T>
is important to NumSharp's performance, we might have to give up the net472, only support .NET Core 2.1. That would bring best performance without coping memory. @dotChris90 Do you agree with that? We can still moving forward in current T[] way, I'm saying we would replace it with Span<T>
. Keep this issue open.
from numsharp.
@Oceania2018 I agree 100% that we need the Span and I see that the slicing and views could give us the best benefits than :D Means we slicing matrix to multiple vectors (as an example) and do operations on vectors - the matrix could be also updated if we using this nice "managed pointers" :D
from numsharp.
Only can be used in .NET Core 2.1, NumSharp is using .net standard 2.0. We will change TargetFrameworks if needed.
https://www.codemag.com/article/1807051/Introducing-.NET-Core-2.1-Flagship-Types-Span-T-and-Memory-T
from numsharp.
@Oceania2018 @fdncred just for curiosity. Do u use at moment . NET CORE or Full?
I think at moment we 3 are the main workers at this repo and I really like the span if we e.g. Slice arrays or generate different views for the same arrays. I think it could be also great when parallel operations.
from numsharp.
Seem like just install System.Memory
through NuGet, NumSharp will support Span<T>
, we store all data in a 1-d array, acutally, we don't need slice any data. Span<T>
looks great, agree with you. Everything could be tried and test. Appriciate.
from numsharp.
I used dotnet full i.e. net472 however, if we're going to make a numpy clone that as fast as the real numpy the only way to do it is either with p/invoke or span. I think the netstandard, full, and core are slowly merging into one framework. The future is definitely core. Even WinForms and Xaml/Wpf are being rewritten in dotnet core right now. It's scheduled for 3.0 release.
This bit of code was made me think of Span. The Skip and Take specifically.
https://github.com/Oceania2018/NumSharp/blob/4bbca14e07066aa4692c8df27dae0a097bdfb215/src/NumSharp/NdArray.cs#L109
The downside to dotnet core is that it brings a lot of baggage with it in the form of dozens of assemblies/dlls.
For now I would suggest doing something like this:
#if FULL
// do dotnet full stuff
#else
// do dotnet core stuff
#endif
from numsharp.
One other benefit with dotnet core is that it runs on Windows/Mac/Linux. It's designed to be cross-platform.
from numsharp.
Totally agree. Honestly at moment try our code on windows 10 and a Linux MX (Debian base). It's simple awesome to see we can target multiple platforms.
And we targeting multiple languages. C#, F#, VB and I often try powershell.
Beside this there is the cool project peachpie which bring php to the dotnet world.
On top of this. There exist bindings for Matlab and python. We could use NumSharp in python lol
So it's cool time to be dotnet developer.
But I guess soon or later there will be a new dotnet standard and with this we get the span in all frameworks.
:)
from numsharp.
@fdncred @Oceania2018 did you hear something like a NetStadard2.1 or 3.0?
The last Update I hear is that 2.0 is the latest standard.
If we know a new standard we could plan if changing the Standard can be done now, in some weeks or .... other date
from numsharp.
I have not heard of a new netstandard however i have heard of netcore3 which will include winforms and wpf cross platform.
from numsharp.
@dotChris90, @Oceania2018 Before moving forward with Span could you please test my latest push d1bed10? I've only been able to test with my MacBook and OSX. Tomorrow I should be able to get back on Visual Studio. I just want confirmation that you can build all and run all the tests and they all succeed.
This is from vscode on my mac.
from numsharp.
@fdncred mine works fine. First it shows such red lines like on the image. But after build, test and restart all works fine. Idk why .... but as long as it works. all ok. but at moment just on Windows 10. Maybe tomorrow should try it again on Linux.
from numsharp.
@dotChris90 are you using vscode or Visual Studio on Win10?
from numsharp.
@fdncred VS Code. Honestly spoken now got used to it and like it more lol. Except on razor stuff... In cshtml stuff it still need some little more improvement
from numsharp.
Committed first Span code with 01e2de1. Ideally NDArray's T[] Data
would be a Span<T> Data
but it's not allowed. So, we'll have to figure out how and where to use it best. It's benefit is speed and reduced memory allocations.
from numsharp.
Ok glade to see everybody of us seems to agree go with 2.1 core lol.
OK cool to see there are first push with itπ
from numsharp.
If we're going to use Span I don't think there is any other choice. I don't think netstandard nor netfull support Span.
from numsharp.
By the way net standard 2.1 has the span
from numsharp.
Hooray
from numsharp.
@dotChris90 Is it released yet? or do you know when it will be released?
from numsharp.
hm did not find any concrete date and on https://github.com/dotnet/standard/milestone/3 it seems there still some progress. I am not sure when it will be released. But I am sure it is not yet released. :(
from numsharp.
We can also see some things it doesn't include here. I assumed there would be a preview but I don't see one. Maybe they're not that far yet.
from numsharp.
Yes this is correct. But I say - Oceania2018 already changed the csproj - so all work. So it is not critical to change to 2.1 standard. ;) anyway - the first day it is released, we should change the csproj. ;)
from numsharp.
from numsharp.
Related Issues (20)
- np.random.choice with replace: false produces duplicates
- ToBitmap() - datatype mistmatch
- critical vulnerability in version 5.0.2 of system.drawing.common
- Numsharp array output in .net interactive notebooks is misleading
- Hello, has SciSharp/NumSharp stopped development and maintenance? HOT 2
- What is the exposed method for percentiles & median using np?
- Can NumSharp fit polynomial surface equations?
- np.linalg.pinv not supported HOT 1
- Is there an example on how to use it with IronPython?
- Possible typo "ToMuliDimArray()" HOT 1
- The fact that such an excellent project has many unimplemented APIs and is no longer being maintained is regrettable.
- Memory leak?
- `np.convolve` return null exception
- Cannot create an NDArray of shorts
- np.maximum error
- np.hstack has diffrent effect from python
- Extremely poor performance on sum reduce HOT 1
- How to save a nested dictionary with `save_npz`
- Does Numsharp work in Unity with the IL2CPP backend?
- how to change to Microsoft.ML.OnnxRuntime.Tensors.DenseTensor<float>?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numsharp.