Skip to content

Commit c6e9d0b

Browse files
authored
Merge branch 'main' into marlin-fix-flaky
2 parents 3145668 + 3b16bc1 commit c6e9d0b

File tree

44 files changed

+1265
-340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1265
-340
lines changed

.github/workflows/pull.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,16 @@ jobs:
970970
PYTHON_EXECUTABLE=python bash backends/vulkan/test/scripts/test_model.sh --build
971971
972972
# Test models serially
973-
models="mv2 mv3 edsr resnet18 resnet50 dl3"
973+
models="mv2 mv3 edsr resnet18 resnet50 dl3 w2l ic3 ic4"
974974
for model in $models; do
975975
python -m examples.vulkan.export --model_name=$model --test
976976
done
977977
978+
# For selected vision models, test with dynamic shapes
979+
models="mv2 resnet18 resnet50 ic3 densenet161"
980+
for model in $models; do
981+
python -m examples.vulkan.export --model_name=$model --test -d
982+
done
978983
979984
test-vulkan-operators-linux:
980985
name: test-vulkan-operators-linux

.github/workflows/trunk.yml

Lines changed: 22 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 \
@@ -845,25 +860,6 @@ jobs:
845860
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
846861
-Bcmake-out .
847862
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::"
867863
868864
echo "::group::Generate artifacts for performance profiling"
869865
./cmake-out/executor_runner \
@@ -930,16 +926,11 @@ jobs:
930926
${CONDA_RUN} python install_executorch.py
931927
echo "::endgroup::"
932928
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
929+
echo "::group::Set up Huggingface"
930+
${CONDA_RUN} pip install -U "huggingface_hub[cli]" accelerate
931+
${CONDA_RUN} huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
932+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
933+
${CONDA_RUN} pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
943934
${CONDA_RUN} pip list
944935
echo "::endgroup::"
945936

backends/arm/operators/op_conv2d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ def define_node(
182182
acc_type = ts.DType.FP32
183183

184184
tosa_graph.addConst(
185-
[1], output.dtype, [input_zp], name=f"{conv2d_output_name}_input_zp"
185+
[1], inputs[0].dtype, [input_zp], name=f"{conv2d_output_name}_input_zp"
186186
)
187187
tosa_graph.addConst(
188188
[1],
189-
output.dtype,
189+
inputs[1].dtype,
190190
weight_zp,
191191
name=f"{conv2d_output_name}_weight_zp",
192192
)
@@ -269,7 +269,7 @@ def define_node(
269269

270270
# For quantized convolution, rescale the output value back to the same
271271
# integer value domain of the next op. Otherwise return float32 output.
272-
if inputs[0].dtype == ts.DType.INT8 or inputs[0].dtype == ts.DType.INT16:
272+
if output.dtype == ts.DType.INT8 or output.dtype == ts.DType.INT16:
273273
# Get scale_factor from input, weight, and output.
274274
input_scale = input_qparams[0].get_scale_per_tensor() # type: ignore[possibly-undefined] # pyre-ignore [61]
275275
per_channel_quant = input_qparams[1].per_channel # pyre-ignore [61]

backends/arm/test/ops/test_linear.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
from typing import Tuple
1010

11-
import pytest
12-
1311
import torch
1412
from executorch.backends.arm.quantizer.arm_quantizer import (
1513
get_symmetric_a16w8_quantization_config,
@@ -313,12 +311,8 @@ def test_linear_16a8w_tosa_INT(test_data: torch.Tensor):
313311
pipeline.run()
314312

315313

316-
@common.parametrize("test_data", test_data_rank1_INT | test_data_rank4_INT)
314+
@common.parametrize("test_data", test_data_all_16a8w)
317315
@common.XfailIfNoCorstone300
318-
@pytest.mark.xfail(
319-
reason="Ethos-U55 A16W8 linear: int16 matmul not yet supported; pending backend support or linear->conv1x1 lowering. See: https://github.com/pytorch/executorch/issues/13947",
320-
strict=False,
321-
)
322316
def test_linear_16a8w_u55_INT16(test_data: torch.Tensor):
323317
"""Test linear operation with 16A8W quantization on U55 (16-bit activations, 8-bit weights)"""
324318
test_data, out_features, has_bias, per_channel_quantization = test_data()
@@ -347,12 +341,8 @@ def test_linear_16a8w_u55_INT16(test_data: torch.Tensor):
347341
pipeline.run()
348342

349343

350-
@common.parametrize("test_data", test_data_rank1_INT | test_data_rank4_INT)
344+
@common.parametrize("test_data", test_data_all_16a8w)
351345
@common.XfailIfNoCorstone320
352-
@pytest.mark.xfail(
353-
reason="Ethos-U55 A16W8 linear: int16 matmul not yet supported; pending backend support or linear->conv1x1 lowering. See: https://github.com/pytorch/executorch/issues/13947",
354-
strict=False,
355-
)
356346
def test_linear_16a8w_u85_INT16(test_data: torch.Tensor):
357347
"""Test linear operation with 16A8W quantization on U85 (16-bit activations, 8-bit weights)"""
358348
test_data, out_features, has_bias, per_channel_quantization = test_data()

0 commit comments

Comments
 (0)