-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Run tests and build Python wheels for aarch64 architecture #3948
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dada1a3
Update setup.sh
StrikerRUS 3c0b6c4
Update test.sh
StrikerRUS fad0b69
Update test_dask.py
StrikerRUS a3c42bb
Update test_engine.py
StrikerRUS 9c3c640
Update .vsts-ci.yml
StrikerRUS f4d1b0d
Merge branch 'master' into qemu_aarch64
StrikerRUS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import math | ||
import os | ||
import pickle | ||
import platform | ||
import random | ||
|
||
import numpy as np | ||
|
@@ -1047,15 +1048,21 @@ def test_contribs_sparse(): | |
# convert data to dense and get back same contribs | ||
contribs_dense = gbm.predict(X_test.toarray(), pred_contrib=True) | ||
# validate the values are the same | ||
np.testing.assert_allclose(contribs_csr.toarray(), contribs_dense) | ||
if platform.machine() == 'aarch64': | ||
np.testing.assert_allclose(contribs_csr.toarray(), contribs_dense, rtol=1, atol=1e-12) | ||
else: | ||
np.testing.assert_allclose(contribs_csr.toarray(), contribs_dense) | ||
Comment on lines
+1051
to
+1054
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. Sometimes
|
||
assert (np.linalg.norm(gbm.predict(X_test, raw_score=True) | ||
- np.sum(contribs_dense, axis=1)) < 1e-4) | ||
# validate using CSC matrix | ||
X_test_csc = X_test.tocsc() | ||
contribs_csc = gbm.predict(X_test_csc, pred_contrib=True) | ||
assert isspmatrix_csc(contribs_csc) | ||
# validate the values are the same | ||
np.testing.assert_allclose(contribs_csc.toarray(), contribs_dense) | ||
if platform.machine() == 'aarch64': | ||
np.testing.assert_allclose(contribs_csc.toarray(), contribs_dense, rtol=1, atol=1e-12) | ||
else: | ||
np.testing.assert_allclose(contribs_csc.toarray(), contribs_dense) | ||
|
||
|
||
def test_contribs_sparse_multiclass(): | ||
|
@@ -1087,7 +1094,10 @@ def test_contribs_sparse_multiclass(): | |
contribs_csr_array = np.swapaxes(np.array([sparse_array.todense() for sparse_array in contribs_csr]), 0, 1) | ||
contribs_csr_arr_re = contribs_csr_array.reshape((contribs_csr_array.shape[0], | ||
contribs_csr_array.shape[1] * contribs_csr_array.shape[2])) | ||
np.testing.assert_allclose(contribs_csr_arr_re, contribs_dense) | ||
if platform.machine() == 'aarch64': | ||
np.testing.assert_allclose(contribs_csr_arr_re, contribs_dense, rtol=1, atol=1e-12) | ||
else: | ||
np.testing.assert_allclose(contribs_csr_arr_re, contribs_dense) | ||
contribs_dense_re = contribs_dense.reshape(contribs_csr_array.shape) | ||
assert np.linalg.norm(gbm.predict(X_test, raw_score=True) - np.sum(contribs_dense_re, axis=2)) < 1e-4 | ||
# validate using CSC matrix | ||
|
@@ -1100,7 +1110,10 @@ def test_contribs_sparse_multiclass(): | |
contribs_csc_array = np.swapaxes(np.array([sparse_array.todense() for sparse_array in contribs_csc]), 0, 1) | ||
contribs_csc_array = contribs_csc_array.reshape((contribs_csc_array.shape[0], | ||
contribs_csc_array.shape[1] * contribs_csc_array.shape[2])) | ||
np.testing.assert_allclose(contribs_csc_array, contribs_dense) | ||
if platform.machine() == 'aarch64': | ||
np.testing.assert_allclose(contribs_csc_array, contribs_dense, rtol=1, atol=1e-12) | ||
else: | ||
np.testing.assert_allclose(contribs_csc_array, contribs_dense) | ||
|
||
|
||
@pytest.mark.skipif(psutil.virtual_memory().available / 1024 / 1024 / 1024 < 3, reason='not enough RAM') | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what way did the Dask tests fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember, sorry! I marked Dask tests to be skipped at the very begging of enabling QEMU and cannot find logs for runs where they were enabled. I think we can investigate Dask support for aarch64 in a follow-up PR. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep it's ok, can be a follow-up