Skip to content
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

Add configurable options to scheduler #107

Merged
merged 3 commits into from
Jun 17, 2019

Conversation

jpsamaroo
Copy link
Member

@jpsamaroo jpsamaroo commented Jun 6, 2019

This PR allows the scheduler to take options as keyword args. To start with, I'm adding an option called "single" which forces all work onto a single worker (master or a specific worker) by worker id.

@jpsamaroo jpsamaroo changed the title [WIP] Add options to scheduler as kwargs Add options to scheduler as kwargs Jun 13, 2019
@jpsamaroo
Copy link
Member Author

I removed the other planned options for now to make this PR easier to review.

@aviks
Copy link

aviks commented Jun 13, 2019

Are any of these functions performance critical? Should we worry about the overhead of kwargs?

@jpsamaroo
Copy link
Member Author

Should not have any noticeable impact given that they stop propagating once they hit compute_dag (the entrypoint to the scheduler). At that point, scheduler and data transfer overhead will vastly outweigh the potentially minor cost of some dynamic dispatch or kwarg sorting that could occur in the upper levels. Also, constant propagation should remove any cost if the options are set explicitly by the user (not automatically computed by some algorithm, which would probably foil constant prop).

@andreasnoack
Copy link
Member

From my own experience, sending arbitrary kwargs around like that can be quite tricky when things go wrong because you'll only see deep down the call chain. So are you sure this is the best option here?

@jpsamaroo
Copy link
Member Author

If there wasn't the current scheduler plugin architecture built into Dagger (which I will be making good use of), then I would completely agree with you and only thread the kwargs that're needed. But with the plugin architecture being a thing, and different schedulers having the potential for different relevant options (multithreading, GPU support, etc.), we need some way to be generic about scheduler configuration.

As an alternative, we could extend the plugin API with a way to create a scheduler-specific struct that can be passed as a single kwarg which will contain the appropriate options. If you'd prefer that sort of API, I will change this PR to implement that approach instead.

@andreasnoack
Copy link
Member

I suspect the latter solution would be simpler to manage down the road while for former is faster to get going right away. I'll let you decide since you'll be the one to actually do the work so if you prefer to stick with the current approach let us know and I'll merge.

@jpsamaroo
Copy link
Member Author

I'd rather do this right the first time, so I'll go with the latter (struct) approach. I'll let you know once I've made the appropriate changes. Thanks for the helpful review :)

@jpsamaroo jpsamaroo changed the title Add options to scheduler as kwargs Add configurable options to scheduler Jun 14, 2019
@jpsamaroo
Copy link
Member Author

@andreasnoack let me know if the latest changes are to your liking when you get the chance to review.

@andreasnoack andreasnoack merged commit 5b1b71f into JuliaParallel:master Jun 17, 2019
@jpsamaroo
Copy link
Member Author

Thanks for the review @andreasnoack ❤️

@jpsamaroo jpsamaroo mentioned this pull request Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants