-
Notifications
You must be signed in to change notification settings - Fork 596
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
Standardized use of mem parameters in CNV WDLs. #4193
Conversation
@davidbenjamin mind reviewing? @LeeTL1220 take note for the style guide, if necessary. |
785f93d
to
f9b2701
Compare
Codecov Report
@@ Coverage Diff @@
## master #4193 +/- ##
===============================================
+ Coverage 78.475% 78.489% +0.013%
Complexity 16645 16645
===============================================
Files 1061 1061
Lines 59866 59866
Branches 9756 9756
===============================================
+ Hits 46980 46988 +8
+ Misses 9103 9097 -6
+ Partials 3783 3781 -2
|
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.
Yay standardization
scripts/cnv_wdl/cnv_common_tasks.wdl
Outdated
@@ -92,6 +92,9 @@ task CollectCounts { | |||
Int? preemptible_attempts | |||
Int? disk_space_gb | |||
|
|||
Int machine_mem = select_first([mem, 8]) * 1000 |
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.
As far as small optimizations go, if these tasks that are asking for 8000 MB
by default can make due with 7500 MB
then you can save 25% on GCP compute - https://cloud.google.com/compute/pricing#machinetype - n1-standard-2
vsn1-highmem-2
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.
OK, good to know! No particular reason these need Xmx8G, so I'll change them.
@@ -137,8 +140,7 @@ task CollectAllelicCounts { | |||
Int? preemptible_attempts | |||
Int? disk_space_gb | |||
|
|||
# Mem is in units of GB but our command and memory runtime values are in MB |
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.
Somewhere it should made clear that the user provided mem
input should be defined in units of GB
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.
Any objection to simply using *_mem_gb
and *_mem_mb
everywhere? I'd rather not duplicate this comment everywhere.
@LeeTL1220 @davidbenjamin?
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.
@samuelklee Fine by me...
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.
Done.
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.
Any objection to simply using *_mem_gb and *_mem_mb everywhere?
That is sufficiently self-documenting for my tastes.
@@ -110,7 +113,7 @@ task CollectCounts { | |||
|
|||
runtime { | |||
docker: "${gatk_docker}" |
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.
As per @LeeTL1220's template, we should be putting in values for cpu
even in the single threaded case.
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 didn't check to make sure all of the tasks adhered to the template just yet, since I'm assuming that it might still change. (Actually, I don't think any of the somatic CNV tasks specify cpu.) I'll focus on the mem changes in this PR and overhaul the rest later (perhaps once tasks are automatically generated), if you don't mind!
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.
@samuelklee Fine by me.
f9b2701
to
0bb9c95
Compare
Will merge when tests pass, unless there are further objections. |
@samuelklee From my perspective, merge away. Assuming that you are doing the cpu change later. |
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.
Consistency is the hobgoblin of my review.
scripts/cnv_wdl/cnv_common_tasks.wdl
Outdated
String gatk_docker | ||
Int? preemptible_attempts | ||
Int? disk_space_gb | ||
|
||
Int machine_mem_mb = select_first([mem_gb * 1000, 7500]) | ||
Int command_mem_mb = machine_mem_mb - 1000 |
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.
Why don't you do this in the tasks above?
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.
Thanks for catching this. Actually, I think this makes the tests fail---you can't perform the multiply operation inside select_first, apparently.
scripts/cnv_wdl/cnv_common_tasks.wdl
Outdated
@@ -69,7 +69,7 @@ task AnnotateIntervals { | |||
|
|||
runtime { | |||
docker: "${gatk_docker}" | |||
memory: select_first([mem, 5]) + " GB" | |||
memory: select_first([mem_gb, 5]) + " GB" |
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.
This is strange because if mem_gb
is supplied the machine memory and command memory are the same, but if it's not supplied they use different defaults.
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.
Oops, good catch. I think for some of these more minor tasks we didn't do the whole machine_mem/command_mem thing, as noted above. I'll just go back and standardize everything.
scripts/cnv_wdl/cnv_common_tasks.wdl
Outdated
@@ -21,7 +21,7 @@ task PreprocessIntervals { | |||
set -e | |||
export GATK_LOCAL_JAR=${default="/root/gatk.jar" gatk4_jar_override} | |||
|
|||
gatk --java-options "-Xmx${default="2" mem}g" PreprocessIntervals \ | |||
gatk --java-options "-Xmx${default="2" mem_gb}g" PreprocessIntervals \ |
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 don't feel great about using Xmx_g in some places and Xmx_m in others.
@@ -137,8 +140,7 @@ task CollectAllelicCounts { | |||
Int? preemptible_attempts | |||
Int? disk_space_gb | |||
|
|||
# Mem is in units of GB but our command and memory runtime values are in MB |
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.
Any objection to simply using *_mem_gb and *_mem_mb everywhere?
That is sufficiently self-documenting for my tastes.
Int machine_mem = if defined(mem) then select_first([mem]) else 8 | ||
Float command_mem = machine_mem - 0.5 | ||
Int machine_mem_mb = select_first([mem_gb, 7]) * 1000 | ||
Int command_mem_mb = machine_mem_mb - 500 |
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.
Elsewhere you have a 1GB difference.
# ModelSegments seems to need at least 3GB of overhead to run | ||
Int command_mem = machine_mem - 3000 | ||
Int command_mem_mb = machine_mem_mb - 3000 |
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.
Does this make sense to you? I mean, shouldn't the difference between command and machine memory just be the OS, hence independent of the GATK command?
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 sure, this was from @jsotobroad. I'd be fine with standardizing the difference everywhere if that works.
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.
@jsotobroad can answer this, @davidbenjamin .
Responded to @davidbenjamin. Still have differences for machine_mem_mb - command_mem_mb = 500, 1000, and 3000---@jsotobroad any reason for this? Can we make everything the same? |
I'm good with this if @jsotobroad is good too. |
Me too. |
@jsotobroad I'm going to go ahead and merge this and file an issue for the difference in memory overhead. |
We use the
machine_mem
/command_mem
framework for most tasks; others are unlikely to need any special memory considerations.There were some tasks for which
machine_mem
andcommand_mem
seemed to be switched in the original WDL. @jsotobroad was there any reason for this? I'm guessing they were just typos. I'm also not sure that some of the tasks would've actually run even if they were switched, since they would've resulted in non-integer -Xmx arguments. I changed everything over to MB to avoid this.Closes #4092.