Skip to content

Commit b04d348

Browse files
Merge branch 'main' into smollm2
2 parents c36d1b7 + 3b16bc1 commit b04d348

Some content is hidden

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

53 files changed

+1565
-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
@@ -824,11 +824,26 @@ jobs:
824824
echo "Recipe: $RECIPE"
825825
echo "Quantize: $QUANTIZE"
826826
827-
echo "::group::Set up ExecuTorch"
828827
# The generic Linux job chooses to use base env, not the one setup by the image
829828
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
830829
conda activate "${CONDA_ENV}"
831-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
830+
831+
echo "::group::Setup ExecuTorch"
832+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake"
833+
echo "::endgroup::"
834+
835+
echo "::group::Setup Huggingface"
836+
pip install -U "huggingface_hub[cli]" accelerate
837+
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
838+
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
839+
pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
840+
echo "::endgroup::"
841+
842+
echo "::group::Test MODEL: $MODEL RECIPE: $RECIPE QUANTIZE: $QUANTIZE"
843+
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
844+
python .ci/scripts/test_huggingface_optimum_model.py --model "$MODEL" --recipe "$RECIPE" $QUANTIZE --model_dir "$OUTPUT_DIR"
845+
echo "::endgroup::"
846+
832847
# Build executor_runner with ETdump enabled
833848
PYTHON_EXECUTABLE=python cmake -DPYTHON_EXECUTABLE=python \
834849
-DCMAKE_INSTALL_PREFIX=cmake-out \
@@ -846,25 +861,6 @@ jobs:
846861
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
847862
-Bcmake-out .
848863
cmake --build cmake-out -j16 --target install --config Release
849-
echo "::endgroup::"
850-
851-
echo "::group::Set up Hugging Face"
852-
pip install -U "huggingface_hub[cli]"
853-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
854-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
855-
git clone https://github.com/huggingface/optimum-executorch
856-
pushd optimum-executorch
857-
# There is no release yet, for CI stability, always test from the same commit on main
858-
git checkout $OPTIMUM_ET_COMMIT
859-
python install_dev.py --skip_override_torch
860-
popd
861-
pip list
862-
echo "::endgroup::"
863-
864-
echo "::group::Run tests"
865-
export OUTPUT_DIR="$(pwd)/${MODEL}_${RECIPE}_${QUANTIZE}"
866-
python .ci/scripts/test_huggingface_optimum_model.py --model ${MODEL} --recipe ${RECIPE} ${QUANTIZE} --model_dir ${OUTPUT_DIR}
867-
echo "::endgroup::"
868864
869865
echo "::group::Generate artifacts for performance profiling"
870866
./cmake-out/executor_runner \
@@ -931,16 +927,11 @@ jobs:
931927
${CONDA_RUN} python install_executorch.py
932928
echo "::endgroup::"
933929
934-
echo "::group::Set up Hugging Face"
935-
pip install -U "huggingface_hub[cli]"
936-
huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN
937-
OPTIMUM_ET_COMMIT=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
938-
git clone https://github.com/huggingface/optimum-executorch
939-
pushd optimum-executorch
940-
# There is no release yet, for CI stability, always test from the same commit on main
941-
git checkout $OPTIMUM_ET_COMMIT
942-
${CONDA_RUN} python install_dev.py --skip_override_torch
943-
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}
944935
${CONDA_RUN} pip list
945936
echo "::endgroup::"
946937

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)