Repository navigation
Conversation
|
Wow, it's great to see the 2x performance increase. We should definitely find a way to do this in-place drop call, however, I don't think that we can support it reliably within the Alternatively, is there a way within cudf to make |
Both Pandas and cudf have drop return by deep copy by default which is expensive, but we want to match the semantics. Currently the shuffle function isn't calling drop here, it's calling |
|
https://github.com/dask/dask/blob/master/dask/dataframe/core.py#L3296 This is the expensive line, could this use the |
|
In this particular situation yes, but in full generality, unfortunately not. |
|
Another option here would be to do this as an optimization pass. If we ever find a blockwise operation that has a drop in it where that operation is not affecting the input then we add the The downside of this is that high level optimizations are somewhat new, and so there aren't many examples on how to do them. The best example of this today is probably the df = dd.read_parquet(filename)
df = df[["x", "y"]]# becomes
df = dd.read_parquet(filename, columns=["x", "y"]) |
|
@rjzamora any interest in investigating dask dataframe optimizations? You would want to read through
Then you would want to construct an optimization which looked through all Blockwise layers, found any that had an This would force you to learn about the high level graph structure a bit more, and also into the guts of subgraph callables. |
Sounds good - Moving the |
|
Thanks! Please let me know if you get stuck. That whole code path is relatively new. |
|
FWIW, I feel the optimization pass will be super helpful across a bunch of more work-flows. In a lot of workflows, I use column selection to work around it but a general solution will go a long way in simplifying things for us. (Please suggest if a better way is there) n_rows = 50_000_000
n_cols = 20With dropdf = dask_cudf.from_cudf(cudf.DataFrame({str(i):np.ones(shape=n_rows) for i in range(0,n_cols)}),npartitions=2)
st = time.time()
df = df.drop(columns=['0'])
x = len(df)
et = time.time()
print(f" time = {et - st}")
del dfWith column selectiondf = dask_cudf.from_cudf(cudf.DataFrame({str(i):np.ones(shape=n_rows) for i in range(0,n_cols)}),npartitions=2)
st = time.time()
df = df[[str(i)for i in range(1,n_cols)]]
x = len(df)
et = time.time()
print(f" time = {et - st}")
del dfCC: @beckernick . |
|
That's a really motivating example @VibhuJawa ! Thanks. Yes, hopefully this helps other workloads. Additionally, I hope that after doing this in one case we build up enough familiarity that we can do it in other cases as they arise as well. |
|
@mrocklin - When parsing the layers of the high-level graph, the drop operations seem to have the generic |
|
Blockwise layers fuse everything into a single subgraph callable. You will need to dive within this subgraph callable object and look at its task graph (called I'd be more than happy to walk you through this over screenshare if you're interested. |
|
Created an issue to track this issue: #5664 |
Pandas' Dataframe support dropping a column in-place, which shuffle now uses.
Notice, cuDF will also support in-place drop: NVIDIA/cudf#3497
This PR doubles the performance of a distributed cuDF merge on a DGX1:
Before this PR (full copy)
After this PR (drop in-place)
cc @mrocklin