Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces recipes for pretraining the Qwen3.5-35B-A3B model using MaxText on Trillium GKE clusters (v6e-256) via both Kubernetes JobSet and XPK. The feedback highlights a few critical improvements: first, the ttlSecondsAfterFinished field in the JobSet manifest requires v0.14.0, which conflicts with the v0.13.0 version specified in the prerequisites; second, the signal trap in the manifest should use the captured
| annotations: | ||
| alpha.jobset.sigs.k8s.io/exclusive-topology: cloud.google.com/gke-nodepool # 1:1 job replica to node pool assignment | ||
| spec: | ||
| ttlSecondsAfterFinished: 43200 |
There was a problem hiding this comment.
The ttlSecondsAfterFinished field was introduced in JobSet v0.14.0. Since the prerequisites in the README specify JobSet v0.13.0, applying this manifest will fail with a validation error on clusters running v0.13.0. Consider commenting this field out or upgrading the JobSet version in the README to v0.14.0 or later.
# ttlSecondsAfterFinished: 43200| - -c | ||
| - | | ||
| echo XPK Start: $(date); | ||
| _sigterm() (kill -SIGTERM $! 2>/dev/null;); |
There was a problem hiding this comment.
Using $! inside the trap function is volatile because $! always refers to the most recently started background process in the shell, which can change if other background commands are executed. Since the background process PID is explicitly captured in $PID on line 55, it is much safer and more robust to use $PID in the signal handler. Additionally, using standard curly braces {} instead of subshell parentheses () is preferred for standard function definitions.
_sigterm() { kill -SIGTERM "$PID" 2>/dev/null; }| export LIBTPU_INIT_ARGS='${XLA_FLAGS}' && \ | ||
| export JAX_PLATFORMS='tpu,cpu' && \ | ||
| export ENABLE_PJRT_COMPATIBILITY='true' && \ | ||
| python3 -u -m maxtext.trainers.pre_train.train src/maxtext/configs/base.yml ${MAXTEXT_ARGS}" |
There was a problem hiding this comment.
The python training process is run in the foreground of the container's entrypoint shell without exec. When GKE/Kueue sends a SIGTERM (e.g., during preemption or eviction), the shell (PID 1) receives the signal but does not propagate it to the foreground python process, causing the training job to be abruptly killed without triggering MaxText's graceful shutdown and checkpointing handlers. Prepending exec ensures that the python process replaces the shell as PID 1 and receives termination signals directly.
| python3 -u -m maxtext.trainers.pre_train.train src/maxtext/configs/base.yml ${MAXTEXT_ARGS}" | |
| exec python3 -u -m maxtext.trainers.pre_train.train src/maxtext/configs/base.yml ${MAXTEXT_ARGS}" |
…d ttlSecondsAfterFinished
Adding recipe for training Maxtext Qwen3.5-35B-A3B with v6e-256, both for kubernetes and xpk.
- UBench Run ID:
maxtext_training_with_xpk-llama3_1_8b-2026-10-13_122827-0adb8e8a-dfb7-4c16-ac25-79fba638966bThis PR should be merged after successfully merging those two PRs: