Skip to content

Commit a32d52d

Browse files
bvandermoonShuwen-Fang
authored andcommitted
PR #3449: Move install_maxtext_extra_deps to dependencies directory
Imported from GitHub PR #3449 Move the `install_maxtext_extra_deps` deps directory to `dependencies` after `dependencies` was added to the PyPI package. This command still works/runs the expected installation: ``` uv pip install -e .[tpu] --resolution=lowest install_maxtext_tpu_github_deps install_maxtext_tpu_post_train_extra_deps ``` CI also builds this command Before submitting this PR, please make sure (put X in square brackets): - [x] I have performed a self-review of my code. For an optional AI review, add the `gemini-review` label. - [x] I have necessary comments in my code, particularly in hard-to-understand areas. - [x] I have run end-to-end tests tests and provided workload links above if applicable. - [x] 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. Copybara import of the project: -- 277b08e by Branden Vandermoon <bvandermoon@google.com>: Move install_maxtext_extra_deps to dependencies directory Merging this change closes #3449 COPYBARA_INTEGRATE_REVIEW=#3449 from AI-Hypercomputer:bvandermoon-github-deps 277b08e PiperOrigin-RevId: 886463160
1 parent c6da8da commit a32d52d

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Repository = "https://github.com/AI-Hypercomputer/maxtext.git"
4040
allow-direct-references = true
4141

4242
[tool.hatch.build.targets.wheel]
43-
packages = ["src/MaxText", "src/maxtext", "src/dependencies"]
43+
packages = ["src/MaxText", "src/maxtext", "src/dependencies/github_deps", "src/dependencies"]
4444

4545
# TODO: Add this hook back when it handles device-type parsing
4646
# [tool.hatch.build.targets.wheel.hooks.custom]

src/dependencies/dockerfiles/maxtext_gpu_dependencies.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ WORKDIR /deps
5656
COPY ${PACKAGE_DIR}/dependencies/github_deps/ src/dependencies/github_deps/
5757
COPY ${PACKAGE_DIR}/dependencies/requirements/ src/dependencies/requirements/
5858
COPY ${PACKAGE_DIR}/dependencies/scripts/ src/dependencies/scripts/
59-
COPY ${PACKAGE_DIR}/maxtext/integration/vllm/ src/maxtext/integration/vllm/
59+
COPY ${PACKAGE_DIR}/maxtext/integration/vllm/ src/MaxText/integration/vllm/
6060

6161
# Install dependencies - these steps are cached unless the copied files change
6262
RUN echo "Running command: bash setup.sh MODE=$ENV_MODE JAX_VERSION=$ENV_JAX_VERSION DEVICE=${ENV_DEVICE}"

src/dependencies/github_deps/install_post_train_deps.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ def main():
3434
"""
3535
os.environ["VLLM_TARGET_DEVICE"] = "tpu"
3636

37-
current_dir = os.path.dirname(os.path.abspath(__file__))
38-
repo_root = os.path.abspath(os.path.join(current_dir, "..", ".."))
39-
extra_deps_path = os.path.join(current_dir, "post_train_deps.txt")
40-
if not os.path.exists(extra_deps_path):
41-
raise FileNotFoundError(f"Dependencies file not found at {extra_deps_path}")
37+
# Adjust this path if your post_train_deps.txt is in a different location,
38+
# e.g., script_dir / "data" / "post_train_deps.txt"
39+
extra_deps_file = script_dir / "post_train_deps.txt"
4240

41+
if not extra_deps_file.exists():
42+
print(f"Error: '{extra_deps_file}' not found.")
43+
print("Please ensure 'post_train_deps.txt' is in the correct location relative to the script.")
44+
sys.exit(1)
4345
# Check if 'uv' is available in the environment
4446
try:
4547
subprocess.run([sys.executable, "-m", "pip", "install", "uv"], check=True, capture_output=True)

src/dependencies/github_deps/install_pre_train_deps.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ def main():
3737
if not os.path.exists(extra_deps_path):
3838
raise FileNotFoundError(f"Dependencies file not found at {extra_deps_path}")
3939

40+
# Adjust this path if your pre_train_deps.txt is in a different location,
41+
# e.g., script_dir / "data" / "pre_train_deps.txt"
42+
extra_deps_file = script_dir / "pre_train_deps.txt"
43+
44+
if not extra_deps_file.exists():
45+
print(f"Error: '{extra_deps_file}' not found.")
46+
print("Please ensure 'pre_train_deps.txt' is in the correct location relative to the script.")
47+
sys.exit(1)
4048
# Check if 'uv' is available in the environment
4149
try:
4250
subprocess.run([sys.executable, "-m", "pip", "install", "uv"], check=True, capture_output=True)

0 commit comments

Comments
 (0)