Skip to content

Commit

Permalink
[WX-1183] Ice Lake (#7252)
Browse files Browse the repository at this point in the history
  • Loading branch information
THWiseman authored Nov 14, 2023
1 parent 2a93f28 commit 9b7ad98
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ files {

metadata {
status: Succeeded
"outputs.cpus.cascadeLake.cpuPlatform": "Intel Cascade Lake"
"outputs.cpus.broadwell.cpuPlatform": "Intel Broadwell"
"outputs.cpus.haswell.cpuPlatform": "Intel Haswell"
"outputs.cpus.cascadeLake.cpuPlatform": "Intel Cascade Lake"
"outputs.cpus.iceLake.cpuPlatform": "Intel Ice Lake"
"outputs.cpus.rome.cpuPlatform": "AMD Rome"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ task cpu_platform {
}

workflow cpus {
call cpu_platform as haswell { input: cpu_platform = "Intel Haswell" }
call cpu_platform as broadwell { input: cpu_platform = "Intel Broadwell" }
call cpu_platform as cascadeLake { input: cpu_platform = "Intel Cascade Lake" }
call cpu_platform as rome {input: cpu_platform = "AMD Rome" }
call cpu_platform as haswell { input: cpu_platform = "Intel Haswell" }
call cpu_platform as broadwell { input: cpu_platform = "Intel Broadwell" }
call cpu_platform as cascadeLake { input: cpu_platform = "Intel Cascade Lake" }
call cpu_platform as iceLake { input: cpu_platform = "Intel Ice Lake" }
call cpu_platform as rome { input: cpu_platform = "AMD Rome" }
}
1 change: 1 addition & 0 deletions docs/RuntimeAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ runtime {
Note that when this options is specified, make sure the requested CPU platform is [available](https://cloud.google.com/compute/docs/regions-zones/#available) in the `zones` you selected.

The following CPU platforms are currently supported by the Google Cloud backend:
- `Intel Ice Lake`
- `Intel Cascade Lake`
- `Intel Skylake`
- `Intel Broadwell`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ object MachineConstraints {
if (googleLegacyMachineSelection) {
s"predefined-$cpu-${memory.to(MemoryUnit.MB).amount.intValue()}"
} else {
// If someone requests Intel Cascade Lake as their CPU platform then switch the machine type to n2.
// Similarly, CPU platform of AMD Rome corresponds to the machine type n2d.
// Users specify a CPU platform in their WDL, but GCP also needs to know which machine type to use.
// The below logic infers the machine type from the requested CPU.
// The heuristic we're using is: find the newest 'General Purpose' type that supports the given CPU.
// https://cloud.google.com/compute/docs/machine-resource
// For example, if someone requests Intel Cascade Lake as their CPU platform, then infer the n2 machine type.
// Infer n2d from AMD Rome, etc.
val customMachineType =
cpuPlatformOption match {
case Some(PipelinesApiRuntimeAttributes.CpuPlatformIntelIceLakeValue) => N2CustomMachineType
case Some(PipelinesApiRuntimeAttributes.CpuPlatformIntelCascadeLakeValue) => N2CustomMachineType
case Some(PipelinesApiRuntimeAttributes.CpuPlatformAMDRomeValue) => N2DCustomMachineType
case _ => N1CustomMachineType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ object PipelinesApiRuntimeAttributes {
// via `gcloud compute zones describe us-central1-a`
val CpuPlatformIntelCascadeLakeValue = "Intel Cascade Lake"
val CpuPlatformAMDRomeValue = "AMD Rome"
val CpuPlatformIntelIceLakeValue = "Intel Ice Lake"

val UseDockerImageCacheKey = "useDockerImageCache"
private val useDockerImageCacheValidationInstance = new BooleanRuntimeAttributesValidation(UseDockerImageCacheKey).optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import wom.format.MemorySize
class MachineConstraintsSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers {
behavior of "MachineConstraints"

private val n2Option = Option(PipelinesApiRuntimeAttributes.CpuPlatformIntelCascadeLakeValue)
private val n2OptionCascade = Option(PipelinesApiRuntimeAttributes.CpuPlatformIntelCascadeLakeValue)

private val n2dOption = Option(PipelinesApiRuntimeAttributes.CpuPlatformAMDRomeValue)
private val n2dOption = Option(PipelinesApiRuntimeAttributes.CpuPlatformAMDRomeValue)

private val n2OptionIceLake = Option(PipelinesApiRuntimeAttributes.CpuPlatformIntelIceLakeValue)

it should "generate valid machine types" in {
val validTypes = Table(
Expand All @@ -40,7 +42,6 @@ class MachineConstraintsSpec extends AnyFlatSpec with CromwellTimeoutSpec with M

// Same tests as above but with legacy machine type selection (cpu and memory as specified. No 'custom machine
// requirement' adjustments are expected this time, except float->int)

(MemorySize(1024, MemoryUnit.MB), refineMV[Positive](1), None, true, "predefined-1-1024"),
(MemorySize(4, MemoryUnit.GB), refineMV[Positive](3), None, true, "predefined-3-4096"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](1), None, true, "predefined-1-1024"),
Expand All @@ -52,15 +53,26 @@ class MachineConstraintsSpec extends AnyFlatSpec with CromwellTimeoutSpec with M
(MemorySize(2, MemoryUnit.GB), refineMV[Positive](33), None, true, "predefined-33-2048"),

// Same tests but with cascade lake (n2)
(MemorySize(1024, MemoryUnit.MB), refineMV[Positive](1), n2Option, false, "n2-custom-2-2048"),
(MemorySize(4, MemoryUnit.GB), refineMV[Positive](3), n2Option, false, "n2-custom-4-4096"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](1), n2Option, false, "n2-custom-2-2048"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](4), n2Option, false, "n2-custom-4-4096"),
(MemorySize(14, MemoryUnit.GB), refineMV[Positive](16), n2Option, false, "n2-custom-16-16384"),
(MemorySize(13.65, MemoryUnit.GB), refineMV[Positive](1), n2Option, false, "n2-custom-2-14080"),
(MemorySize(1520.96, MemoryUnit.MB), refineMV[Positive](1), n2Option, false, "n2-custom-2-2048"),
(MemorySize(1024.0, MemoryUnit.MB), refineMV[Positive](1), n2Option, false, "n2-custom-2-2048"),
(MemorySize(2, MemoryUnit.GB), refineMV[Positive](33), n2Option, false, "n2-custom-36-36864"),
(MemorySize(1024, MemoryUnit.MB), refineMV[Positive](1), n2OptionCascade, false, "n2-custom-2-2048"),
(MemorySize(4, MemoryUnit.GB), refineMV[Positive](3), n2OptionCascade, false, "n2-custom-4-4096"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](1), n2OptionCascade, false, "n2-custom-2-2048"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](4), n2OptionCascade, false, "n2-custom-4-4096"),
(MemorySize(14, MemoryUnit.GB), refineMV[Positive](16), n2OptionCascade, false, "n2-custom-16-16384"),
(MemorySize(13.65, MemoryUnit.GB), refineMV[Positive](1), n2OptionCascade, false, "n2-custom-2-14080"),
(MemorySize(1520.96, MemoryUnit.MB), refineMV[Positive](1), n2OptionCascade, false, "n2-custom-2-2048"),
(MemorySize(1024.0, MemoryUnit.MB), refineMV[Positive](1), n2OptionCascade, false, "n2-custom-2-2048"),
(MemorySize(2, MemoryUnit.GB), refineMV[Positive](33), n2OptionCascade, false, "n2-custom-36-36864"),

// Same tests, but with ice lake. Should produce same results as cascade lake since they're both n2.
(MemorySize(1024, MemoryUnit.MB), refineMV[Positive](1), n2OptionIceLake, false, "n2-custom-2-2048"),
(MemorySize(4, MemoryUnit.GB), refineMV[Positive](3), n2OptionIceLake, false, "n2-custom-4-4096"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](1), n2OptionIceLake, false, "n2-custom-2-2048"),
(MemorySize(1, MemoryUnit.GB), refineMV[Positive](4), n2OptionIceLake, false, "n2-custom-4-4096"),
(MemorySize(14, MemoryUnit.GB), refineMV[Positive](16), n2OptionIceLake, false, "n2-custom-16-16384"),
(MemorySize(13.65, MemoryUnit.GB), refineMV[Positive](1), n2OptionIceLake, false, "n2-custom-2-14080"),
(MemorySize(1520.96, MemoryUnit.MB), refineMV[Positive](1), n2OptionIceLake, false, "n2-custom-2-2048"),
(MemorySize(1024.0, MemoryUnit.MB), refineMV[Positive](1), n2OptionIceLake, false, "n2-custom-2-2048"),
(MemorySize(2, MemoryUnit.GB), refineMV[Positive](33), n2OptionIceLake, false, "n2-custom-36-36864"),

// Same tests but with AMD Rome (n2d) #cpu > 16 are in increments of 16
(MemorySize(1024, MemoryUnit.MB), refineMV[Positive](1), n2dOption, false, "n2d-custom-2-1024"),
Expand Down

0 comments on commit 9b7ad98

Please sign in to comment.