Skip to content

[CI] Split tpu unit tests into 2 parallel worker groups#4276

Open
xibinliu wants to merge 1 commit into
mainfrom
xibin/ci
Open

[CI] Split tpu unit tests into 2 parallel worker groups#4276
xibinliu wants to merge 1 commit into
mainfrom
xibin/ci

Conversation

@xibinliu

@xibinliu xibinliu commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Description

Split tpu-unit and pathways unit tests into 2 groups to speed up CI tests.

Tests

CI unit tests pass.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@xibinliu xibinliu force-pushed the xibin/ci branch 3 times, most recently from 658e4a2 to 0acb622 Compare June 26, 2026 02:11
@xibinliu xibinliu marked this pull request as ready for review June 26, 2026 02:35
@xibinliu xibinliu changed the title [CI] Split tpu-unit tests into 3 parallel worker groups [CI] Split tpu unit tests into 2 parallel worker groups Jun 26, 2026
fail-fast: false
matrix:
worker_group: ${{ fromJSON(contains(inputs.flavor, 'cpu-unit') && '[1, 2, 3, 4]' || '[1]') }}
worker_group: ${{ fromJSON(contains(inputs.flavor, 'cpu-unit') && '[1, 2, 3, 4]' || (inputs.flavor == 'tpu-unit' && '[1, 2]' || '[1]')) }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use == also for cpu-unit for consistency

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

maxtext_installed: ${{ inputs.maxtext_installed }}
worker_group: ${{ matrix.worker_group }}
total_workers: ${{ contains(inputs.flavor, 'cpu-unit') && 4 || 1 }}
total_workers: ${{ contains(inputs.flavor, 'cpu-unit') && 4 || (inputs.flavor == 'tpu-unit' && 2 || 1) }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use == also for cpu-unit for consistency

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread .github/workflows/ci_pipeline.yml Outdated
container_resource_option: "--privileged"
is_scheduled_run: ${{ github.event_name == 'schedule' }}
maxtext_sha: ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}
total_workers: 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets define constants somewhere in one place and use them instead of literals

CPU worker constants

CPU_UNIT_TOTAL_WORKERS: 4
CPU_UNIT_WORKER_GROUPS: '[1, 2, 3, 4]'

TPU worker constants

TPU_UNIT_TOTAL_WORKERS: 2
TPU_UNIT_WORKER_GROUPS: '[1, 2]'

Default fallback constants

DEFAULT_TOTAL_WORKERS: 1
DEFAULT_WORKER_GROUPS: '[1]'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use setup-parameters job to set up these constants.

TPU tests need to avoid spawning parallel xdist workers on the same TPU device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants