Skip to content

Commit a76fab0

Browse files
authored
Feat: Upgrade xpk MAIN_BRANCH to v0.12.0 with workaround (GoogleCloudPlatform#940)
This change updates the handling of the `xpk` dependency to address ongoing issues with dependency validation, and upgrades the version used. The main changes involve upgrading to a newer `xpk` branch (v0.12.0), introducing a workaround to bypass dependency validation, and making a minor adjustment to workload execution.
1 parent 73d8bee commit a76fab0

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

xlml/utils/xpk.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
from xlml.utils import gke, composer
3131
from dags.common.vm_resource import GpuVersion
3232

33-
# b/411426745 - Setting branch to 0.4.1 till the depdency issue is resolved.
34-
MAIN_BRANCH = "v0.4.1"
33+
# b/411426745 - Using sed workaround to comment out validate_dependencies()
34+
# in xpk main.py to upgrade the version from 0.4.1 to 0.12.0.
35+
MAIN_BRANCH = "v0.12.0"
3536

3637
# TODO(b/437817546): Switch back to the main branch after the issue is resolved.
3738
# This branch includes changes fixing the `validate_dependencies()` crash issue.
@@ -57,10 +58,19 @@ def get_xpk_setup_cmd(tmpdir, branch: str = MAIN_BRANCH):
5758
f"git clone --branch {branch} https://github.com/AI-Hypercomputer/xpk"
5859
f" {tmpdir}/xpk"
5960
)
61+
62+
bash_setup = "set -xue"
63+
64+
pip_install = "pip install ruamel.yaml docker"
65+
66+
# b/411426745 - Workaround: Comment out validate_dependencies() call to avoid dependency validation issues
67+
comment_out_validation = f"sed -i '/validate_dependencies()/s/^/## /' {tmpdir}/xpk/src/xpk/main.py || true"
68+
6069
cmds = [
61-
"set -xue",
70+
bash_setup,
6271
clone_branch,
63-
"pip install ruamel.yaml docker",
72+
pip_install,
73+
comment_out_validation,
6474
]
6575
return cmds
6676

@@ -137,10 +147,9 @@ def run_workload(
137147
f" --{multi_keyword}={num_slices} --docker-image={docker_image}"
138148
f" --project={cluster_project} --zone={zone}"
139149
f" --env {metric_config.SshEnvVars.GCS_OUTPUT.name}={gcs_path}"
140-
" --restart-on-user-code-failure"
141150
)
142151

143-
if ramdisk_directory:
152+
if ramdisk_directory and not use_pathways:
144153
workload_create_cmd += f" --ramdisk-directory={ramdisk_directory}"
145154

146155
if mtc_enabled:

0 commit comments

Comments
 (0)