-
Notifications
You must be signed in to change notification settings - Fork 214
Template: Add gpu
profile
#3272
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>
Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>
So the flow of information in the scdownstream pipeline looks as following:
This implementation is the best I could come up with so far, but not many really "senior" people have had a look at it AFAIK. Maybe we can discuss which elements of the suggested approach should be part of the template and where we can perform some improvements. |
Another thought: Should this not be an optional part of the template? |
it's teeny-tiny enough, that we might keep it in, imo, similar to |
But is the goal to only add the profile to the template? I think it would at least be nice to have a common structure for all GPU-enabled modules, even if it only means adding the |
Thank you @nictru
The I don't think we need a separate
In the scdownstream pipeline, I think we only need the process {
withLabel: 'use_gpu' {
ext.use_gpu = { params.use_gpu }
}
} At pipeline execution, the user must set the
Thank you. This is very helpful.
This is quite clever. Nice! |
Hey @GallVp, thanks for the input. Some notes: It might sound stupid, but I did not know there was a difference between I am not fully aware about what you can and can't do with
I would prefer if setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not approving yet, because we should first decide what the implementation should look like and add all necessary parts
No, How about we get rid of both the variable and the parameter? Instead, we modify the profile as, gpu {
process {
withLabel: process_gpu {
ext.use_gpu = true
}
}
docker.runOptions = '-u $(id -u):$(id -g) --gpus all'
apptainer.runOptions = '--nv'
singularity.runOptions = '--nv'
} The workflows can use The above solution, however, does not take care of the |
Hey, I just tested the suggested approach and it seems to work as expected. I did this using the following:
So that we don't need a config variable. But this is more a cosmetic topic and not a hill-to-die-on. |
feel free to add the changes, @nictru |
Co-authored-by: Nico Trummer <nictru32@gmail.com>
I agree. This is more in line with the existing infrastructure. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy now :)
Needs opt-in functionality in the |
🧹 spring cleaning message 🌷 What is the status of this PR? It looks ready after solving the conflicts. Are you planing to finish it? |
still need to opt-in template features first |
This PR is indemand @mirpedrol @mashehu 🙏 https://nfcore.slack.com/archives/C043UU89KKQ/p1743749138969479 Note that @adamrtalbot is running through a few use cases how it would be used in configs if this helps in any way: https://nfcore.slack.com/archives/C043UU89KKQ/p1744102571110729?thread_ts=1744098920.100049&cid=C043UU89KKQ |
maxRetries = 2 | ||
} | ||
withLabel: process_gpu { | ||
ext.use_gpu = {workflow.profile.contains('gpu')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ext.use_gpu = {workflow.profile.contains('gpu')} | |
ext.use_gpu = { workflow.profile.contains('gpu') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then to set the accelerator for the individual processes as here, you suggest using something such as:
process {
withName: 'RUN_ALPHAFOLD2' {
accelerator = workflow.profile.contains('gpu') ? 1 : 0
}
}
Instead of using a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's the idea
Co-authored-by: Jose Espinosa-Carrasco <kadomu@gmail.com>
In order to merge this, we need to add an opt-in functionality when creating the pipeline template. |
For curiosity what exactly needs to be 'opt in' here? Is there any harm having the The label could also be optionally empty for now, but at least allows custom/institutional config-level settings |
we will also add gpu CI with that opt-in feature. |
What do you think if we merge this now, and we add it to all pipelines with the template update. But we agree on not adding GPU CI until we have the opt-in functionality. This profile will be included to this opt-in feature later, so it will be removed from all pipelines that don't select the opt-in feature. |
Could also do that. However I think the less 'breaky' method would be adding just the label as a valid label. People can then already use that in their configs to 'replicate' the GPU profile in this PR themselves, until the GPU profile itself goes into the template. That way it doesn't get 'removed'. i.e., the label is cheap, and can be in there without it having to be opt in and it won't bother anywone |
sorry, I don't understand why having an empty label would help or what you mean with valid labels. |
Because then modules can be validly labelled as having GPU support, and configs can actually do something with it Then I can set in my institutional config
Or whatever |
Because then modules can be validly labelled as having GPU support. Then I can set in my institutional config
Or whatever |
See the examples here: nf-core/configs#876 (review) |
This would be at the modules guidelines level no? We don't need the label in the template to be able to use it in the modules |
It can go there, but the documentation of what are the valid labels are points to the pipeline template... (and I assumed where your fixed list comes from when selecting this in the dropdown in |
I didn't think about the dropdown from |
Good point. But I still think it makes sense to already have this in the pipeline template already then so we can refer already to our 'standard' i.e., a single |
@jfy133 are you okay, with merging this PR as it is now? Rest we discussed we can do later. |
The bit in We may just want to consider whether it should be |
Close #1383