diff --git a/.travis.yml b/.travis.yml index b073fd29da1b..206d1d489030 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,9 @@ jobs: arch: amd64 osx_image: xcode10.2 env: TASK=java_test + - os: linux + arch: s390x + env: TASK=s390x_test # dependent brew packages # the dependencies from homebrew is installed manually from setup script due to outdated image from travis. diff --git a/src/data/array_interface.h b/src/data/array_interface.h index 35d82e8eda12..fd79b1348143 100644 --- a/src/data/array_interface.h +++ b/src/data/array_interface.h @@ -29,10 +29,6 @@ struct ArrayInterfaceErrors { static char const* TypestrFormat() { return "`typestr' should be of format ."; } - // Not supported in Apache Arrow. - static char const* BigEndian() { - return "Big endian is not supported."; - } static char const* Dimension(int32_t d) { static std::string str; str.clear(); @@ -139,7 +135,6 @@ class ArrayInterfaceHandler { auto typestr = get(array.at("typestr")); CHECK(typestr.size() == 3 || typestr.size() == 4) << ArrayInterfaceErrors::TypestrFormat(); - CHECK_NE(typestr.front(), '>') << ArrayInterfaceErrors::BigEndian(); if (array.find("shape") == array.cend()) { LOG(FATAL) << "Missing `shape' field for array interface"; @@ -239,7 +234,6 @@ class ArrayInterfaceHandler { } static void* ExtractData(std::map const &column, - StringView typestr, std::pair shape) { Validate(column); void* p_data = ArrayInterfaceHandler::GetPtrFromArrayData(column); @@ -268,7 +262,7 @@ class ArrayInterface { std::tie(num_rows, num_cols) = ArrayInterfaceHandler::ExtractShape(array); data = ArrayInterfaceHandler::ExtractData( - array, StringView{typestr}, std::make_pair(num_rows, num_cols)); + array, std::make_pair(num_rows, num_cols)); if (allow_mask) { common::Span s_mask; diff --git a/src/data/device_adapter.cuh b/src/data/device_adapter.cuh index 995722b08b8d..ee94b3dec7bd 100644 --- a/src/data/device_adapter.cuh +++ b/src/data/device_adapter.cuh @@ -124,7 +124,6 @@ class CudfAdapter : public detail::SingleBatchDataIter { auto const& typestr = get(json_columns[0]["typestr"]); CHECK_EQ(typestr.size(), 3) << ArrayInterfaceErrors::TypestrFormat(); - CHECK_NE(typestr.front(), '>') << ArrayInterfaceErrors::BigEndian(); std::vector columns; auto first_column = ArrayInterface(get(json_columns[0])); num_rows_ = first_column.num_rows; diff --git a/tests/cpp/data/test_array_interface.cc b/tests/cpp/data/test_array_interface.cc index df062b547f15..875858855ed5 100644 --- a/tests/cpp/data/test_array_interface.cc +++ b/tests/cpp/data/test_array_interface.cc @@ -42,23 +42,19 @@ TEST(ArrayInterface, Error) { std::string typestr{"(1)); // missing data - EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, - StringView{typestr}, shape), + EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape), dmlc::Error); column["data"] = j_data; // missing typestr - EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, - StringView{typestr}, shape), + EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape), dmlc::Error); column["typestr"] = String(" storage; @@ -67,8 +63,7 @@ TEST(ArrayInterface, Error) { Json(Integer(reinterpret_cast(storage.ConstHostPointer()))), Json(Boolean(false))}; column["data"] = j_data; - EXPECT_NO_THROW(ArrayInterfaceHandler::ExtractData( - column_obj, StringView{typestr}, shape)); + EXPECT_NO_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape)); } TEST(ArrayInterface, GetElement) { diff --git a/tests/python/test_basic.py b/tests/python/test_basic.py index 2d2bec51867c..971d69318096 100644 --- a/tests/python/test_basic.py +++ b/tests/python/test_basic.py @@ -232,6 +232,7 @@ def test_cv_explicit_fold_indices(self): assert isinstance(cv, dict) assert len(cv) == (4) + @pytest.mark.skipif(**tm.skip_s390x()) def test_cv_explicit_fold_indices_labels(self): params = {'max_depth': 2, 'eta': 1, 'verbosity': 0, 'objective': 'reg:squarederror'} diff --git a/tests/python/testing.py b/tests/python/testing.py index 947b303a0e39..d47d1c18cb58 100644 --- a/tests/python/testing.py +++ b/tests/python/testing.py @@ -11,6 +11,7 @@ import tempfile import xgboost as xgb import numpy as np +import platform hypothesis = pytest.importorskip('hypothesis') sklearn = pytest.importorskip('sklearn') @@ -136,6 +137,12 @@ def no_multiple(*args): return {'condition': condition, 'reason': reason} +def skip_s390x(): + condition = platform.machine() == "s390x" + reason = "Known to fail on s390x" + return {"condition": condition, "reason": reason} + + # Contains a dataset in numpy format as well as the relevant objective and metric class TestDataset: def __init__(self, name, get_dataset, objective, metric diff --git a/tests/travis/run_test.sh b/tests/travis/run_test.sh index 3c100e99b121..2a2f5a95ae15 100755 --- a/tests/travis/run_test.sh +++ b/tests/travis/run_test.sh @@ -103,5 +103,5 @@ if [ ${TASK} == "s390x_test" ]; then # Run model compatibility tests cd .. python3 -m pip install --user pytest hypothesis - PYTHONPATH=./python-package python3 -m pytest --fulltrace -v -rxXs tests/python/ -k 'test_model' + PYTHONPATH=./python-package python3 -m pytest --fulltrace -v -rxXs tests/python/test_basic.py fi