Skip to content

[Slurm on TPU] Add Slurm support for TPU v5e, v5p, and v6e - #6522

Open
AdarshK15 wants to merge 3 commits into
GoogleCloudPlatform:developfrom
AdarshK15:slurm-tpu-v6e
Open

AdarshK15 wants to merge 3 commits into
GoogleCloudPlatform:developfrom
AdarshK15:slurm-tpu-v6e

Conversation

@AdarshK15

@AdarshK15 AdarshK15 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Blueprint & Daily Tests

  • Unified TPU Slurm Blueprint (examples/machine-learning/tpu-v5e-v5p-v6e/):
    • Added tpu-slurm-blueprint.yaml, tpu-slurm-deployment.yaml, and README.md supporting:
      TPU v6e (ct6e-standard-4t),
      TPU v5p (ct5p-hightpu-4t), and
      TPU v5e (ct5lp-hightpu-4t) with Slurm 26.05 (aci-tpu-v5e-v5p-v6e-u2204-slurm-2605-amd64) and Managed Lustre.
    • Changing tpu_machine_type automatically selects the required boot disk type (hyperdisk-balanced for v6e, pd-balanced for v5p/v5e) and default static accelerator_topology (2x2x1 for v5p, 2x2 for v6e/v5e) when tpu_accelerator_topology is left null.
  • Integration Tests (tools/cloud-build/daily-tests/):
    • Added 3 daily Spot Slurm tests (ml-tpu-v6e-onspot-slurm, ml-tpu-v5p-onspot-slurm, ml-tpu-v5e-onspot-slurm).
    • Updated test-tpu-slurm.yml to check ConstrainDevices=no for dual-core-per-chip TPUs (tpu7x, v5p) and ConstrainDevices=yes for single-core-per-chip TPUs (v6e, v5e).

Key Changes & Bug Fixes

  • conf_v2605.py:
    • Added enable_async_reply to SlurmctldParameters when TPU nodesets are present.
    • Removed Type=<tpu_type> from cloud_gres.conf entries (Name=tpu File=/dev/vfio/devices/vfio[0-3]) to match Slurm 26.05's gres/tpu plugin expectations.
  • mig_flex.py & resume.py:
    • Added resume_tpu_chunks() to provision multiple TPU slices concurrently via util.map_with_futures instead of sequentially, isolating per-slice failures.
    • Added thread synchronization (_tpu_shared_resource_lock) and a short wait on HTTP 409 ("already exists") in get_instance_template_copy() and _ensure_tpu_workload_policy() to prevent race conditions during concurrent TPU slice resume.
    • Fixed zonal mig_self_link construction during createInstances rollback so _delete_tpu_mig() uses the zonal API when cleaning up failed zonal TPU MIGs.
  • slurmsync.py:
    • Updated get_node_action() for terminated TPU instances to transition directly to NodeActionPowerDownForce with a clear reason ("Spot instance preempted" or "Instance terminated") so allocated/mixed nodes power down and clean up their MIGs immediately instead of taking multiple sync cycles.
  • util.py:
    • Fixed Lookup.get_jobs() to split scontrol show jobs output on \n\n+(?=JobId=\d+) instead of \n\n (and ReqNodeList=(\S+)), preventing crashes when job Command= fields contain blank lines.
  • find_available_zone.sh:
    • Fixed jq quota parsing in check_filestore_quota() and check_lustre_quota() (| vs or operator precedence in the .dimensions fallback, and defaulting missing .details.value fields to "0" before converting to number).

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces support for TPU v5e, v5p, and v6e within the Slurm on GCP framework. It provides new blueprints for these TPU generations, enhances the reliability of concurrent TPU slice management, and includes critical bug fixes for job parsing and quota management. These changes ensure robust deployment and operational stability for high-performance TPU workloads on Slurm.

Highlights

  • New TPU Support: Added comprehensive Slurm support for TPU v5e, v5p, and v6e, including a new blueprint and deployment configuration.
  • Concurrency Improvements: Updated TPU slice resumption to use concurrent processing with thread synchronization to prevent race conditions.
  • Slurm Configuration Updates: Updated Slurm 26.05 configuration generation to include 'enable_async_reply' and adjusted GRES configuration to align with the new plugin expectations.
  • Reliability and Bug Fixes: Improved error handling for TPU instance termination, fixed job lookup parsing issues, and corrected quota parsing logic in deployment scripts.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

gemini-code-assist[bot]

This comment was marked as resolved.

@AdarshK15

Copy link
Copy Markdown
Member Author

/gemini review

gemini-code-assist[bot]

This comment was marked as resolved.

@AdarshK15

Copy link
Copy Markdown
Member Author

/gemini review

gemini-code-assist[bot]

This comment was marked as resolved.

@AdarshK15
AdarshK15 marked this pull request as ready for review October 19, 2026 12:52
@AdarshK15
AdarshK15 requested a review from a team as a code owner October 19, 2026 12:52
@AdarshK15 AdarshK15 added the release-key-new-features Added to release notes under the "Key New Features" heading. label Oct 20, 2026
@arpit974

Copy link
Copy Markdown
Contributor

@AdarshK15,
pre commits are failing,
please check

@arpit974 arpit974 assigned AdarshK15 and unassigned arpit974 Oct 20, 2026
@AdarshK15 AdarshK15 assigned arpit974 and unassigned AdarshK15 Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-key-new-features Added to release notes under the "Key New Features" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants