-
Notifications
You must be signed in to change notification settings - Fork 417
Add workflow for unit tests with Pathways backend #2371
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
Open
wstcliyu
wants to merge
2
commits into
main
Choose a base branch
from
wstcliyu/pw-unit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+268
−114
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acc6e3e
to
65ce037
Compare
Comment on lines
52
to
102
runs-on: ${{ inputs.cloud_runner != '' && inputs.cloud_runner || fromJson(format('["self-hosted", "{0}", "{1}"]', inputs.device_type, inputs.device_name)) }} | ||
container: | ||
image: gcr.io/tpu-prod-env-multipod/maxtext_${{ github.run_id }}:${{ inputs.image_type != '' && inputs.image_type || inputs.device_type }} | ||
volumes: | ||
- /home/runner/actions-runner/_work/maxtext/maxtext:/deps | ||
env: | ||
XLA_PYTHON_CLIENT_MEM_FRACTION: ${{ inputs.xla_python_client_mem_fraction }} | ||
TF_FORCE_GPU_ALLOW_GROWTH: ${{ inputs.tf_force_gpu_allow_growth }} | ||
JAX_PLATFORMS: "proxy" | ||
JAX_BACKEND_TARGET: "grpc://proxy:29008" | ||
options: ${{ inputs.container_resource_option }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run Tests | ||
run: | | ||
if [ "${{ inputs.is_scheduled_run }}" = "true" ]; then | ||
FINAL_PYTEST_MARKER="${{ inputs.pytest_marker }}" | ||
else | ||
FINAL_PYTEST_MARKER="${{ inputs.pytest_marker }} and not scheduled_only" | ||
fi | ||
python3 -m pip install -e . --no-dependencies && | ||
python3 -m pytest -v -m "${FINAL_PYTEST_MARKER}" --durations=0 | ||
|
||
services: | ||
resource_manager: | ||
image: us-docker.pkg.dev/cloud-tpu-v2-images/pathways/server:latest | ||
ports: | ||
- "29001:29001" | ||
- "29002:29002" | ||
options: | ||
--entrypoint=[/usr/pathways/run/cloud_pathways_server_sanitized, --server_port=29001, --node_type=resource_manager, --instance_count=1, --instance_type=tpuv4:2x2x1, --gcs_scratch_location=gs://cloud-pathways-staging/tmp] | ||
env: | ||
HOST_ADDRESS: resource_manager | ||
TPU_SKIP_MDS_QUERY: true | ||
|
||
worker: | ||
image: us-docker.pkg.dev/cloud-tpu-v2-images/pathways/server:latest | ||
ports: | ||
- "29005:29005" | ||
- "29006:29006" | ||
- "8471:8471" | ||
- "8080:8080" | ||
options: | ||
--privileged | ||
--entrypoint=[/usr/pathways/run/cloud_pathways_server_sanitized, --server_port=29005, --resource_manager_address=resource_manager:29001, --gcs_scratch_location=gs://cloud-pathways-staging/tmp] | ||
|
||
proxy: | ||
image: us-docker.pkg.dev/cloud-tpu-v2-images/pathways/proxy_server:latest | ||
ports: | ||
- "29000:29000" | ||
options: | ||
--entrypoint=[/usr/pathways/run/cloud_proxy_server_sanitized, --server_port=29000, --resource_manager_address=resource_manager:29001, --gcs_scratch_location=gs://cloud-pathways-staging/tmp] |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
5e282c0
to
f86f57d
Compare
2c68241
to
8ff58bc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enables TPU unit tests to also run with Pathways backend. Essentially, we will have two sets of tests - one with McJAX and one with Pathways.
For more details, please read the doc on b/397475777. Note that extra self-hosted runners have been added so that tests can be executed in parallel and complete faster overall.
Tests
Please describe how you tested this change, and include any instructions and/or
commands to reproduce.
Changes tested locally using command
bash docker_run_pathways_containers.sh maxtext_image=us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/maxtext_jax_stable:latest command="cd MaxText ; python3 -m pytest tests -m 'not gpu_only and not integration_test' -s"
Pathways flow tested on Github workflow -
Example runs -
Checklist
Before submitting this PR, please make sure (put X in square brackets):