Skip to content

Add native support for Dask - #4473

Merged
RAMitchell merged 16 commits into
dmlc:masterfrom
RAMitchell:dask
May 27, 2019
Merged

RAMitchell merged 16 commits into
dmlc:masterfrom
RAMitchell:dask

Conversation

@RAMitchell

@RAMitchell RAMitchell commented May 15, 2019 •

Copy link
Copy Markdown
Member

There has been some discussion about integrating dask-xgboost into the main xgboost repository (dask/dask-xgboost#39). This will make maintenance/packaging easier and ensure the documentation lives in the same place.

I have taken a different approach to the integration than the original dask-xgboost, which completely wraps everything into a new API. I have instead provided helper functions for launching dask workers. Workers launched in this way are automatically connected via rabit and may perform distributed training.

I believe this approach is very flexible as we do not need to modify the existing xgboost python API in any way, we just call these functions using the dask launcher. This approach was also extremely lightweight in terms of code.

See the demo for a worked example.

TODO:

  • Add python tests
  • Provide multi-GPU demo
  • Possibly support sklearn APIs

@mrocklin @mt-jones @TomAugspurger

@mrocklin mrocklin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for doing this @RAMitchell . I've added some small comments below. In particular I'm curious about your thoughts on the .partitions[...].compute() bits. I think it would be useful if xgboost didn't have to think about concatenation (this gets messy with cudf).

Comment thread python-package/xgboost/compat.py Resolved
Comment thread python-package/xgboost/dask.py Outdated
if isinstance(data[0], (pd.DataFrame, pd.Series)):
return pd.concat(data, axis=0)
if isinstance(data[0], (DataFrame, pandas.Series)):
return pandas.concat(data, axis=0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When using libraries like cudf, which are pandas-like, we've found that explicit type checks can be difficult to work around. For functions like concat we've started using dispatchable functions, which downstream libraries can implement on their own to add support for their library without us having to explicitly whitelist them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, Python style nit. For private functions I've more often seen a single underscore prefix rather than double-underscore.

I'm not that engaged with the xgboost codebase though. This may be how you all do things and I suspect that there is good reason for it. Just thought I'd mention it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree. We should avoid isinstance checks. These patterns are difficult to maintain.

To provide an example from Dask where a concat method is registered against dask.dataframe.methods:

from dask.dataframe.methods import concat_dispatch

@concat_dispatch.register((MyDataFrame, MySeries, MyIndex))
def concat_pandas(dfs, axis=0, join='outer', uniform=False, filter_warning=True):
    ...

Docs: https://github.com/dask/dask/blob/0dbe40de09942c004d7b3bbe5a93b23897877cc4/docs/source/dataframe-extend.rst

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expanding on my note below. I think that ideally xgboost wouldn't need to have a concat function at all. I would hope that all of this code would go away.

Comment thread python-package/xgboost/dask.py Resolved
Comment thread python-package/xgboost/dask.py Outdated
raise ValueError("Dask data must have the same partitions")
# Get local partitions
partitions = [dd.partitions[i].compute() for i in
range(begin_partition, end_partition)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Calling .compute() multiple times in sequence is somewhat inefficient. It would be better to do something like ...

dask.compute([dd.partitions[i] for i in range(...)])

Or even better yet just slice into dd.partitions

dd.partitions[begin_partition:end_partition].compute()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This second approach would also remove the need to think about concatenation, which would remove a coordiantion point for libraries like cudf, which would now need to contend with how xgboost does things.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mrocklin can you provide more detail into what you mean, here? What coordination point are we removing by adopting this pattern, for example?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean that in the second code snippet in my comment above xgboost is handed a pre-concatenated dataframe. So while Dask still has to think about this, XGBoost doesn't have to. It's one less thing for cudf and xgboost devs to have to talk about. (or any other library author who wants to work with dask and xgboost together)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for clarifying. I certainly missed your point about avoiding an explicit call to concat.

Comment thread python-package/xgboost/dask.py Outdated
range(begin_partition, end_partition)]
if not partitions:
raise ValueError("Worker " + str(
rabit.get_rank()) + " has no data. Try using smaller partitions")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we err here, or just warn?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A warning seems more appropriate to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If one of the xgboost.train() calls has no data I believe it will just fail. I prefer to explicitly enforce all workers have data for now.

Comment thread python-package/xgboost/dask.py Resolved
Comment thread tests/ci_build/Dockerfile.cpu Resolved
Comment thread tests/python/test_with_dask.py Resolved
Comment thread tests/python/test_with_dask.py Resolved
Comment thread demo/dask/README.md Resolved
Comment thread demo/dask/dask_demo.py Resolved
@CodingCat

Copy link
Copy Markdown
Member

No objection on this PR for now (considering where xgboost is )

But one thing to think about is what is the criterion to determine if we have native support to some data processing framework

Do we want to support in https://github.com/modin-project/modin in future? Why we choose dask instead of modin?

(I am not a fan of modin, never used...)

Just something we have to be clear as the maintainer of the project @hcho3, @trivialfis

@mtjrider mtjrider left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My primary concern is ensuring that concatenate should be dispatched with Dask. This will make it much easier to support other data formats from other libraries.

Comment thread python-package/xgboost/dask.py Outdated
if isinstance(data[0], (pd.DataFrame, pd.Series)):
return pd.concat(data, axis=0)
if isinstance(data[0], (DataFrame, pandas.Series)):
return pandas.concat(data, axis=0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree. We should avoid isinstance checks. These patterns are difficult to maintain.

To provide an example from Dask where a concat method is registered against dask.dataframe.methods:

from dask.dataframe.methods import concat_dispatch

@concat_dispatch.register((MyDataFrame, MySeries, MyIndex))
def concat_pandas(dfs, axis=0, join='outer', uniform=False, filter_warning=True):
    ...

Docs: https://github.com/dask/dask/blob/0dbe40de09942c004d7b3bbe5a93b23897877cc4/docs/source/dataframe-extend.rst

Comment thread python-package/xgboost/dask.py Outdated
raise ValueError("Dask data must have the same partitions")
# Get local partitions
partitions = [dd.partitions[i].compute() for i in
range(begin_partition, end_partition)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mrocklin can you provide more detail into what you mean, here? What coordination point are we removing by adopting this pattern, for example?

Comment thread python-package/xgboost/dask.py Outdated
range(begin_partition, end_partition)]
if not partitions:
raise ValueError("Worker " + str(
rabit.get_rank()) + " has no data. Try using smaller partitions")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A warning seems more appropriate to me.

@CodingCat

CodingCat commented May 16, 2019 •

Copy link
Copy Markdown
Member

@CodingCat

Do we want to support in https://github.com/modin-project/modin in future?

Not quite understand what's the advantage of using pandas: https://h2oai.github.io/db-benchmark/
There are also https://github.com/yandex/ClickHouse , https://github.com/rapidsai/cudf . Just dropping a few links...

@trivialfis

one of the biggest selling points of dask is it can scale pandas-styled analytics to distributed nodes, integrate Dask with XGB is also beneficial because we can have a seamless data preparation and distributed model training in python now

my point is just based on the links you posted, what's the criterion to judge we should make native support of Dask, instead of any other one of them? or in future, ClickHouse's person come and say they have a ClickHouse-ML library to work with XGBoost, do we want to integrate to XGB code base?

I think we should be clear about it instead of integrating for showing friend-ness. Otherwise, XGBoost is becoming a downstream library of many other projects (big burden for syncing versions, and most of projects without a company support are just going to die, at that point, do we want to clean code base by deleting code?)

@mtjrider

mtjrider commented May 16, 2019 •

Copy link
Copy Markdown
Contributor

@CodingCat @trivialfis

my point is just based on the links you posted, what's the criterion to judge we should make native support of Dask, instead of any other one of them? or in future, ClickHouse's person come and say they have a ClickHouse-ML library to work with XGBoost, do we want to integrate to XGB code base?

I think there are perhaps two feasible options:

  1. Refuse native integration for all such frameworks, and require that the code for interoperability live in that native framework. This would require XGBoost to adopt a specification for data ingest/egress so that external frameworks could properly dispatch their data into XGBoost.
  2. Allow for native integration of external frameworks into XGBoost with a caveat: that the contributor associated with the interoperability layer for that framework maintain the that layer within XGBoost for all time; else, that code will face inevitable deprecation and removal. A criterion can be established for what "maintain" means in this case.

In either case, the onus for developing and maintaining the interoperability (contractual) interface should fall to the native framework contributor.

I think we should be clear about it instead of integrating for showing friend-ness. Otherwise, XGBoost is becoming a downstream library of many other projects (big burden for syncing versions, and most of projects without a company support are just going to die, at that point, do we want to clean code base by deleting code?)

Regardless of what is done, I think code rot is inevitable. Deleting old code, and redesigning components regularly seems natural. I'm not sure if I've missed your point, though(?) If you're suggesting that XGBoost remove all interface-related code in favor of a single standard, I think that's a great idea.

Such an interface should be capable of dispatching types. For example, if you chose to integrate with Dask, you could design a conversion dispatcher for XGBoost, and people that wanted to design an interoperability layer with another layer could simply (with some care) register a source-to-target converter much like concatenation is done. Like (1), I think this requires XGBoost specify more formally an internal data structure so that the process of building these methods in other frameworks is simpler.

@CodingCat

CodingCat commented May 16, 2019 •

Copy link
Copy Markdown
Member

Regardless of what is done, I think code rot is inevitable. Deleting old code, and redesigning components regularly seems natural. I'm not sure if I've missed your point, though(?)

let's imagine that we integrated with Hadoop's MapReduce years ago, at this time point, shall we still support that considering the current status of MapReduce project? most of users are moving to Spark, but some users are happily using XGBoost-MapReduce....or a living example is XGBoost-Flink, I am seriously considering if we want to bring it to XGBoost 1.0, AFAIK, Flink-Batch has a small but existing group of users, XGBoost-Flink itself is lack of maintenance for a while... and Flink's father company is bought by Alibaba now which makes many guesses to the future of project.....

support => continuous burden

not support => some users left XGBoost community

@mtjrider

Copy link
Copy Markdown
Contributor

I see. Is the proposition for 1.0 to simply drop all such code and avoid the maintenance burden? Or is this being weighed against lost communities?

@CodingCat

Copy link
Copy Markdown
Member

1.0 is more about a milestone of XGBoost's functionality and performance, but it's also a good chance to drop burdens if necessary...

@mtjrider

Copy link
Copy Markdown
Contributor

1.0 is more about a milestone of XGBoost's functionality and performance, but it's also a good chance to drop burdens if necessary...

Agree. So, correct me if I’m wrong, but your original question was more about how to define a burden. Yes?

@RAMitchell

Copy link
Copy Markdown
Member Author

@CodingCat very good points. I guess my justification for including dask is that it gives us a vehicle to launch distributed GPU algorithms, given that spark is not currently ready for this. As an active maintainer I am prepared to deal with this, especially given the relatively low overhead. Maybe we need a more well defined criteria for deprecating support for other frameworks.

@CodingCat

Copy link
Copy Markdown
Member

1.0 is more about a milestone of XGBoost's functionality and performance, but it's also a good chance to drop burdens if necessary...

Agree. So, correct me if I’m wrong, but your original question was more about how to define a burden. Yes?

hmmmmm...........not exactly....burden comes from any integration, XGBoost-Spark also brings burden, we waited for more than 1 week for 2.4.3 release to mark XGBoost 0.9 is ready to go. But obviously, the original idea to bring XGBoost4J-Spark to XGBoost is a right one as it pushes XGBoost to production environment significantly.

I think my question is about the criterion for tradeoff between burden and benefits to XGBoost.

@CodingCat

CodingCat commented May 17, 2019 •

Copy link
Copy Markdown
Member

@CodingCat very good points. I guess my justification for including dask is that it gives us a vehicle to launch distributed GPU algorithms, given that spark is not currently ready for this. As an active maintainer I am prepared to deal with this, especially given the relatively low overhead. Maybe we need a more well defined criteria for deprecating support for other frameworks.

agree, I think distributed GPU makes efforts on Dask more valuable instead of just bringing Dask here....

Maybe we need a more well defined criteria for deprecating support for other frameworks.

also agree, I am drafting several documents for the community and I will ensure this is covered and bring it to discussion (and we should also discuss when to bring a support on a new framework)

@mrocklin

Copy link
Copy Markdown
Contributor

I think my question is about the criterion for tradeoff between burden and benefits to XGBoost.

For what it's worth I totally understand the concerns around building connections to an external library inside of a core codebase. In maintaining Dask we've been pretty conservative about what is allowed in core, what gets imported by default, and so on. As a maintainer it's a hard decision to make.

I don't maintain XGBoost, and I'm obviously biased towards Dask, so please don't trust anything I say here, but here are my thoughts.

  • Dask was intentionally designed to be infrastructure for other libraries and as such is fairly lightweight. The core of the project is Pure Python and stdlib only (though to be clear, you're relying on more than core here).
  • Other projects of similar size, like Scikit-Learn, maintain dask-specific connections in their codebases (well, in this case it's in joblib, which is a core component of Scikit-Learn)
  • The design that @RAMitchell has proposed intentionally has a very small surface area, and depends only on very mature APIs, so I would not expect the maintenance burden to be high, even if the two libraries undergo a lot of API churn (which seems unlikely at this stage of maturity)
  • In this case you do have @RAMitchell around to handle the maintenance

However

  • If you can easily avoid it I wouldn't import dask by default as this PR currently does.

@RAMitchell

Copy link
Copy Markdown
Member Author

Another question here is should we be able to return the predictions as a distributed object? If we know the return type for the train function is always some local data collection (numpy/pandas) we can package it into a distributed dataframe. Not sure how this works if the user wants to return other types of objects.

@mrocklin

Copy link
Copy Markdown
Contributor

If you do something like the following:

result = df.map_partitions(local_predict_function)  # dataframe
result = x.map_blocks(local_predict_function) # array

Then Dask will figure out the correct parallel type regardless of what the user's predict function returns.

Would that solve things?

@RAMitchell

Copy link
Copy Markdown
Member Author

Tests are currently failing on CI but passing on my local machine. Maybe something to do with the permissions of the docker environment and the need for dask to read/write temporary files.

I have decided not to try to return dask objects from the run function at this time. Users may want to return multiple objects or objects of different types and it is not obvious to me how to cleanly handle this, so I will leave it to the user to concatenate their results back together.

This is ready for another review @mrocklin @mt-jones .

@mrocklin

Copy link
Copy Markdown
Contributor
_________________________ ERROR at setup of test_train _________________________
file /Users/travis/build/dmlc/xgboost/tests/python/test_with_dask.py, line 25
  def test_train(client):
E       fixture 'client' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

This seems to be an import error? Perhaps this line isn't imported?

https://github.com/dmlc/xgboost/pull/4473/files#diff-bc381ee4ba446c889bda3fa1032f9a5dR7

@mrocklin

Copy link
Copy Markdown
Contributor
> [2019-05-20T02:33:56.685Z] 

[2019-05-20T02:33:56.685Z] >   raise Exception(response["text"])

[2019-05-20T02:33:56.685Z] E   Exception: I/O operation on closed file

[2019-05-20T02:33:56.685Z] 

[2019-05-20T02:33:56.685Z] /opt/python/lib/python3.7/site-packages/distributed/core.py:550: Exception

That error is a bit odd. It's also coming through as text rather than as a proper traceback meaning that Python wasn't able to serialize the exception (perhaps because it had a file handle?)

Can you try a test that just starts a Dask client and then does a trivial amount of work with it so that we can isolate this between Dask-on-this-CI and Dask+XGBoost-on-this-CI?

Maybe something like this:

def test_dask(client):
    assert client.submit(lambda x: x + 1, 10).result() == 11

@RAMitchell

Copy link
Copy Markdown
Member Author
distributed.protocol.pickle - INFO - Failed to deserialize b'\x80\x04\x95#\x00\x00\x00\x00\x00\x00\x00\x8c\x0cxgboost.dask\x94\x8c\x0e_start_tracker\x94\x93\x94.'
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/site-packages/distributed/protocol/pickle.py", line 61, in loads
    return pickle.loads(x)
  File "/opt/python/lib/python3.7/site-packages/xgboost-0.83.dev0-py3.7.egg/xgboost/__init__.py", line 11, in <module>
    from .core import DMatrix, Booster
  File "/opt/python/lib/python3.7/site-packages/xgboost-0.83.dev0-py3.7.egg/xgboost/core.py", line 22, in <module>
    from .compat import (STRING_TYPES, PY3, DataFrame, MultiIndex, py_str,
  File "/opt/python/lib/python3.7/site-packages/xgboost-0.83.dev0-py3.7.egg/xgboost/compat.py", line 47, in <module>
    import datatable.Frame as DataTable
  File "/opt/python/lib/python3.7/site-packages/datatable/__init__.py", line 8, in <module>
    from .dt_append import rbind, cbind
  File "/opt/python/lib/python3.7/site-packages/datatable/dt_append.py", line 8, in <module>
    from datatable.utils.misc import plural_form as plural
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/misc.py", line 8, in <module>
    from .typechecks import TImportError
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/typechecks.py", line 14, in <module>
    from datatable.utils.terminal import term
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/terminal.py", line 89, in <module>
    term = MyTerminal()
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/terminal.py", line 20, in __init__
    super().__init__()
  File "/opt/python/lib/python3.7/site-packages/blessed/terminal.py", line 171, in __init__
    self._keyboard_fd = sys.__stdin__.fileno()
ValueError: I/O operation on closed file
distributed.core - ERROR - I/O operation on closed file
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/site-packages/distributed/core.py", line 412, in handle_comm
    result = yield result
  File "/opt/python/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
    value = future.result()
  File "/opt/python/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper
    yielded = next(result)
  File "/opt/python/lib/python3.7/site-packages/distributed/worker.py", line 3245, in run
    function = pickle.loads(function)
  File "/opt/python/lib/python3.7/site-packages/distributed/protocol/pickle.py", line 61, in loads
    return pickle.loads(x)
  File "/opt/python/lib/python3.7/site-packages/xgboost-0.83.dev0-py3.7.egg/xgboost/__init__.py", line 11, in <module>
    from .core import DMatrix, Booster
  File "/opt/python/lib/python3.7/site-packages/xgboost-0.83.dev0-py3.7.egg/xgboost/core.py", line 22, in <module>
    from .compat import (STRING_TYPES, PY3, DataFrame, MultiIndex, py_str,
  File "/opt/python/lib/python3.7/site-packages/xgboost-0.83.dev0-py3.7.egg/xgboost/compat.py", line 47, in <module>
    import datatable.Frame as DataTable
  File "/opt/python/lib/python3.7/site-packages/datatable/__init__.py", line 8, in <module>
    from .dt_append import rbind, cbind
  File "/opt/python/lib/python3.7/site-packages/datatable/dt_append.py", line 8, in <module>
    from datatable.utils.misc import plural_form as plural
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/misc.py", line 8, in <module>
    from .typechecks import TImportError
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/typechecks.py", line 14, in <module>
    from datatable.utils.terminal import term
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/terminal.py", line 89, in <module>
    term = MyTerminal()
  File "/opt/python/lib/python3.7/site-packages/datatable/utils/terminal.py", line 20, in __init__
    super().__init__()
  File "/opt/python/lib/python3.7/site-packages/blessed/terminal.py", line 171, in __init__
    self._keyboard_fd = sys.__stdin__.fileno()
ValueError: I/O operation on closed file
distributed.core - ERROR - I/O operation on closed file

This error message actually goes away if we don't import datatable. @st-pasha can you comment on this?

@st-pasha

Copy link
Copy Markdown
Contributor

It appears the error is coming from the following line in module blessed (dependency for datatable):

sys.__stdin__.fileno()

I presume that somehow on your environment the __stdin__ stream is closed, which causes the exception. I've never seen this particular error before, but there's the first time for everything.

This is something that we could trivially fix in datatable (guard the use of blessed.Terminal with a try-catch block for example), but I'm not sure how urgent this problem is for you, and whether you'd be able to use the development version of datatable in your CI.
However, I believe the following workaround could do the trick: in the compat.py file before importing datatable add the following lines:

if sys.__stdin__.closed:
    sys.__stdin__ = None

we already test for the case when sys.__stdin__ is completely missing and avoid using blessed in that case.

@RAMitchell

RAMitchell commented May 21, 2019 •

Copy link
Copy Markdown
Member Author

Thanks @st-pasha for the quick response. I'm not much of a Python expert but wouldn't setting sys.__stdin__ = None have side-effects?

@st-pasha

Copy link
Copy Markdown
Contributor

The standard stdin channel for python is sys.stdin, so "normal" programs are expected to use that. The sys.__stdin__ is the "original" stdin, and according to docs should almost never be used (https://docs.python.org/3/library/sys.html#sys.__stdin__). The documentation even mentions that this variable could be None.

Of course, changing something at the sys level, even if this something is rarely used, is generally dangerous. However, in this case the sys.__stdin__ is removed only in the case when the channel was already closed, so it was in a "unusable" state anyways. So, in this case I don't think this could do any harm (unless there is a python program that doesn't take into account possibility of sys.__stdin__ being None, in which case it's better to fix that program anyways).

@RAMitchell RAMitchell changed the title [WIP] Add native support for Dask Add native support for Dask May 21, 2019
@RAMitchell

Copy link
Copy Markdown
Member Author

I am getting socket errors with rabit on Windows so will not support this platform at the moment.

@CodingCat

Copy link
Copy Markdown
Member

@cq ^^

@RAMitchell

Copy link
Copy Markdown
Member Author

@hcho3 So I have learned that setuptools packages xgboost in a completely different way on Windows - none of the source files get included. This means it does not contain the dmlc tracker scripts. The only solution I have that seems to make any sense is to add the tracker scripts as a package so they get included consistently in the right place.

@trivialfis trivialfis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@chyunsu3

chyunsu3 commented May 23, 2019 •

Copy link
Copy Markdown
Collaborator

@RAMitchell This is because symlinks are not supported in Windows. All source files are included in python-package directory as symlinks, and symlinks are silently ignored in Windows. One workaround is to have setup.py copy directories (use shutil).

@RAMitchell
RAMitchell merged commit 09b90d9 into dmlc:master May 27, 2019
@trivialfis trivialfis mentioned this pull request Jun 10, 2019
@RAMitchell RAMitchell mentioned this pull request Aug 14, 2019
3 of 5 tasks
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 25, 2019
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.

7 participants