Skip to content

Commit

Permalink
Install torchao by default (#7470)
Browse files Browse the repository at this point in the history
Summary:

Now that torchao is not experimental anymore, we can rely on torchao directly via git submodule.

Part of #7460
  • Loading branch information
mergennachin authored Jan 2, 2025
1 parent 3ef78ee commit a861294
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
3 changes: 0 additions & 3 deletions examples/models/llama/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
# Install sentencepiece for llama tokenizer
pip install snakeviz sentencepiece

# Install torchao.
pip install "$(dirname "$0")/../../../third-party/ao"

# Install lm-eval for Model Evaluation with lm-evalution-harness
# Install tiktoken for tokenizer
pip install lm_eval==0.4.5
Expand Down
3 changes: 0 additions & 3 deletions examples/models/llama3_2_vision/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ NIGHTLY_VERSION="dev20241112"

# Install torchtune nightly for model definitions.
pip install --pre torchtune==0.4.0.${NIGHTLY_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu --no-cache-dir

# Install torchao.
pip install "$(dirname "$0")/../../../third-party/ao"
3 changes: 0 additions & 3 deletions examples/models/phi-3-mini-lora/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@
pip install torchvision
pip install torchtune
pip install tiktoken

# Install torchao.
pip install "$(dirname "$0")/../../../third-party/ao"
17 changes: 17 additions & 0 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,23 @@ def python_is_compatible():
check=True,
)

LOCAL_REQUIREMENTS = [
"third-party/ao", # We need the latest kernels for fast iteration, so not relying on pypi.
]

# Install packages directly from local copy instead of pypi.
# This is usually not recommended.
subprocess.run(
[
sys.executable,
"-m",
"pip",
"install",
*LOCAL_REQUIREMENTS,
],
check=True,
)

#
# Install executorch pip package. This also makes `flatc` available on the path.
# The --extra-index-url may be necessary if pyproject.toml has a dependency on a
Expand Down

0 comments on commit a861294

Please sign in to comment.