Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions backends/arm/test/ops/test_silu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from typing import Optional, Tuple

import pytest
import torch
from executorch.backends.arm.test import common
from executorch.backends.arm.test.tester.test_pipeline import (
Expand Down Expand Up @@ -117,7 +116,6 @@ def test_silu_u85_INT_inplace(test_data: input_t):

@common.parametrize("test_data", Silu.test_data)
@common.SkipIfNoModelConverter
@pytest.mark.xfail(reason="MLETORCH-1387: Output differs")
def test_silu_vgf_FP(test_data: input_t):
silu_data = (test_data(), False)
pipeline = VgfPipeline[input_t](
Expand All @@ -128,7 +126,6 @@ def test_silu_vgf_FP(test_data: input_t):

@common.parametrize("test_data", Silu.test_data)
@common.SkipIfNoModelConverter
@pytest.mark.xfail(reason="MLETORCH-1387: Output differs")
def test_silu_vgf_FP_inplace(test_data: input_t):
silu_data = (test_data(), True)
pipeline = VgfPipeline[input_t](
Expand All @@ -139,7 +136,6 @@ def test_silu_vgf_FP_inplace(test_data: input_t):

@common.parametrize("test_data", Silu.test_data)
@common.SkipIfNoModelConverter
@pytest.mark.xfail(reason="MLETORCH-1387: Output differs")
def test_silu_vgf_INT(test_data: input_t):
silu_data = (test_data(), False)
pipeline = VgfPipeline[input_t](
Expand All @@ -153,7 +149,6 @@ def test_silu_vgf_INT(test_data: input_t):

@common.parametrize("test_data", Silu.test_data)
@common.SkipIfNoModelConverter
@pytest.mark.xfail(reason="MLETORCH-1387: Output differs")
def test_silu_vgf_INT_inplace(test_data: input_t):
silu_data = (test_data(), True)
pipeline = VgfPipeline[input_t](
Expand Down
10 changes: 7 additions & 3 deletions backends/arm/test/tester/arm_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ def run_method_and_compare_outputs(
for run_iteration in range(num_runs):
reference_input = inputs if inputs else next(self.generate_random_inputs())

# Avoid issues with inplace operators
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I am sure we will run this in other places, but I see just Silu, which is good. :)

test_input = copy.deepcopy(reference_input)
original_input = copy.deepcopy(reference_input)

input_shapes = [
generated_input.shape if hasattr(generated_input, "shape") else (1,)
for generated_input in reference_input
Expand All @@ -477,16 +481,16 @@ def run_method_and_compare_outputs(
# Run exported module directly
test_outputs, _ = pytree.tree_flatten(
self._calculate_reference_output(
exported_program.module(), reference_input
exported_program.module(), test_input
)
)
else:
# Run lowered model with target
test_outputs, _ = pytree.tree_flatten(
test_stage.run_artifact(reference_input)
test_stage.run_artifact(test_input)
)

logger.info(f"\n Input: {reference_input}")
logger.info(f"\n Input: {original_input}")
logger.info(f"\n Ref output: {reference_outputs}")
logger.info(f"\nTest output: {test_outputs}")

Expand Down
Loading