-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swoole Backend #312
Swoole Backend #312
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Hey @mcharytoniuk I'm copying this from our private convo because I think it's useful to capture here ... I like how you made that data provider for backends, really nice touch I think the PR is fantastic, but what I wanted to discuss with you was the differences between the Process and Coroutine modules and if it's necessary to have both (i.e. there's situations where either is better than the other). In terms of Serial vs the Swoole backend, that sounds pretty good. I would expect a parallel backend to be faster on multicore systems. Do you have data on Swoole vs the Amp backend? Also regarding the serializers, we could potentially use the Serializer abstraction already implemented here https://github.com/RubixML/ML/tree/master/src/Serializers. And we also have the igbinary one in Extras here https://github.com/RubixML/Extras/blob/master/src/Serializers/Igbinary.php. Hopefully the API will eb compatible. P.S. Stan seems to be complaining about some of the new code. |
Also from our discussion @mcharytoniuk, it seems like after seeing the benchmarks that the Coroutine module may not be executing the tasks in parallel under the hood. |
Hey @mcharytoniuk just a reminder to target the 2.5 branch with this code and to update the CHANGELOG! Looking fantastic, excited to release this! |
@andrewdalpino PR is done (in a sense that it's working, and I don't think I can add anything more valuable in terms of Swoole backend) :D There are few more things to consider, however:
|
Sweet @mcharytoniuk well give this a look soon! Thank you for the details, they help alot |
The
$timeout
parameter means the total timeout for all the tasks in the current queue. By default it's set to-1
(no timeout)Internally, I used
batch
(should also work with OpenSwoole: https://openswoole.com/docs/modules/swoole-coroutine-batch).batch
runs the tasks concurrently, but also preserves the order of results, so I added that to the test.I also added
swoole
to the list of extensions loaded in the CI.If you want me to change anything, let me know :)