Commit Graph
100 Commits
Author SHA1 Message Date
Jiaming Yuan 84e395d91e Fix CMake build on Windows with setuptools. (#5280) 2020-02-05 10:47:39 +08:00
Jiaming Yuan 595a00466d Rewrite setup.py. (#5271)
The setup.py is rewritten.  This new script uses only Python code and provide customized
implementation of setuptools commands.  This way users can run most of setuptools commands
just like any other Python libraries.

* Remove setup_pip.py
* Remove soft links.
* Define customized commands.
* Remove shell script.
* Remove makefile script.
* Update the doc for building from source.
2020-02-04 13:35:42 +08:00
Jiaming Yuan a5cc112eea Export JSON config in get_params. (#5256) 2020-02-03 12:46:51 +08:00
Jiaming Yuan ed0216642f Avoid dask test fixtures. (#5270)
* Fix Travis OSX timeout.

* Fix classifier.
2020-02-03 12:39:20 +08:00
Jiaming Yuan 856b81c727 Ignore gdb_history. [skip ci] (#5257) 2020-02-02 20:40:09 +08:00
Jiaming Yuan fe8d72b50b Cleanup warnings. (#5247)
From clang-tidy-9 and gcc-7: Invalid case style, narrowing definition, wrong
initialization order, unused variables.
2020-01-31 14:52:15 +08:00
Jiaming Yuan 472ded549d Save Scikit-Learn attributes into learner attributes. (#5245)
* Remove the recommendation for pickle.

* Save skl attributes in booster.attr

* Test loading scikit-learn model with native booster.
2020-01-30 16:00:18 +08:00
Jiaming Yuan 43974939f4 Better error message about loading pickled model. (#5236)
Print the link to new tutorial.
2020-01-28 15:29:14 +08:00
Jiaming Yuan ef19480eda Add dart to JSON schema. (#5218)
* Add dart to JSON schema.

* Use spaces instead of tab.
2020-01-28 13:29:09 +08:00
Jiaming Yuan 3eb1279bbf Config for linear updaters. (#5222) 2020-01-25 11:26:46 +08:00
Jiaming Yuan 40680368cf Add constraint parameters to Scikit-Learn interface. (#5227)
* Add document for constraints.

* Fix a format error in doc for objective function.
2020-01-25 11:12:02 +08:00
Jiaming Yuan 1891cc766d Fix metainfo from DataFrame. (#5216)
* Fix metainfo from DataFrame.

* Unify helper functions for data and meta.
2020-01-22 16:29:44 +08:00
Jiaming Yuan 5199b86126 Fix R dart prediction. (#5204)
* Fix R dart prediction and add test.
2020-01-16 12:11:04 +08:00
Jiaming Yuan 808f61081b Update R doc by roxygen2. (#5201) 2020-01-15 10:49:17 +08:00
Jiaming Yuan 7b65698187 Enforce correct data shape. (#5191)
* Fix syncing DMatrix columns.
* notes for tree method.
* Enable feature validation for all interfaces except for jvm.
* Better tests for boosting from predictions.
* Disable validation on JVM.
2020-01-13 15:48:17 +08:00
Jiaming Yuan ee287808fb Lazy initialization of device vector. (#5173)
* Lazy initialization of device vector.

* Fix #5162.

* Disable copy constructor of HostDeviceVector.  Prevents implicit copying.

* Fix CPU build.

* Bring back move assignment operator.
2020-01-07 11:23:05 +08:00
Jiaming Yuan 77cfbff5a7 Fix span constructor. (#5166)
* Make sure copy constructor is used.
2020-01-07 11:19:38 +08:00
Jiaming Yuan ebc86a3afa Disable parameter validation for Scikit-Learn interface. (#5167)
* Disable parameter validation for now.

Scikit-Learn passes all parameters down to XGBoost, whether they are used or
not.

* Add option `validate_parameters`.
2020-01-07 11:17:31 +08:00
Jiaming Yuan 2b9a62a806 Throw error when not compiled with NCCL. (#5170) 2020-01-07 11:15:19 +08:00
Jiaming Yuan 04db125699 Quick fix for memory leak in CPU Hist. (#5153)
Closes https://github.com/dmlc/xgboost/issues/3579 .

* Don't use map.
2019-12-31 14:05:53 +08:00
Jiaming Yuan 139ccc9902 Fix num_roots to be 1. (#5165) 2019-12-30 02:18:45 +08:00
Jiaming Yuan d55489af14 Don't use modernize-use-trailing-return-type. (#5169) 2019-12-29 20:18:23 +08:00
Jiaming Yuan 6848d0426f Clean up Python 2 compatibility code. (#5161) 2019-12-27 18:34:53 +08:00
Jiaming Yuan 61286c6e8f Fix wrapping GPU ID and prevent data copying. (#5160)
* Removed some data copying.

* Make sure gpu_id is valid before any configuration is carried out.
2019-12-27 16:51:08 +08:00
Jiaming Yuan f3d7877802 Parameter validation (#5157)
* Unused code.

* Split up old colmaker parameters from train param.

* Fix dart.

* Better name.
2019-12-26 11:59:05 +08:00
Jiaming Yuan ced3660f60 Tests for empty dmatrix. (#5159) 2019-12-26 11:51:54 +08:00
Jiaming Yuan 298ebe68ac [Breaking] Remove learning_rates in Python. (#5155)
* Remove `learning_rates`.

It's been deprecated since we have callback.

* Set `before_iteration` of `reset_learning_rate` to False to preserve 
  the initial learning rate, and comply to the term "reset".

Closes #4709.

* Tests for various `tree_method`.
2019-12-24 14:25:48 +08:00
Jiaming Yuan 73b1bd2789 Update demo for ranking. (#5154) 2019-12-24 13:39:07 +08:00
Jiaming Yuan 0202e04a8e Add base margin to sklearn interface. (#5151) 2019-12-24 09:43:41 +08:00
Jiaming Yuan 1d0ca49761 Example JSON model parser and Schema. (#5137) 2019-12-23 19:47:35 +08:00
Jiaming Yuan a4b929385e Note for DaskDMatrix. (#5144)
* Brief introduction to `DaskDMatrix`.

* Add xgboost.dask.train to API doc
2019-12-23 18:55:32 +08:00
Jiaming Yuan c8bdb652c4 Add check for length of weights. (#4872) 2019-12-21 11:30:58 +08:00
Jiaming Yuan b915788708 Remove benchmark code in GPU test. (#5141)
* Update Jenkins script.
2019-12-21 11:00:21 +08:00
Jiaming Yuan e521bb6f83 Added new train_folds parameter (#5114)
https://stackoverflow.com/questions/32433458/how-to-specify-train-and-test-indices-for-xgb-cv-in-r-package-xgboost/51412073
2019-12-19 15:02:19 +01:00
Jiaming Yuan 27b3646d29 Tests and documents for new JSON routines. (#5120) 2019-12-18 08:44:27 +08:00
Jiaming Yuan 63ffd2f686 Check against R seed. (#5125)
* Handle it in R instead.
2019-12-17 19:14:59 +08:00
Jiaming Yuan 2fdb34ed2e Fix metric name loading. (#5122) 2019-12-16 10:14:02 +08:00
Jiaming Yuan 3136185bc5 JSON configuration IO. (#5111)
* Add saving/loading JSON configuration.
* Implement Python pickle interface with new IO routines.
* Basic tests for training continuation.
2019-12-15 17:31:53 +08:00
Jiaming Yuan ad4a1c732c Small refinements for JSON model. (#5112)
* Naming consistency.

* Remove duplicated test.
2019-12-11 19:49:01 +08:00
Jiaming Yuan 208ab3b1ff Model IO in JSON. (#5110) 2019-12-11 11:20:40 +08:00
Jiaming Yuan e089e16e3d Pass pointer to model parameters. (#5101)
* Pass pointer to model parameters.

This PR de-duplicates most of the model parameters except the one in
`tree_model.h`.  One difficulty is `base_score` is a model property but can be
changed at runtime by objective function.  Hence when performing model IO, we
need to save the one provided by users, instead of the one transformed by
objective.  Here we created an immutable version of `LearnerModelParam` that
represents the value of model parameter after configuration.
2019-12-10 12:11:22 +08:00
Jiaming Yuan 1cb6bcc382 Remove dead code in colmaker. (#5105) 2019-12-10 09:32:37 +08:00
Jiaming Yuan 38763aa4fa Update document for tree_method. [skip ci] (#5106) 2019-12-09 22:55:00 +08:00
Jiaming Yuan 608ebbe444 Fix GPU ID and prediction cache from pickle (#5086)
* Hack for saving GPU ID.

* Declare prediction cache on GBTree.

* Add a simple test.

* Add `auto` option for GPU Predictor.
2019-12-07 16:02:06 +08:00
Jiaming Yuan 7ef5b78003 Implement JSON IO for updaters (#5094)
* Implement JSON IO for updaters.

* Remove parameters in split evaluator.
2019-12-07 00:24:00 +08:00
Jiaming Yuan 2dcb62ddfb Add IO utilities. (#5091)
* Add fixed size stream for reading model stream.
* Add file extension.
2019-12-05 22:15:34 +08:00
Jiaming Yuan 64af1ecf86 [Breaking] Remove num roots. (#5059) 2019-12-05 21:58:43 +08:00
Jiaming Yuan f3d8536702 Don't use 0 for "fresh leaf". (#5084)
* Allow using right child as marker for Exact tree_method.
2019-12-05 11:50:51 +08:00
Jiaming Yuan df9bdbbcb9 Fix parsing empty vector in parameter. (#5087) 2019-12-05 11:42:01 +08:00
Jiaming Yuan f5e13dcb9b Implement training observer. (#5088) 2019-12-05 11:12:20 +08:00
Jiaming Yuan f0ca53d9ec Convenient methods for JSON integer. (#5089)
* Fix parsing empty object.
2019-12-05 11:01:12 +08:00
Jiaming Yuan 761e938dbe Support dask dataframe as y for classifier. (#5077)
* Support dask dataframe as y for classifier.

* Lint.
2019-12-02 11:53:30 +08:00
Jiaming Yuan 9f52e834dc [doc] Some notes for external memory. (#5065) 2019-11-26 00:22:02 +08:00
Jiaming Yuan d667ea9335 [CI] Fix Travis tests. (#5062)
- Install wget explicitly to match openssl.
- Install CMake explicitly.
- Use newer miniconda link.
- Reenable unittests.
- gcc@9 + xcode@10 for osx due to missing <_stdio.h>.  Other versions of gcc should also work.  But as homebrew pour gcc@9 after update by default, so I just stick with latest version.
- Disabled one external memory test for OSX.  Not sure about the thread implementation in there and fixing external memory is beyond the scope of this PR.
- Use Python3 with conda in jvm package.
2019-11-25 03:32:10 +08:00
Jiaming Yuan 04c640f562 Add cuDF DataFrame to doc. (#5053) 2019-11-19 18:29:40 +08:00
Jiaming Yuan a4f5c86276 Allow using RandomState object from Numpy in sklearn interface. (#5049) 2019-11-19 10:56:39 +08:00
Jiaming Yuan 98b051269b Assert dask client at early stage. (#5048) 2019-11-19 10:55:26 +08:00
Jiaming Yuan 97abcc7ee2 Extract interaction constraint from split evaluator. (#5034)
*  Extract interaction constraints from split evaluator.

The reason for doing so is mostly for model IO, where num_feature and interaction_constraints are copied in split evaluator. Also interaction constraint by itself is a feature selector, acting like column sampler and it's inefficient to bury it deep in the evaluator chain. Lastly removing one another copied parameter is a win.

*  Enable inc for approx tree method.

As now the implementation is spited up from evaluator class, it's also enabled for approx method.

*  Removing obsoleted code in colmaker.

They are never documented nor actually used in real world. Also there isn't a single test for those code blocks.

*  Unifying the types used for row and column.

As the size of input dataset is marching to billion, incorrect use of int is subject to overflow, also singed integer overflow is undefined behaviour. This PR starts the procedure for unifying used index type to unsigned integers. There's optimization that can utilize this undefined behaviour, but after some testings I don't see the optimization is beneficial to XGBoost.
2019-11-14 20:11:41 +08:00
Jiaming Yuan 7663de956c Run training with empty DMatrix. (#4990)
This makes GPU Hist robust in distributed environment as some workers might not
be associated with any data in either training or evaluation.

* Disable rabit mock test for now: See #5012 .

* Disable dask-cudf test at prediction for now: See #5003

* Launch dask job for all workers despite they might not have any data.
* Check 0 rows in elementwise evaluation metrics.

   Using AUC and AUC-PR still throws an error.  See #4663 for a robust fix.

* Add tests for edge cases.
* Add `LaunchKernel` wrapper handling zero sized grid.
* Move some parts of allreducer into a cu file.
* Don't validate feature names when the booster is empty.

* Sync number of columns in DMatrix.

  As num_feature is required to be the same across all workers in data split
  mode.

* Filtering in dask interface now by default syncs all booster that's not
empty, instead of using rank 0.

* Fix Jenkins' GPU tests.

* Install dask-cuda from source in Jenkins' test.

  Now all tests are actually running.

* Restore GPU Hist tree synchronization test.

* Check UUID of running devices.

  The check is only performed on CUDA version >= 10.x, as 9.x doesn't have UUID field.

* Fix CMake policy and project variables.

  Use xgboost_SOURCE_DIR uniformly, add policy for CMake >= 3.13.

* Fix copying data to CPU

* Fix race condition in cpu predictor.

* Fix duplicated DMatrix construction.

* Don't download extra nccl in CI script.
2019-11-06 16:13:13 +08:00
Jiaming Yuan 6fac40cfb4 Add asan.so.5 to cmake script. (#4999) 2019-10-30 16:03:23 -04:00
Jiaming Yuan 755a606201 Fix dart usegpu. (#4984) 2019-10-28 06:12:04 -04:00
Jiaming Yuan 6ec7e300bd Fix external memory race in colmaker. (#4980)
* Move `GetColDensity` out of omp parallel block.
2019-10-25 04:11:13 -04:00
Jiaming Yuan ac457c56a2 Use `UpdateAllowUnknown' for non-model related parameter. (#4961)
* Use `UpdateAllowUnknown' for non-model related parameter.

Model parameter can not pack an additional boolean value due to binary IO
format.  This commit deals only with non-model related parameter configuration.

* Add tidy command line arg for use-dmlc-gtest.
2019-10-23 05:50:12 -04:00
Jiaming Yuan f24be2efb4 Use configure_file() to configure version only (#4974)
* Avoid writing build_config.h

* Remove build_config.h all together.

* Lint.
2019-10-22 23:47:00 -07:00
Jiaming Yuan 5620322a48 [Breaking] Add global versioning. (#4936)
* Use CMake config file for representing version.

* Generate c and Python version file with CMake.

The generated file is written into source tree.  But unless XGBoost upgrades
its version, there will be no actual modification.  This retains compatibility
with Makefiles for R.

* Add XGBoost version the DMatrix binaries.
* Simplify prefetch detection in CMakeLists.txt
2019-10-22 23:27:26 -04:00
Jiaming Yuan 7e477a2adb Fix data loading (#4862)
* Fix loading text data.
* Fix config regex.
* Try to explain the error better in exception.
* Update doc.
2019-10-22 12:33:14 -04:00
Jiaming Yuan 4771bb0d41 Catch exception in transform function omp context. (#4960) 2019-10-21 17:03:38 +08:00
Jiaming Yuan 010b8f1428 Revert "[jvm-packages] update rabit, surface new changes to spark, add parity and failure tests (#4876)" (#4965)
This reverts commit 86ed01c4bb.
2019-10-18 14:02:35 -07:00
Jiaming Yuan 31030a8d3a Set correct file permission. (#4964) 2019-10-18 12:54:29 -04:00
Jiaming Yuan ae536756ae Add Model and Configurable interface. (#4945)
* Apply Configurable to objective functions.
* Apply Model to Learner and Regtree, gbm.
* Add Load/SaveConfig to objs.
* Refactor obj tests to use smart pointer.
* Dummy methods for Save/Load Model.
2019-10-18 01:56:02 -04:00
Jiaming Yuan 9fc681001a Copy CMake parameter from dmlc-core. (#4948) 2019-10-17 23:46:32 -04:00
Jiaming Yuan 185e3f1916 Update GPU doc. (#4953) 2019-10-16 05:54:09 -04:00
Jiaming Yuan 7e72a12871 Don't set_params at the end of set_state. (#4947)
* Don't set_params at the end of set_state.

* Also fix another issue found in dask prediction.

* Add note about prediction.

Don't support other prediction modes at the moment.
2019-10-15 10:08:26 -04:00
Jiaming Yuan 2ebdec8aa6 Fix dask prediction. (#4941)
* Fix dask prediction.

* Add better error messages for wrong partition.
2019-10-14 23:19:34 -04:00
Jiaming Yuan b61d534472 Span: use size_t' for index_type, add front' and `back'. (#4935)
* Use `size_t' for index_type.  Add `front' and `back'.

* Remove a batch of `static_cast'.
2019-10-14 09:13:33 -04:00
Jiaming Yuan 0e0849fa1e Mention dask in readme. [skip ci] (#4942) 2019-10-14 03:44:08 -04:00
Jiaming Yuan 3d46bd0fa5 Ignore columnar alignment requirement. (#4928)
* Better error message for wrong type.
* Fix stride size.
2019-10-13 06:41:43 -04:00
Jiaming Yuan 4bbf062ed3 [Breaking] Update sklearn interface. (#4929)
* Remove nthread, seed, silent. Add tree_method, gpu_id, num_parallel_tree. Fix #4909.
* Check data shape. Fix #4896.
* Check element of eval_set is tuple. Fix #4875
*  Add doc for random_state with hogwild. Fixes #4919
2019-10-12 02:50:09 -04:00
Jiaming Yuan c2cce4fac3 Update dmlc-core. (#4924)
* Fixed some threading errors.
* Allow updating parameters.
2019-10-09 23:16:45 -04:00
Jiaming Yuan 6c9b6f11da Use cudf.concat explicitly. (#4918)
* Use `cudf.concat` explicitly.

* Add test.
2019-10-10 16:02:10 +13:00
Jiaming YuanandPhilip Hyunsu Cho 095de3bf5f Export c++ headers in CMake installation. (#4897)
* Move get transpose into cc.

* Clean up headers in host device vector, remove thrust dependency.

* Move span and host device vector into public.

* Install c++ headers.

* Short notes for c and c++.

Co-Authored-By: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
2019-10-06 23:53:09 -04:00
Jiaming Yuan 4ab1df5fe6 Check deprecated n_gpus. (#4908) 2019-10-02 02:05:14 -04:00
Jiaming Yuan 7e24a8d245 Improve doc and demo for dask. (#4907)
* Add a readme with link to doc.
* Add more comments in the demonstrations code.
* Workaround https://github.com/dask/distributed/issues/3081 .
2019-09-30 23:59:37 -04:00
Jiaming Yuan d30e63a0a5 Support feature names/types for cudf. (#4902)
* Implement most of the pandas procedure for cudf except for type conversion.
* Requires an array of interfaces in metainfo.
2019-09-29 15:07:51 -04:00
Jiaming Yuan b8433c455a Rewrite Dask interface. (#4819) 2019-09-25 01:30:14 -04:00
Jiaming Yuan 0b89cd1dfa Support gamma in GPU_Hist. (#4874)
* Just prevent building the tree instead of using an explicit pruner.
2019-09-24 10:16:08 +08:00
Jiaming Yuan a40b72d127 Workaround isnan across different environments. (#4883) 2019-09-23 21:34:27 -04:00
Jiaming Yuan c7416002e9 Fix DMatrix doc. (#4884) 2019-09-23 01:55:04 -04:00
Jiaming Yuan 57106a3459 Fix parsing empty json object. (#4868)
* Fix parsing empty json object.

* Better error message.
2019-09-18 03:31:46 -04:00
Jiaming Yuan d669ea1eaa Deprecate set group (#4864)
* Convert jvm package and R package.

* Restore for compatibility.
2019-09-17 21:26:54 -04:00
Jiaming Yuan 5374f52531 Complete cudf support. (#4850)
* Handles missing value.
* Accept all floating point and integer types.
* Move to cudf 9.0 API.
* Remove requirement on `null_count`.
* Arbitrary column types support.
2019-09-16 23:52:00 -04:00
Jiaming Yuan 6a5e805886 Add n_jobs as an alias of nthread. (#4842) 2019-09-09 19:57:12 -04:00
Jiaming Yuan f90e7f9aa8 Some comments for row partitioner. (#4832) 2019-09-06 03:01:42 -04:00
Jiaming Yuan a5f232feb8 Fix calling GPU predictor (#4836)
* Fix calling GPU predictor
2019-09-05 19:09:38 -04:00
Jiaming Yuan 52d44e07fe monitor for distributed envorinment. (#4829)
* Collect statistics from other ranks in monitor.

* Workaround old GCC bug.
2019-09-05 13:18:09 +08:00
Jiaming Yuan c0fbeff0ab Restrict access to cfg_ in gbm. (#4801)
* Restrict access to `cfg_` in gbm.

* Verify having correct updaters.

* Remove `grow_global_histmaker`

This updater is the same as `grow_histmaker`.  The former is not in our
document so we just remove it.
2019-09-02 00:43:19 -04:00
Jiaming Yuan 6e6216ad67 Skip related tests when sklearn is not installed. (#4791) 2019-08-21 00:32:52 -04:00
Jiaming Yuan fba298fecb Prevent copying data to host. (#4795) 2019-08-20 23:06:27 -04:00
Jiaming Yuan 3fa2ceb193 Add self. (#4794) 2019-08-20 14:41:30 +08:00
Jiaming Yuan 9700776597 Cudf support. (#4745)
* Initial support for cudf integration.

* Add two C APIs for consuming data and metainfo.

* Add CopyFrom for SimpleCSRSource as a generic function to consume the data.

* Add FromDeviceColumnar for consuming device data.

* Add new MetaInfo::SetInfo for consuming label, weight etc.
2019-08-19 16:51:40 +12:00