feat(gke): Unify A3 Mega blueprint with dynamic consumption models and align daily integration tests - #6068
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the GKE A3 Mega blueprint to provide a unified, flexible architecture that supports various consumption models natively. By introducing configurable variables and dynamic HCL logic, the change eliminates the need for maintaining separate blueprints or using fragile shell-based test overrides. These improvements simplify deployment management and ensure better compatibility with GKE's advanced provisioning features. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for multiple consumption models (such as DWS Flex Start, Queued Provisioning, Spot, and Specific Reservations) in the GKE A3 MegaGPU example blueprint. It adds a new Kueue configuration template (dws-queues.yaml.tftpl) and updates the deployment configuration and daily tests to handle these models dynamically. Feedback on the changes highlights a fragile sed command in the daily tests that can result in malformed YAML, and suggests using single quotes instead of escaped double quotes in the blueprint to improve readability.
| sed -i -e '/reservation_affinity:/,+3c\ placement_policy:\n type: COMPACT\n spot: '"$$ENABLE_SPOT"'' $${EXAMPLE_BP} | ||
| sed -i '/reservation/d' $${EXAMPLE_BP} | ||
|
|
||
| sed -i -e '/^ *spot: /a\ placement_policy:\n type: COMPACT' $${EXAMPLE_BP} |
There was a problem hiding this comment.
The sed command matching /^ *spot: / is extremely fragile because it matches both the top-level spot: false variable under vars: and the spot: $(vars.spot) setting under a3_megagpu_pool. This results in appending placement_policy under vars:, which creates malformed and invalid YAML. Instead, target a unique line within the a3_megagpu_pool settings, such as machine_type: a3-megagpu-8g.
sed -i -e '/machine_type: a3-megagpu-8g/a\\ placement_policy:\\n type: COMPACT' $${EXAMPLE_BP}References
- Prefer exact string matching in
sedcommands within build and test scripts to maintain consistency with existing codebase patterns, rather than introducing complex regular expressions.
|
|
||
| gcp_public_cidrs_access_enabled: false | ||
| kueue_configuration_path: $(ghpc_stage("./kueue-configuration.yaml.tftpl")) | ||
| kueue_configuration_path: "$((vars.enable_queued_provisioning) ? ghpc_stage(\"./dws-queues.yaml.tftpl\") : ghpc_stage(\"./kueue-configuration.yaml.tftpl\"))" |
There was a problem hiding this comment.
Using escaped double quotes \" inside a double-quoted YAML string is hard to read and maintain. You can use single quotes ' inside the double-quoted string for the blueprint expression literals to improve readability and avoid backslash escaping.
kueue_configuration_path: "$((vars.enable_queued_provisioning) ? ghpc_stage('./dws-queues.yaml.tftpl') : ghpc_stage('./kueue-configuration.yaml.tftpl'))"|
/gcbrun |
e729e30 to
3eb3521
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for GKE A3 Mega GPU consumption options, specifically Dynamic Workload Scheduler (DWS) Flex Start and DWS Flex Start with Queued Provisioning, including sample workloads, Kueue configurations, and updated documentation. Feedback on the changes suggests setting the JobSet configurations to a suspended state (suspend: true) to ensure proper integration with Kueue, and extracting complex inline shell scripts from the initContainers into separate script files to avoid runtime package installations and nested shells.
3eb3521 to
e53436b
Compare
|
/gcbrun |
d7f34e5 to
68db6aa
Compare
| #static_node_count: 0 | ||
|
|
||
| # --- Option 2: DWS Flex Start + Queued Provisioning --- | ||
| # Change this variable if you want to have a custom kueue config file |
There was a problem hiding this comment.
Probably, put a double ## here so that when the user un-comments this block, the relevant settings are enabled and not the line information.
| ### Additional Consumption Options | ||
| The Cluster Toolkit supports alternative consumption options such as Spot VMs or Dynamic Workload Scheduler (DWS) Flex-start. | ||
| Refer to step 5 of [Create a cluster using Cluster Toolkit](https://docs.cloud.google.com/ai-hypercomputer/docs/create/gke-ai-hypercompute#use-cluster-toolkit) for general instructions on other consumption options. Similar configuration settings can be used for GKE-A3M cluster as well. | ||
| Refer to [Consumption options](https://cloud.google.com/ai-hypercomputer/docs/create/gke-ai-hypercompute#use-cluster-toolkit) for more instructions on alternative consumption options. |
There was a problem hiding this comment.
I believe we can remove this block now since we are providing a comprehensive description of consumptions above.
a5f4361 to
8443c0e
Compare
8443c0e to
7fe68d0
Compare
Overview
This PR introduces a unified GKE A3 Mega blueprint that natively supports all A3 Mega consumption models (On-Demand, Spot, DWS Flex Start, DWS Queued Provisioning and Specific Reservations) via configurable blueprint variables, and aligns the daily integration tests to work cleanly with the new architecture.
Why these changes were made
dws-queues.yaml.tftpl) so pods trigger GKE'sProvisioningRequestAPI and dynamically provision nodes, rather than admitting pods against static GPU quota.What changed
1. Unified A3 Mega Blueprint (
gke-a3-megagpu.yaml&gke-a3-megagpu-deployment.yaml)spot,reservation_affinity,enable_flex_start,enable_queued_provisioning,auto_repair, andautoscaling_total_min_nodestovars:with safe defaults (NO_RESERVATION,spot: false,0min nodes).a3_megagpu_poolto automatically overridestatic_node_count: nullandauto_repair: falsewhenever Flex Start is active, satisfying module preconditions without manual user toggling:static_node_count: "$((vars.enable_flex_start) ? null : vars.static_node_count)"auto_repair: "$((vars.enable_flex_start) ? false : vars.auto_repair)"deployment.yamlfor each consumption model to serve as an in-line user template. Additionally, under Option 2 (DWS Flex Start + Queued Provisioning), we include the commented-outkueue_configuration_pathvariable defaulting to$(ghpc_stage("../dws-queues/dws-queues.yaml.tftpl"))along with an inline comment explaining that users can modify this variable if they want to use a custom Kueue configuration file instead of the default DWS queues path.2. Documentation & Workload Samples (
examples/dws-sample-workloads/)README.md: Added consumption options setup notes, a new Run a Job section, updated 3-mode Verify NCCL Performance instructions (Standard, DWS Flex Start, DWS+Queue), and cleaned up resource links.examples/dws-sample-workloads/): Added Sample job files dws and dws+queue. Files under this folder are machine independent.3. Daily Integration Test Alignment (
tools/cloud-build/daily-tests/)gke-a3-megagpu-onspot.yaml&.yml):sedcommands that rewrotereservation_affinity:and deleted variables.spot: "{{ enable_spot | default(true) }}"tocli_deployment_vars:so Spot provisioning is enabled natively via the blueprint variable.sedcommand to injectplacement_policy: { type: "COMPACT" }intoa3_megagpu_pool, ensuring GKE attaches GCE topology block/subblock labels required by Kueue Topology Aware Scheduling (TAS).gke-a3-megagpu.yaml&.yml):sedcommand to configurereservation_affinity:for specific reservation testing (a3mega-reservation-0).reservation:CLI variables fromcli_deployment_vars:to avoidtest_deployment_variable_not_usedvalidator failures.Verification Performed
gcluster create):--vars spot=true, confirming correct Terraform generation (spot = var.spotandplacement_policy: { type: COMPACT }inprimary/main.tf).reservation_affinity = var.reservation_affinity).Submission Checklist
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.