Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
2 changes: 1 addition & 1 deletion install/.pins/et-pin.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
91298923a0076c1b41059efb6dad2876426e4b03
6328d41eb87ee2fe8a8c0c5532e0b07ec4e90c73
7 changes: 4 additions & 3 deletions install/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ fi
# NOTE: If a newly-fetched version of the executorch repo changes the value of
# PYTORCH_NIGHTLY_VERSION, you should re-run this script to install the necessary
# package versions.
PYTORCH_NIGHTLY_VERSION=dev20240814

PYTORCH_NIGHTLY_VERSION=dev20240913

# Nightly version for torchvision
VISION_NIGHTLY_VERSION=dev20240814
VISION_NIGHTLY_VERSION=dev20240913

# Nightly version for torchtune
TUNE_NIGHTLY_VERSION=dev20240910
Expand All @@ -74,7 +75,7 @@ fi

# pip packages needed by exir.
REQUIREMENTS_TO_INSTALL=(
torch=="2.5.0.${PYTORCH_NIGHTLY_VERSION}"
torch=="2.6.0.${PYTORCH_NIGHTLY_VERSION}"
torchvision=="0.20.0.${VISION_NIGHTLY_VERSION}"
torchtune=="0.3.0.${TUNE_NIGHTLY_VERSION}"
)
Expand Down
3 changes: 1 addition & 2 deletions torchchat/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def forward(self, x, freqs_cis, mask, input_pos=None):
return self.wo(output)

def replace_attention_with_custom_sdpa_attention(module: nn.Module):
from executorch.examples.models.llama2.custom_ops import ( # noqa
from executorch.extension.llm.custom_ops import ( # noqa
sdpa_with_kv_cache,
)

Expand Down Expand Up @@ -304,7 +304,6 @@ def export_for_et(model, device, output_path) -> str:
edge_manager = edge_manager.to_backend(XnnpackDynamicallyQuantizedPartitioner())
export_program = edge_manager.to_executorch(
ExecutorchBackendConfig(
extract_constant_segment=True,
extract_delegate_segments=True,
passes=[
QuantFusionPass(),
Expand Down
2 changes: 1 addition & 1 deletion torchchat/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def apply_rotary_emb(x: Tensor, freqs_cis: Tensor) -> Tensor:
from executorch.extension.pybindings import portable_lib as exec_lib

# ET changed the way it's loading the custom ops so it's not included in portable_lib but has to be loaded separately.
from executorch.examples.models.llama2.custom_ops import sdpa_with_kv_cache # no-qa
from executorch.extension.llm.custom_ops import sdpa_with_kv_cache # no-qa

class PTEModel(nn.Module):
def __init__(self, config, path) -> None:
Expand Down
7 changes: 3 additions & 4 deletions torchchat/utils/scripts/build_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ if [ -z "${TORCHCHAT_ROOT}" ]; then
# Get the absolute path of the current script
SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# Get the absolute path of the parent directory
TORCHCHAT_ROOT="$(dirname "$SCRIPT_PATH")"
source "$TORCHCHAT_ROOT/scripts/install_utils.sh"
else
source "$TORCHCHAT_ROOT/torchchat/utils/scripts/install_utils.sh"
TORCHCHAT_ROOT="$(dirname "$(dirname "$(dirname "$SCRIPT_PATH")")")"
fi

source "$TORCHCHAT_ROOT/torchchat/utils/scripts/install_utils.sh"

if [ -z "${ET_BUILD_DIR}" ]; then
ET_BUILD_DIR="et-build"
fi
Expand Down
2 changes: 1 addition & 1 deletion torchchat/utils/scripts/install_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ -z "$TORCHCHAT_ROOT" ]; then
fi

install_pip_dependencies() {
echo "Intalling common pip packages"
echo "Installing common pip packages"
pip3 install wheel "cmake>=3.19" ninja zstd
pushd ${TORCHCHAT_ROOT}
pip3 install -r install/requirements.txt
Expand Down
Loading