Skip to content

add benchmark to the new file instruction grain metadata impl - #4876

Closed
sadikneipp wants to merge 1 commit into
abhinavsing/snapshot-scalefrom
ksadi/benchmark-file-instruction
Closed

add benchmark to the new file instruction grain metadata impl#4876
sadikneipp wants to merge 1 commit into
abhinavsing/snapshot-scalefrom
ksadi/benchmark-file-instruction

Conversation

@sadikneipp

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new standalone JobSet configuration (benchmarks/jobset_benchmark_file_instruction.yaml) to run the MaxText FileInstruction initialization benchmark on Cloud TPU v5e-32. The review feedback highlights several issues to address: a syntax error in the GRPC_SERVER_ADDRESS environment variable due to triple single quotes, an unreliable _sigterm trap handler in the coordinator container, the use of fragile personal/dev container images, hardcoded Google-internal GCS buckets that will cause permission issues for external users, and a fragile hardcoded sleep timer for worker pod initialization.

name: shared-tmp
- env:
- name: GRPC_SERVER_ADDRESS
value: '''0.0.0.0:50051'''

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The environment variable GRPC_SERVER_ADDRESS has triple single quotes ('''0.0.0.0:50051'''). In YAML, this will be parsed as a string with literal single quotes around the IP address ('0.0.0.0:50051'), which will cause gRPC server binding or connection to fail. It should be defined without the extra single quotes.

                value: "0.0.0.0:50051"

Comment on lines +65 to +66
_sigterm() (kill -SIGTERM $! 2>/dev/null;);
trap _sigterm SIGTERM;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The _sigterm trap handler uses $! directly and runs in a subshell () without exiting. If a SIGTERM is received, the coordinator shell will run the trap but continue executing subsequent commands instead of propagating the termination. Additionally, using $! directly can be unreliable if other background processes are started. It is safer and more robust to use the captured PID variable and explicitly exit, matching the clean design of the worker's _term trap.

                _sigterm() {
                  echo "Caught SIGTERM signal! Forwarding to child..."
                  if [ -n "${PID:-}" ]; then
                    kill -SIGTERM "$PID" 2>/dev/null
                  fi
                  exit 1
                }
                trap _sigterm SIGTERM;

value: GCP
- name: JAX_BACKEND_TARGET
value: grpc://$(PATHWAYS_HEAD):29000
image: us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/gke/ksadi/maxtext-runner:python_3.12-jax_0.10.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The container image points to a personal/dev registry path (ksadi/maxtext-runner). Dev images can be deleted or modified at any time, which makes the benchmark fragile and prone to breaking. Please use an official or shared release image path instead.

- env:
- name: GRPC_SERVER_ADDRESS
value: '''0.0.0.0:50051'''
image: us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/gke/ksadi/maxtext-colocated-python:python_3.12-jax_0.10.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The container image points to a personal/dev registry path (ksadi/maxtext-colocated-python). Dev images can be deleted or modified at any time, which makes the benchmark fragile and prone to breaking. Please use an official or shared release image path instead.


_sigterm() (kill -SIGTERM $! 2>/dev/null;);
trap _sigterm SIGTERM;
BASE_OUTPUT_DIRECTORY="gs://tess-pin-checkpointing-us-central1/pathways_superslice_tpu7x-4096_llama3_1-405b-8192-v7x-4096"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The benchmark configuration uses hardcoded Google-internal GCS buckets (gs://tess-pin-checkpointing-us-central1/... and gs://tess-pin-dataloading-us-central1/...). External users running this benchmark will encounter permission denied errors. Consider parameterizing these paths or adding a comment/documentation on how users can configure their own GCS buckets.

echo XPK Start: $(date);

echo "Waiting 150 seconds for worker pods to initialize..."
sleep 150;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using a hardcoded sleep 150 to wait for worker pods to initialize is fragile. If the worker pods take longer to initialize (e.g., due to image pulling or scheduling delays), the coordinator will start the benchmark prematurely and fail. Consider implementing a dynamic check to poll the readiness of the worker pods or endpoints before starting the benchmark.

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.

1 participant