Skip to content

Removed AlignedArray #1657

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

Merged
merged 5 commits into from
Dec 4, 2018
Merged

Removed AlignedArray #1657

merged 5 commits into from
Dec 4, 2018

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Nov 16, 2018

  • Removed Aligned Array from Rff and timeseries. The only place left is FactorAwareFactorization. So I moved it to that namespace so that nobody can use aligned array anymore
  • Matmul and MatmulTran modified for any dimension of row and col
  • added some more tests for new dimension changes
  • corrected the base implementation of MatMulTrans
  • added tolerance for some tests for netcoreapp3.0

Fixes #1018
Related to #1096

@Anipik
Copy link
Contributor Author

Anipik commented Nov 20, 2018

Before
Method Avx Sse Native
MatMulX 92.10 us 105 us 105.6 us
MatMulTranX 94.80 us 113 us 115 us
After
Method Avx Sse Native
MatMulX 92.50 us 105 us 104.8 us
MatMulTranX 94.70 us 113 us 111.6 us

// The performance is almost the same(within error range) except for native MatmulTrans

// end to end Rff Transform @justinormont provided me with the end to end benchmark

Method Native
Without Aligned Array 1.32 s
with AlignedArray 1.35 ms

I also checked this end to end Benchmark for my earlier change (where I just changed the implementation of matmul and matmulTrans). in that case both before and after was around 850ms.

Just for note that something other than my change has made the test slower

@Anipik
Copy link
Contributor Author

Anipik commented Nov 26, 2018

@tannergooding can you please take a look at this ?

@eerhardt eerhardt requested a review from codemzs November 26, 2018 22:27
@danmoseley
Copy link
Member

It would be good to fix the spelling of CpuAligenedMathUtils.cs

@danmoseley
Copy link
Member

@shauheen this PR will not be completed imminently because @Anipik has been occupied with a customer issue.

@Anipik
Copy link
Contributor Author

Anipik commented Nov 28, 2018

It would be good to fix the spelling of CpuAligenedMathUtils.cs

This file will be removed after this PR

@Anipik
Copy link
Contributor Author

Anipik commented Nov 29, 2018

@tannergooding @eerhardt can you please review this one ? i have addressed the feedback

@@ -41,7 +41,7 @@ public TimeSeriesEstimatorTests(ITestOutputHelper output) : base(output)
{
}

[ConditionalFact(typeof(BaseTestBaseline), nameof(BaseTestBaseline.LessThanNetCore30OrNotNetCore))] // netcore3.0 output differs from Baseline
[ConditionalFact(typeof(BaseTestBaseline), nameof(BaseTestBaseline.LessThanNetCore30OrNotNetCoreAnd64BitProcess))] // 32bit and netcore3.0 output differs from Baseline
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated. Why is it necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our new algorithm leads to slightly different numbers due to different number of multiplications. (in case of floating points). After the change the x86 baseline numbers are almost same as netcoreapp but different from the original x64

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@Anipik
Copy link
Contributor Author

Anipik commented Nov 30, 2018

@tannergooding can you please review this one ?

@Anipik
Copy link
Contributor Author

Anipik commented Dec 3, 2018

@tannergooding I have added the code snippet we talked about in all the implementations

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes look to address the given feedback.

@Anipik Anipik merged commit 72ec121 into dotnet:master Dec 4, 2018
@Anipik Anipik deleted the temp2 branch December 4, 2018 20:51
TomFinley added a commit to TomFinley/machinelearning that referenced this pull request Dec 6, 2018
This reverts commit 72ec121.
A bug was detected that resulted in non-deterministic calculation, since the
underlying C++ code was written in a way apparently that required alignment
to produce consistent results, so of course just removing the alignment and
calling an only slightly modified algorithm compromised determinism, resulting
in test failure for RFF in particular.
TomFinley added a commit that referenced this pull request Dec 6, 2018
This reverts commit 72ec121.
A bug was detected that resulted in non-deterministic calculation, since the
underlying C++ code was written in a way apparently that required alignment
to produce consistent results, so of course just removing the alignment and
calling an only slightly modified algorithm compromised determinism, resulting
in test failure for RFF in particular.
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants