You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2024/11/16 20:13:49 UTC

[I] Fix scalability limitations of current implementation [datafusion-ray]

andygrove opened a new issue, #46:
URL: https://github.com/apache/datafusion-ray/issues/46

   Query execution works by building up a tree of futures to execute each partition in each query stage.
   
   The root node of each query stage is a `RayShuffleWriterExec`. It works by executing its child plan and fetching all of the results into memory (this is already not scalable because there could be millions or billions of rows). It then concatenates all of the batches into one large batch, which is returned. This large batch is then stored in Ray's object store and will be fetched by the next query stage.
   
   The original disk-based shuffle mechanism (that was removed in https://github.com/apache/datafusion-ray/pull/19) did not suffer from any of these issues because query results were streamed to disk in the writer and then streamed back out in the reader. However, this approach assumes that all workers have access to the same local file system.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2595955385

   Thanks for testing this out @robtandy!
   
   We know from experience in the Ballista and Comet projects that an Arrow Flight approach should work well, so let's hope it isn't too challenging to implement this here.
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2692353922

   I think that we can close this particular issue now. I am able to run benchmarks in a multi node setup. There is still more scalability work to do, but we can file specific issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "edmondop (via GitHub)" <gi...@apache.org>.
edmondop commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596108506

   > Great! Im in eastern time zone US. [<img alt="" width="16" height="16" src="https://avatars.githubusercontent.com/u/812841?s=64&amp;u=b8d2c42636347bbbbaedc6e9e6bb3cc45d790e2e&amp;v=4">@edmondop](https://github.com/edmondop) ? [<img alt="" width="16" height="16" src="https://avatars.githubusercontent.com/u/934084?s=64&amp;u=c341e576e9f3973b2d4a028f6c87fb0bbd28a914&amp;v=4">@andygrove](https://github.com/andygrove) ? This will be useful as I want to discuss in particular the approach to reusing the RepartitionExec's that I took and get feedback.
   
   Can you join the Discord channel where we can sync more easierly maybe?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2480806317

   One approach would be to bring back the original shuffle code and then add a mechanism for reading data from another node by implementing a gRPC based service (such as Arrow Flight protocol) in each worker.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596211654

   Joined!  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2595997573

   > We know from experience in the Ballista and Comet projects that an Arrow Flight approach should work well, so let's hope it isn't too challenging to implement this here.
   
   Minor correction: Comet does not use Flight, but the approach is similar. We stream batches to disk using Arrow IPC, and then the shuffle files (actually blocks from the files) are transferred to the reader.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2595948582

   I was able to refactor the code such that batches are exchanged in a streaming fashion through the ray object store.
   
   Its too slow though and struggles to scale when run on larger TPCH scale factors.  The heavy interaction between all stages and exchanging object refs pointing to batches is too much for Ray.  I would observe a typical TPCH query creating 10000+ ray tasks during its execution and the bottle neck appeared to the be the object store.  
   
   I'll refactor again trying to exchange data with Arrow Flight as you have suggested @andygrove 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "edmondop (via GitHub)" <gi...@apache.org>.
edmondop commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596074213

   Interested to join too


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596051911

   The current implementation i have streams object references out of each partition through an intermediate Actor to hold the queues.    Then subsequent stages connect to the intermediate actor and read streaming object references from the queue.   They then have to `ray.get()` on the references to materialize the IPC encoded batch.
   
   I was really hoping for more performance and scale out of this approach, and I particularly like that it reuses the RepartitionExec's as implemented in DataFusion.   But alas.
   
   My work isn't documented well yet but if you have time to discuss it sync, I'd appreciate your eyes on it and how we can improve it.  Let me know if you have time to pair program for a bit so I can demo.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596162835

   Yep.  Send me a link at rob.tandy@gmail.com


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed issue #46: Fix scalability limitations of current implementation
URL: https://github.com/apache/datafusion-ray/issues/46


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2563983395

   Would it be possible to use a ray generator for the shuffle writer and reader execution plans?
   
   Rather than serializing all of the data to disk in the writer, and reading it in the reader, we yield record batches in the Task.  Then ray sends those in the in memory object store (spilling if required).
   
   Then we can pipeline the execution of the writer and readers so that stages need not wait for completion of dependent stages to start processing.
   
   Would this work?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2563987848

   It would be nice if ray facilitated streaming via network between Actors in addition to exchange of messages via the object store.   If its only to exchange streams of batches would Arrow Flight be necessary or could something simpler be used, assuming the Actors exist only ephemerally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "edmondop (via GitHub)" <gi...@apache.org>.
edmondop commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596171984

   > rob.tandy@gmail.com
   
   You can find all the links to the channels here https://datafusion.apache.org/contributor-guide/communication.html. We are in #datafusion-ray  on Discord


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Fix scalability limitations of current implementation [datafusion-ray]

Posted by "robtandy (via GitHub)" <gi...@apache.org>.
robtandy commented on issue #46:
URL: https://github.com/apache/datafusion-ray/issues/46#issuecomment-2596105571

   Great!  Im in eastern time zone US.  @edmondop ?  @andygrove ?  This will be useful as I want to discuss in particular the approach to reusing the RepartitionExec's that I took and get feedback.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org