-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding a new CI leg for netcoreapp 3.0 #1700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f411c04
2072161
62d8818
109405a
05695b0
05802f4
227a02f
bb962b3
a33eab5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.0.100-alpha1-009622 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| // * P suffix means sparse (unaligned) partial vector - the vector is only part of a larger sparse vector. | ||
| // * Tran means the matrix is transposed. | ||
|
|
||
| using Microsoft.ML.Runtime.Internal.CpuMath.Core; | ||
| using System; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
|
|
@@ -158,9 +159,6 @@ public static unsafe void MatMul(AlignedArray mat, AlignedArray src, AlignedArra | |
|
|
||
| public static unsafe void MatMul(ReadOnlySpan<float> mat, ReadOnlySpan<float> src, Span<float> dst, int crow, int ccol) | ||
| { | ||
| Contracts.Assert(crow % 4 == 0); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these asserts being removed as part of enabling CI?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These asserts are wrong, they were not being tested earlier because |
||
| Contracts.Assert(ccol % 4 == 0); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| fixed (float* pmat = &MemoryMarshal.GetReference(mat)) | ||
|
|
@@ -313,9 +311,6 @@ public static unsafe void MatMulP(AlignedArray mat, ReadOnlySpan<int> rgposSrc, | |
| public static unsafe void MatMulP(ReadOnlySpan<float> mat, ReadOnlySpan<int> rgposSrc, ReadOnlySpan<float> src, | ||
| int posMin, int iposMin, int iposEnd, Span<float> dst, int crow, int ccol) | ||
| { | ||
| Contracts.Assert(crow % 8 == 0); | ||
| Contracts.Assert(ccol % 8 == 0); | ||
|
|
||
| // REVIEW: For extremely sparse inputs, interchanging the loops would | ||
| // likely be more efficient. | ||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
|
|
@@ -473,9 +468,6 @@ public static unsafe void MatMulTran(AlignedArray mat, AlignedArray src, Aligned | |
|
|
||
| public static unsafe void MatMulTran(ReadOnlySpan<float> mat, ReadOnlySpan<float> src, Span<float> dst, int crow, int ccol) | ||
| { | ||
| Contracts.Assert(crow % 4 == 0); | ||
| Contracts.Assert(ccol % 4 == 0); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| fixed (float* pmat = &MemoryMarshal.GetReference(mat)) | ||
|
|
@@ -951,8 +943,6 @@ public static unsafe void Scale(float scale, Span<float> dst) | |
|
|
||
| public static unsafe void ScaleSrcU(float scale, ReadOnlySpan<float> src, Span<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think asserts here are still valuable, aren't they? Contracts.Assert(count <= src.Length && src.Length <= dst.Length);
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add the more appropiate asserts with the documentation pr.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO - no I don't think that approach is worth doing. That's why the Slicing spans is cheap, but it isn't free. You still have bounds checks to ensure the sliced values are less than the span length. |
||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| { | ||
|
|
@@ -1046,8 +1036,6 @@ public static unsafe void ScaleAddU(float a, float b, Span<float> dst) | |
|
|
||
| public static unsafe void AddScaleU(float scale, ReadOnlySpan<float> src, Span<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| { | ||
|
|
@@ -1100,8 +1088,6 @@ public static unsafe void AddScaleU(float scale, ReadOnlySpan<float> src, Span<f | |
|
|
||
| public static unsafe void AddScaleCopyU(float scale, ReadOnlySpan<float> src, ReadOnlySpan<float> dst, Span<float> result, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| fixed (float* pres = &MemoryMarshal.GetReference(result)) | ||
|
|
@@ -1156,8 +1142,6 @@ public static unsafe void AddScaleCopyU(float scale, ReadOnlySpan<float> src, Re | |
|
|
||
| public static unsafe void AddScaleSU(float scale, ReadOnlySpan<float> src, ReadOnlySpan<int> idx, Span<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (int* pidx = &MemoryMarshal.GetReference(idx)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
|
|
@@ -1206,8 +1190,6 @@ public static unsafe void AddScaleSU(float scale, ReadOnlySpan<float> src, ReadO | |
|
|
||
| public static unsafe void AddU(ReadOnlySpan<float> src, Span<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| { | ||
|
|
@@ -1255,8 +1237,6 @@ public static unsafe void AddU(ReadOnlySpan<float> src, Span<float> dst, int cou | |
|
|
||
| public static unsafe void AddSU(ReadOnlySpan<float> src, ReadOnlySpan<int> idx, Span<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (int* pidx = &MemoryMarshal.GetReference(idx)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
|
|
@@ -1738,8 +1718,6 @@ public static unsafe float MaxAbsDiffU(float mean, ReadOnlySpan<float> src) | |
|
|
||
| public static unsafe float DotU(ReadOnlySpan<float> src, ReadOnlySpan<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| { | ||
|
|
@@ -1792,8 +1770,6 @@ public static unsafe float DotU(ReadOnlySpan<float> src, ReadOnlySpan<float> dst | |
|
|
||
| public static unsafe float DotSU(ReadOnlySpan<float> src, ReadOnlySpan<float> dst, ReadOnlySpan<int> idx, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| fixed (int* pidx = &MemoryMarshal.GetReference(idx)) | ||
|
|
@@ -1848,8 +1824,6 @@ public static unsafe float DotSU(ReadOnlySpan<float> src, ReadOnlySpan<float> ds | |
|
|
||
| public static unsafe float Dist2(ReadOnlySpan<float> src, ReadOnlySpan<float> dst, int count) | ||
| { | ||
| Contracts.Assert(src.Length == dst.Length); | ||
|
|
||
| fixed (float* psrc = &MemoryMarshal.GetReference(src)) | ||
| fixed (float* pdst = &MemoryMarshal.GetReference(dst)) | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -255,7 +255,7 @@ public void TestCrossValidationBinaryMacro() | |
| } | ||
| } | ||
|
|
||
| [Fact] | ||
| [ConditionalFact(typeof(BaseTestBaseline), nameof(BaseTestBaseline.LessThanNetCore30OrNotNetCore))] // netcore3.0 output differs from Baseline | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are we doing to track getting these tests enabled on .net core 3?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i have opened the issue for it #1096 It contains the list of tests that we fixed and ones still remaining |
||
| public void TestCrossValidationMacro() | ||
| { | ||
| var dataPath = GetDataPath(TestDatasets.generatedRegressionDatasetmacro.trainFilename); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.