Repository navigation
Closed
Description
Trying to find an older version of distributed that is not too buggy, having trouble.
rapids 0.14 pairs with 2.17 dask/disributed.
But 2.17 hits #3851
Tried 2.18 as suggested there, but 2.18 hits below even for most basic test when have 2 GPUs.
Any thoughts? I can't go to 2.27 used by rapids 0.14 because that causes many rapids tests to fail.
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
from dask import dataframe as dd
import xgboost as xgb
def main(client):
dask_df = dd.read_csv('creditcard.csv')
target = 'default payment next month'
y = dask_df['default payment next month']
X = dask_df[dask_df.columns.difference([target])]
dtrain = xgb.dask.DaskDMatrix(client, X, y)
output = xgb.dask.train(client,
# Use GPU training algorithm
{'tree_method': 'gpu_hist'},
dtrain,
num_boost_round=100,
evals=[(dtrain, 'train')])
booster = output['booster'] # booster is the trained model
history = output['history'] # A dictionary containing evaluation results
# Save the model to file
booster.save_model('xgboost-model')
print('Training evaluation history:', history)
if __name__ == '__main__':
# `LocalCUDACluster` is used for assigning GPU to XGBoost
# processes. Here `n_workers` represents the number of GPUs
# since we use one GPU per worker process.
with LocalCUDACluster(n_workers=2) as cluster:
with Client(cluster) as client:
main(client)
(base) jon@mr-dl10:/data/jon/h2oai.fullcondatest3$ python dask_cudf_example.py
distributed.nanny - ERROR - Failed to start worker
Traceback (most recent call last):
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/nanny.py", line 758, in run
await worker
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/core.py", line 236, in _
await self.start()
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/worker.py", line 1085, in start
await self._register_with_scheduler()
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/worker.py", line 811, in _register_with_scheduler
types={k: typename(v) for k, v in self.data.items()},
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/worker.py", line 811, in <dictcomp>
types={k: typename(v) for k, v in self.data.items()},
File "/home/jon/minicondadai/lib/python3.6/_collections_abc.py", line 744, in __iter__
yield (key, self._mapping[key])
File "/home/jon/minicondadai/lib/python3.6/site-packages/dask_cuda/device_host_file.py", line 150, in __getitem__
return self.host_buffer[key]
File "/home/jon/minicondadai/lib/python3.6/site-packages/zict/buffer.py", line 78, in __getitem__
return self.slow_to_fast(key)
File "/home/jon/minicondadai/lib/python3.6/site-packages/zict/buffer.py", line 65, in slow_to_fast
value = self.slow[key]
File "/home/jon/minicondadai/lib/python3.6/site-packages/zict/func.py", line 38, in __getitem__
return self.load(self.d[key])
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/protocol/serialize.py", line 505, in deserialize_bytes
frames = merge_frames(header, frames)
File "/home/jon/minicondadai/lib/python3.6/site-packages/distributed/protocol/utils.py", line 60, in merge_frames
lengths = list(header["lengths"])
KeyError: 'lengths'
Metadata
Metadata
Assignees
Labels
No labels
Activity
pseudotensor commentedon Dec 4, 2020
I'm going to try 2.19, but I'm running out of options.
pseudotensor commentedon Dec 4, 2020
I guess general question, that I can't infer, is should I be able to use latest dask/distributed with old rapids 0.14? Are there breaking changes so that rapids would no longer work? Was I just horribly unlucky with rapids0.15's dask/distributed 2.27?
quasiben commentedon Dec 4, 2020
What prevents you from going to latest releases of Dask/Distributed/RAPIDS ?
mrocklin commentedon Dec 4, 2020
Hi @pseudotensor ! Thanks for your issue, I'm glad to see that RAPIDS folks have found it and are responding.
Also, while I'm sure it wasn't intentional, comments like these can come across with a negative tone. As I'm sure you know, Dask is maintained by a broad set of people, many of whom work for free. Negative comments on public/free issue trackers are a common source of maintainer burnout. Again, I'm sure that this wasn't intentional, but it's maybe something to be aware of in the future.
Cheers!
pseudotensor commentedon Dec 4, 2020
Can't use python 3.8 yet, and building rapiids stuff from scratch is not actually easy.
pseudotensor commentedon Dec 4, 2020
Why would it be surprising that old versions of dask have bugs? Every software has bugs. I was quite explicit in my goal, to use an old version of distributed that avoided particular errors. I gave a full repro for my case (which means 2.18 as far as local cluster is not workable at all unlike 2.17 that only has issues with pickle with large data), and also explained my reasoning regarding breaking changes and wondering if I could just use latest without concerns.
quasiben commentedon Dec 4, 2020
There is broad support for Python 3.7. Are pinned to something earlier ?
pseudotensor commentedon Dec 4, 2020
Yes, sorry, I should be explicit. We are using python 3.6. We plan to update to 3.8 soon, but it's taking time as many things have to change (3.7 wouldn't help in that regard).
quasiben commentedon Dec 4, 2020
To answer your question:
I would not expect latest dask/distributed to work that far back as a lot of changes occurred in the serialization layers between Dask and RAPIDS. The errors you posted a probably a result of those changes. @jakirkham do you have any thoughts here ?
pseudotensor commentedon Dec 4, 2020
Ok thanks. I only encounter it with >=2 GPUs BTW. On single GPU system never happens.
Is it possible I could patch 2.17 to avoid the original #3851 problem? I only encounter it when data gets large than about 2GB. I'm guessing that distributed switches to protocol 5 and that's when one hits that error. I see some work-around in the issue #3851 (comment), which I can try. I'm happy to also patch things if it's clear how to just fix that buffers problem.
I can hunt through the PRs etc. for the fix, but any guidance is welcome.
Thanks!
pseudotensor commentedon Dec 4, 2020
Thanks @quasiben for being super responsive and helpful!
jakirkham commentedon Dec 4, 2020
There were a lot of changes related to cuDF serialization that didn't land until RAPIDS 0.15. So an older version may work, but also wouldn't be surprised to see issues crop up.
Is there a reason that upgrading is not an option?
pseudotensor commentedon Dec 4, 2020
Ya I mentioned above I cannot upgrade yet. I'm on python 3.6 etc. see above.
Main question is if the buffers issue in 2.17 can be patched or worked around. Otherwise 2.17 has been quite stable with rapids 0.14
quasiben commentedon Dec 4, 2020
I think it would be a large undertaking to patch/work around
jakirkham commentedon Dec 4, 2020
Maybe one way around this would be to copy these two files from 0.15 into 0.14 in cuDF. I think that should work, but won't make any promises here.
https://github.com/rapidsai/cudf/blob/v0.15.0/python/cudf/cudf/core/abc.py
https://github.com/rapidsai/cudf/blob/v0.15.0/python/cudf/cudf/core/buffer.py
Would be good to understand whether bumping the Python version could be an option for you or what may block it.
11 remaining items
pseudotensor commentedon Dec 5, 2020
@jakirkham Here is repro:
rapidsai/dask-cuda#467
If you can tell where "storage" is coming from and why this is requiring "buffers" code path that would be good. The cache file is only 88MB, so it's not a size issue.
But in general, what packages are conditionally required by dask/distributed for some code paths? You seem to be saying above I need pickle5 or python 3.8 instead, which would be news to me regarding dask/distributed/rapids requirements.
pseudotensor commentedon Dec 5, 2020
If buffers is not dask_cuda issue, what do I need to make sure distributed works? pickle5 did not work, and is that really a requirement that is not explicit for dask/distributed? i.e. some package you should install if you want to do big data? Did I not RTFM? I real alot of dask docs etc. and I never noticed.
pseudotensor commentedon Dec 5, 2020
Here is debug view of the variable state. It shows the pickler was pickle, there just is 2 buffers. The pickle.py pickle dumps must be doing something wrong in distributed sometimes.
i.e. how can distributed be using pickle yet have a buffer "count" of 2? That will cause the buffers to be passed.
pseudotensor commentedon Dec 5, 2020
E.g. this function:
seems to append frames if memoryview(f) call_back gives non-None result, which it must have.
And then pickle.py dumps() must have not cleared the buffer. FYI the bare exceptions are pretty bad in that function:
pseudotensor commentedon Dec 5, 2020
FYI if I replace all instances of pickle package imports (i.e. import pickle or from pickle import ...) with import pickle5 as pickle etc. then I get different error:
At least in 2.17, I don't see handling of pickle5, only native pickle that would only apply for python 3.8
jakirkham commentedon Dec 7, 2020
Would make sure that Dask and Distributed are up-to-date. Also would make sure a recent version of Cloudpickle is installed. Finally would double check that the environment used by the Client, Workers, and Scheduler all have Cloudpickle and Pickle5. After doing all of that, it may be worth running
client.get_versions(check=True)just to make sure everything is installed as expected.pseudotensor commentedon Dec 7, 2020
As I mentioned import pickle is still in 2.17 code importing old pickle, not pickle5. Only later does distributed try import pickle5, so installing pickle5 has no effect.
jakirkham commentedon Dec 7, 2020
Sorry I don't follow. Thought
distributedwas being updated to a newer version. If not, I don't see a path forward here.pseudotensor commentedon Dec 7, 2020
rapids 0.14 was released with dask/distributed 2.17, but I guess it's possible it never worked, yes.
I would still be interested to know why distributed or cudf is sending buffers. I don't think rapids 0.16 setup with newer dask has pickle5 as dependency, so then only python 3.8 would work OOTB.
jakirkham commentedon Dec 7, 2020
Well it was released with 2.15+. Maybe trying one of the older versions works for you?
quasiben commentedon Dec 8, 2020
I think what we are seeing here is that it is indeed challenging to find patched version of dask/distributed working with an older version of RAPIDS. If you want to test exactly what was available during the 0.14 release you should use the 0.14 docker image . There you'll find dask/distributed 2.20.0
I'm not exactly sure where to go from here. Happy to find 30 minutes for us to chat so I/we can better understand what you are trying to accomplish but it's unlikely that we can help you find a patch for an older version of RAPIDS
pseudotensor commentedon Dec 8, 2020
I'm just asking how things work. I think the dask_cuda is using a spill-over to pickle and then dask is reading those files in, and distributed fails because dask_cuda wrote to disk files that inside have extra frames distributed interprets as buffers. That's what I have seen. In that case, it doesn't matter what version of distributed is used, even latest only tries pickle5 if it exists, and pickle5 is not a requirement OOTB AFAIK. Only python 3.8 would allow distributed to use protocol5.
pseudotensor commentedon Dec 9, 2020
Thanks @quasiben for pointing out docker was using 2.20.
pseudotensor commentedon Dec 9, 2020
I'll try to learn about the spill over myself since I understand people are busy. I know it happens when I use bigger data, and I'll just assume you guys hope it's fixed in later rapids/dask/distributed.