Skip to content

Commit a266f29

Browse files
committed
Update base for Update on "[wip] Use merged data map in module"
Differential Revision: [D83799869](https://our.internmc.facebook.com/intern/diff/D83799869/) [ghstack-poisoned]
2 parents 6ed4758 + 815ae92 commit a266f29

22 files changed

+98
-100
lines changed

.ci/scripts/setup-openvino.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@ set -ex
1010
# shellcheck source=/dev/null
1111
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1212

13-
git clone https://github.com/openvinotoolkit/openvino.git
14-
cd openvino && git checkout releases/2025/1
15-
git submodule update --init --recursive
16-
sudo ./install_build_dependencies.sh
17-
mkdir build && cd build
18-
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON=ON
19-
make -j$(nproc)
13+
# Download and install OpenVINO from release packages
14+
OPENVINO_VERSION="2025.3"
15+
OPENVINO_BUILD="2025.3.0.19807.44526285f24"
16+
OPENVINO_URL="https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_VERSION}/linux/openvino_toolkit_ubuntu22_${OPENVINO_BUILD}_x86_64.tgz"
2017

21-
cd ..
22-
cmake --install build --prefix dist
18+
curl -Lo /tmp/openvino_toolkit.tgz --retry 3 --fail ${OPENVINO_URL}
19+
tar -xzf /tmp/openvino_toolkit.tgz
20+
mv openvino_toolkit_ubuntu22_${OPENVINO_BUILD}_x86_64 openvino
2321

24-
source dist/setupvars.sh
25-
cd ../backends/openvino
22+
source openvino/setupvars.sh
23+
cd backends/openvino
2624
pip install -r requirements.txt
2725
cd scripts
2826
./openvino_build.sh --enable_python

.ci/scripts/test_llama_torchao_lowbit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cmake -DPYTHON_EXECUTABLE=python \
3131
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
3232
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3333
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
34+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
3435
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3536
-DEXECUTORCH_BUILD_XNNPACK=OFF \
3637
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \

.ci/scripts/test_openvino.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -ex
1010
# shellcheck source=/dev/null
1111
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1212

13-
source openvino/dist/setupvars.sh
13+
source openvino/setupvars.sh
1414
cd backends/openvino/tests
1515
python test_runner.py --test_type ops
1616
python test_runner.py --test_type models

.ci/scripts/test_torchao_huggingface_checkpoints.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ if [[ "$TEST_WITH_RUNNER" -eq 1 ]]; then
129129
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
130130
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
131131
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
132+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
132133
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
133134
-DEXECUTORCH_BUILD_XNNPACK=ON \
134135
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \

.ci/scripts/test_yolo12.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ cmake_install_executorch_libraries() {
119119
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
120120
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
121121
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
122+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
123+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
122124
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
123125
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
124126
-B"${build_dir}"
@@ -131,6 +133,8 @@ cmake_install_executorch_libraries() {
131133
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
132134
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
133135
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
136+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
137+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
134138
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
135139
-DEXECUTORCH_ENABLE_LOGGING=ON \
136140
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \

.github/workflows/pull.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,6 @@ jobs:
787787
contents: read
788788
strategy:
789789
fail-fast: false
790-
if: false # TODO Re-enable after fixing timeouts (#14314)
791790
with:
792791
runner: linux.2xlarge
793792
docker-image: ci-image:executorch-ubuntu-22.04-gcc9

.github/workflows/trunk.yml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,26 @@ jobs:
823823
echo "Recipe: $RECIPE"
824824
echo "Quantize: $QUANTIZE"
825825
826-
echo "::group::Set up ExecuTorch"
827826
# The generic Linux job chooses to use base env, not the one setup by the image
828827
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
829828
conda activate "${CONDA_ENV}"
830-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
829+
830+
echo "::group::Setup ExecuTorch"
831+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake"
832+
echo "::endgroup::"
833+
834+
echo "::group::Setup Huggingface"
835+
pip install -U "huggingface_hub[cli]" accelerate
836+
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
837+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
838+
pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
839+
echo "::endgroup::"
840+
841+
echo "::group::Test MODEL: $MODEL RECIPE: $RECIPE QUANTIZE: $QUANTIZE"
842+
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
843+
python .ci/scripts/test_huggingface_optimum_model.py --model "$MODEL" --recipe "$RECIPE" $QUANTIZE --model_dir "$OUTPUT_DIR"
844+
echo "::endgroup::"
845+
831846
# Build executor_runner with ETdump enabled
832847
PYTHON_EXECUTABLE=python cmake -DPYTHON_EXECUTABLE=python \
833848
-DCMAKE_INSTALL_PREFIX=cmake-out \
@@ -836,6 +851,7 @@ jobs:
836851
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
837852
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
838853
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
854+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
839855
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
840856
-DEXECUTORCH_BUILD_XNNPACK=ON \
841857
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
@@ -845,25 +861,6 @@ jobs:
845861
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
846862
-Bcmake-out .
847863
cmake --build cmake-out -j16 --target install --config Release
848-
echo "::endgroup::"
849-
850-
echo "::group::Set up Hugging Face"
851-
pip install -U "huggingface_hub[cli]"
852-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
853-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
854-
git clone https://github.com/huggingface/optimum-executorch
855-
pushd optimum-executorch
856-
# There is no release yet, for CI stability, always test from the same commit on main
857-
git checkout $OPTIMUM_ET_COMMIT
858-
python install_dev.py --skip_override_torch
859-
popd
860-
pip list
861-
echo "::endgroup::"
862-
863-
echo "::group::Run tests"
864-
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
865-
python .ci/scripts/test_huggingface_optimum_model.py --model ${MODEL} --recipe ${RECIPE} ${QUANTIZE} --model_dir ${OUTPUT_DIR}
866-
echo "::endgroup::"
867864
868865
echo "::group::Generate artifacts for performance profiling"
869866
./cmake-out/executor_runner \
@@ -930,16 +927,11 @@ jobs:
930927
${CONDA_RUN} python install_executorch.py
931928
echo "::endgroup::"
932929
933-
echo "::group::Set up Hugging Face"
934-
pip install -U "huggingface_hub[cli]"
935-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
936-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
937-
git clone https://github.com/huggingface/optimum-executorch
938-
pushd optimum-executorch
939-
# There is no release yet, for CI stability, always test from the same commit on main
940-
git checkout $OPTIMUM_ET_COMMIT
941-
${CONDA_RUN} python install_dev.py --skip_override_torch
942-
popd
930+
echo "::group::Set up Huggingface"
931+
${CONDA_RUN} pip install -U "huggingface_hub[cli]" accelerate
932+
${CONDA_RUN} huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
933+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
934+
${CONDA_RUN} pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
943935
${CONDA_RUN} pip list
944936
echo "::endgroup::"
945937

backends/arm/_passes/annotate_decomposed_matmul.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def call(self, graph_module: GraphModule) -> PassResult:
7373
node for node in partition.nodes if node.target in matmul_targets
7474
][0]
7575

76-
if quantized_input:
76+
if quantized_input and not all(
77+
input_node.target in DQ_OPS
78+
for input_node in matmul_node.all_input_nodes
79+
):
7780
matmul_args = matmul_node.all_input_nodes
7881
for node in matmul_args:
7982
# Find the dq-node connected to this mm/bmm arg
@@ -99,7 +102,9 @@ def call(self, graph_module: GraphModule) -> PassResult:
99102

100103
partition_output = list(partition.output_nodes[0].users)[0]
101104
quantized_output = partition_output.target in Q_OPS
102-
if quantized_output:
105+
if quantized_output and not all(
106+
user.target in Q_OPS for user in matmul_node.users
107+
):
103108
with graph_module.graph.inserting_after(matmul_node):
104109
# Create q-node after matmul
105110
q_node = create_node(

backends/arm/test/ops/test_matmul.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
class MatMul(torch.nn.Module):
2424
test_data_generators = {
25+
"rand_rand_2d": lambda: (torch.rand(5, 5), torch.rand(5, 2)),
2526
"rand_rand_3d": lambda: (torch.rand(2, 3, 5), torch.rand(2, 5, 2)),
2627
"rand_rand_4d": lambda: (torch.rand(1, 2, 3, 5), torch.rand(1, 2, 5, 2)),
2728
}
@@ -32,6 +33,7 @@ def forward(self, x: torch.Tensor, y: torch.Tensor):
3233

3334
class MatMulSingleInput(torch.nn.Module):
3435
test_data_generators = {
36+
"rand_2d": lambda: (torch.rand(5, 5),),
3537
"rand_3d": lambda: (torch.rand(2, 5, 5),),
3638
"rand_4d": lambda: (torch.rand(1, 2, 5, 5),),
3739
}
@@ -42,6 +44,11 @@ def forward(self, x: torch.Tensor):
4244

4345
class MatMulCombo(torch.nn.Module):
4446
test_data_generators = {
47+
"rand_rand_rand_2d": lambda: (
48+
torch.rand(5, 5),
49+
torch.rand(5, 2),
50+
torch.rand(2, 5),
51+
),
4552
"rand_rand_rand_3d": lambda: (
4653
torch.rand(2, 5, 5),
4754
torch.rand(2, 5, 2),

backends/cadence/aot/replace_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ def call_operator(self, op, args, kwargs, meta):
15901590
updated_args = list(args)
15911591
for op_arg_index in args_to_be_replaced:
15921592
arg = args[op_arg_index]
1593-
if not arg.is_tensor():
1593+
if not isinstance(arg, ProxyValue) or not arg.is_tensor():
15941594
return super().call_operator(op, args, kwargs, meta)
15951595

15961596
if not isinstance(arg.node.target, EdgeOpOverload):

0 commit comments

Comments
 (0)