diff --git a/forge/test/operators/pytorch/eltwise_unary/__init__.py b/forge/test/operators/pytorch/eltwise_unary/__init__.py index 2332467ef..5f28381a7 100644 --- a/forge/test/operators/pytorch/eltwise_unary/__init__.py +++ b/forge/test/operators/pytorch/eltwise_unary/__init__.py @@ -1,3 +1,11 @@ # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC # SPDX-License-Identifier: Apache-2.0 + +from .models import ModelFromAnotherOp, ModelDirect, ModelConstEvalPass + +__all__ = [ + "ModelFromAnotherOp", + "ModelDirect", + "ModelConstEvalPass", +] diff --git a/forge/test/operators/pytorch/eltwise_unary/models.py b/forge/test/operators/pytorch/eltwise_unary/models.py new file mode 100644 index 000000000..dad298fb8 --- /dev/null +++ b/forge/test/operators/pytorch/eltwise_unary/models.py @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC + +# SPDX-License-Identifier: Apache-2.0 + +import torch +import torch.nn as nn + +from forge.op_repo import TensorShape + + +class ModelFromAnotherOp(nn.Module): + def __init__(self, operator, kwargs): + super().__init__() + self.testname = "Element_wise_unary_operators_test_op_src_from_another_op" + self.operator = operator + self.kwargs = kwargs + + def forward(self, x): + xx = torch.add(x, x) + return self.operator(xx, **self.kwargs) + + +class ModelDirect(nn.Module): + def __init__(self, operator, kwargs): + super().__init__() + self.testname = "Element_wise_unary_operators_test_op_src_from_host" + self.operator = operator + self.kwargs = kwargs + + def forward(self, x): + return self.operator(x, **self.kwargs) + + +class ModelConstEvalPass(nn.Module): + def __init__(self, operator, shape: TensorShape, kwargs): + super().__init__() + self.testname = "Element_wise_unary_operators_test_op_src_const_eval_pass" + self.operator = operator + self.kwargs = kwargs + self.c = (torch.rand(shape, requires_grad=False) - 0.5).detach() + + def forward(self, x): + cc = self.operator(self.c, **self.kwargs) + xx = self.operator(x, **self.kwargs) + return torch.add(xx, cc) diff --git a/forge/test/operators/pytorch/eltwise_unary/test_unary.py b/forge/test/operators/pytorch/eltwise_unary/test_unary.py index 568d7e50d..3b24d8489 100644 --- a/forge/test/operators/pytorch/eltwise_unary/test_unary.py +++ b/forge/test/operators/pytorch/eltwise_unary/test_unary.py @@ -49,11 +49,7 @@ # (/) Reuse inputs for selected operators -import pytest import torch -import torch.nn as nn -import forge -from forge.op_repo import TensorShape from typing import List, Dict from loguru import logger @@ -69,42 +65,7 @@ from test.operators.utils import TestCollectionCommon from test.operators.utils import ValueRanges - -class ModelFromAnotherOp(nn.Module): - def __init__(self, operator, kwargs): - super().__init__() - self.testname = "Element_wise_unary_operators_test_op_src_from_another_op" - self.operator = operator - self.kwargs = kwargs - - def forward(self, x): - xx = torch.add(x, x) - return self.operator(xx, **self.kwargs) - - -class ModelDirect(nn.Module): - def __init__(self, operator, kwargs): - super().__init__() - self.testname = "Element_wise_unary_operators_test_op_src_from_host" - self.operator = operator - self.kwargs = kwargs - - def forward(self, x): - return self.operator(x, **self.kwargs) - - -class ModelConstEvalPass(nn.Module): - def __init__(self, operator, shape: TensorShape, kwargs): - super().__init__() - self.testname = "Element_wise_unary_operators_test_op_src_const_eval_pass" - self.operator = operator - self.kwargs = kwargs - self.c = (torch.rand(shape, requires_grad=False) - 0.5).detach() - - def forward(self, x): - cc = self.operator(self.c, **self.kwargs) - xx = self.operator(x, **self.kwargs) - return torch.add(xx, cc) +from .models import ModelFromAnotherOp, ModelDirect, ModelConstEvalPass class TestVerification: diff --git a/forge/test/operators/pytorch/tm/test_reshape.py b/forge/test/operators/pytorch/tm/test_reshape.py new file mode 100644 index 000000000..9ccb5ea4e --- /dev/null +++ b/forge/test/operators/pytorch/tm/test_reshape.py @@ -0,0 +1,358 @@ +# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC + +# SPDX-License-Identifier: Apache-2.0 + +# TODO: Add test plan header here + +import forge +import math +import torch +import pytest +import random +import os + +from typing import List, Dict +from loguru import logger + +from forge.verify.config import VerifyConfig + +from forge.verify.value_checkers import AllCloseValueChecker +from forge.verify.verify import verify as forge_verify + +from test.operators.utils import InputSourceFlags, VerifyUtils +from test.operators.utils import InputSource +from test.operators.utils import TestVector +from test.operators.utils import TestPlan +from test.operators.utils import TestPlanUtils +from test.operators.utils import FailingReasons +from test.operators.utils.compat import TestDevice +from test.operators.utils import TestCollection +from test.operators.utils import TestCollectionCommon +from test.operators.utils import ValueRanges + +from test.operators.pytorch.eltwise_unary import ModelFromAnotherOp, ModelDirect, ModelConstEvalPass + + +def prime_factors(n): + """Return the prime factors of a given number.""" + factors = [] + while n % 2 == 0: + factors.append(2) + n //= 2 + + for i in range(3, int(math.sqrt(n)) + 1, 2): + while n % i == 0: + factors.append(i) + n //= i + + if n > 2: + factors.append(n) + + return factors + + +def generate_random_shape(source_shape, max_dims=4): + """ + Generates a random shape with the same volume as the source shape. + Args: + source_shape (tuple): The original shape of the tensor. + max_dims (int, optional): The maximum number of dimensions for the generated shape. Defaults to 4. + Returns: + tuple: A randomly generated shape with the same volume as the source shape. + Raises: + ValueError: If the volume or number of dimensions is not a positive integer. + ValueError: If the generated shape does not match the desired volume. + Notes: + - The function ensures that the product of the dimensions of the generated shape equals the product of the dimensions of the source shape. + - If the generated shape is the same as the source shape, an additional dimension with size 1 is appended to the shape. + """ + + rng = random.Random(math.prod(source_shape) + 1) + + vol = math.prod(source_shape) + num_dims = rng.randint(1, max_dims) + + if vol <= 0 or num_dims <= 0: + raise ValueError("Volume and number of dimensions must be positive integers.") + + # Step 1: Get the prime factors of vol + factors = prime_factors(vol) + + # Step 2: Start with dimensions initialized to 1 + shape = [1] * num_dims + + # Step 3: Randomly assign factors to dimensions + for factor in factors: + random_dim = rng.randint(0, num_dims - 1) + shape[random_dim] *= factor + + # Step 4: Ensure the final shape has the correct volume + if math.prod(shape) != vol: + raise ValueError("Generated shape does not match the desired volume.") + + return tuple(shape) + + +class TestVerification: + + MODEL_TYPES = { + InputSource.FROM_ANOTHER_OP: ModelFromAnotherOp, + InputSource.FROM_HOST: ModelDirect, + InputSource.FROM_DRAM_QUEUE: ModelDirect, + InputSource.CONST_EVAL_PASS: ModelConstEvalPass, + } + + @classmethod + def verify( + cls, + test_device: TestDevice, + test_vector: TestVector, + input_params: List[Dict] = [], + warm_reset: bool = False, + ): + + input_source_flag: InputSourceFlags = None + if test_vector.input_source in (InputSource.FROM_DRAM_QUEUE,): + input_source_flag = InputSourceFlags.FROM_DRAM + + operator = getattr(torch, test_vector.operator) + kwargs = test_vector.kwargs if test_vector.kwargs else {} + + model_type = cls.MODEL_TYPES[test_vector.input_source] + pytorch_model = ( + model_type(operator, test_vector.input_shape, kwargs) + if test_vector.input_source in (InputSource.CONST_EVAL_PASS,) + else model_type(operator, kwargs) + ) + + input_shapes = tuple([test_vector.input_shape]) + + logger.trace(f"***input_shapes: {input_shapes}") + + VerifyUtils.verify( + model=pytorch_model, + test_device=test_device, + input_shapes=input_shapes, + input_params=input_params, + input_source_flag=input_source_flag, + dev_data_format=test_vector.dev_data_format, + math_fidelity=test_vector.math_fidelity, + warm_reset=warm_reset, + value_range=ValueRanges.SMALL, + deprecated_verification=False, + verify_config=VerifyConfig(value_checker=AllCloseValueChecker()), + ) + + +class TestParamsData: + + __test__ = False + + test_plan: TestPlan = None + + # fmt: off + specific_reshapes = { + # Flatten Reshapes: + (8, 8, 8): [(512,)], + (1, 2, 2, 2): [(4, 2), (8,), ], + # Dynamic Shape Reshapes: + (1, 49, 2304): [(1, -1, 3, 24, 32), + (1, 49, 6, -1), + (-1, ), + (1, -1)], + (3, 4, 5): [(3, -1), (-1, 15)], + (2, 2, 2, 2): [(4, -1), (8, -1)], + # Collapse Rank Reshapes: + (2, 3, 4, 5): [(6, 4, 5), (4, 6, 5)], + (2, 2, 3, 4): [(4, 3, 4), (2, 6, 4)], + (3, 3, 3, 3): [(9, 3, 3), (3, 9, 3)], + (1, 2, 3, 4, 5): [(2, 3, 4, 5), (6, 4, 5)], + (2, 2, 2, 2, 2): [(4, 2, 2, 2), (8, 2, 2)], + (2, 3, 4, 8): [(6, 4, 8), (24, 8)], + # Expand Rank Reshapes: + (6, 4, 5): [(2, 3, 4, 5), + (1, 6, 4, 5), + (2, 3, 2, 2, 5)], + (12, 8, 10): [(2, 6, 8, 10), + (2, 2, 3, 8, 10), + (1, 3, 4, 8, 10)], + # Channel Manipulation Reshapes: + (1, 32, 2560): [(1, 32, 20, 128), + (1, 32, 40, 64), + (1, 32, 10, 256), + (1, 32, 5, 512), + (1, 32, 80, 32)], + (1, 64, 1280): [(1, 64, 10, 128), + (1, 64, 20, 64), + (1, 64, 5, 256), + (1, 64, 40, 32), + (1, 64, 80, 16)], + # Edge Case Reshapes: + (0,): [(0, 0, 1), + (0, 1, 0), + (1, 0, 0), + (0, 0, 10)], + } + # fmt: on + + @classmethod + def generate_random_kwargs(cls, test_vector: TestVector): + """ + This method generates a random target shape based on the input shape of the + test vector and a seed value derived from the sum of the elements in the + input shape. The generated target shape is then returned as a dictionary + within a list. + Args: + test_vector (TestVector): The test vector containing the input shape. + Returns: + list: A list containing a dictionary with the generated target shape. + """ + + input_shape = test_vector.input_shape + seed = 0 + for i in range(len(input_shape)): + seed += input_shape[i] + target_shape = generate_random_shape(test_vector.input_shape) + return [ + {"shape": target_shape}, + ] + + @classmethod + def generate_specific_kwargs(cls, test_vector: TestVector): + """ + Generate specific keyword arguments for reshaping tensors based on the given test vector. + Args: + cls: The class that contains specific reshapes mapping. + test_vector (TestVector): An instance of TestVector containing the input shape. + Returns: + list: A list of dictionaries, each containing a target shape for reshaping. + """ + + input_shape = test_vector.input_shape + target_shapes = [] + for item in cls.specific_reshapes[input_shape]: + target_shapes.append({"shape": item}) + return target_shapes + + +TestParamsData.test_plan = TestPlan( + verify=lambda test_device, test_vector: TestVerification.verify( + test_device, + test_vector, + ), + collections=[ + # Test operators with all shapes and input sources collection: + TestCollection( + operators=["reshape"], + input_sources=TestCollectionCommon.all.input_sources, + input_shapes=TestCollectionCommon.all.input_shapes, + kwargs=lambda test_vector: TestParamsData.generate_random_kwargs(test_vector), + ), + # Test Data formats collection: + TestCollection( + operators=["reshape"], + input_sources=TestCollectionCommon.single.input_sources, + input_shapes=TestCollectionCommon.single.input_shapes, + kwargs=lambda test_vector: TestParamsData.generate_random_kwargs(test_vector), + dev_data_formats=[ + item + for item in TestCollectionCommon.all.dev_data_formats + if item not in TestCollectionCommon.single.dev_data_formats + ], + math_fidelities=TestCollectionCommon.single.math_fidelities, + ), + # Test Math fidelities collection: + TestCollection( + operators=["reshape"], + input_sources=TestCollectionCommon.single.input_sources, + input_shapes=TestCollectionCommon.single.input_shapes, + kwargs=lambda test_vector: TestParamsData.generate_random_kwargs(test_vector), + dev_data_formats=TestCollectionCommon.single.dev_data_formats, + math_fidelities=TestCollectionCommon.all.math_fidelities, + ), + # Test specific classes of reshape operations collection: + TestCollection( + operators=["reshape"], + input_sources=TestCollectionCommon.all.input_sources, + input_shapes=TestParamsData.specific_reshapes.keys(), + kwargs=lambda test_vector: TestParamsData.generate_specific_kwargs(test_vector), + ), + ], + failing_rules=[ + TestCollection( + criteria=lambda test_vector: test_vector.get_id() + in TestPlanUtils.load_test_ids_from_file( + f"{os.path.dirname(__file__)}/test_reshape_ids_failed_allclose_value_checker.txt" + ), + failing_reason=FailingReasons.DATA_MISMATCH, + ), + TestCollection( + input_shapes=[(1, 10000)], + failing_reason=FailingReasons.INFERENCE_FAILED, + ), + TestCollection( + input_shapes=[ + (100, 100), + (1000, 100), + (89, 3), + (1, 64, 1), + (1, 100, 100), + (11, 17, 41), + (1, 2, 3, 4), + (1, 11, 45, 17), + (1, 11, 17, 41), + (1, 13, 89, 3), + (8, 1, 10, 1000), + (11, 32, 32, 64), + (8, 8, 8), + ], + failing_reason=FailingReasons.INFERENCE_FAILED, + ), + TestCollection( + input_shapes=[(1, 2, 2, 2)], + criteria=lambda test_vector: test_vector.kwargs is not None + and "shape" in test_vector.kwargs + and test_vector.kwargs["shape"] == (8,), + failing_reason=FailingReasons.INFERENCE_FAILED, + ), + TestCollection( + input_shapes=[(1, 49, 2304)], + criteria=lambda test_vector: test_vector.kwargs is not None + and "shape" in test_vector.kwargs + and test_vector.kwargs["shape"] == (-1,), + failing_reason=FailingReasons.INFERENCE_FAILED, + ), + TestCollection( + input_shapes=[(0,)], + failing_reason=FailingReasons.UNSUPPORTED_DIMENSION, + ), + ], +) + + +def get_test_plans() -> List[TestPlan]: + return [TestParamsData.test_plan] + + +@pytest.mark.parametrize( + "input_shape, target_shape", + [ + ((1, 4), (4, 1, 1)), + ((1, 100), (10, 10)), + ((1, 3, 4), (6, 2)), + ], +) +def test_reshape_accuracy(input_shape, target_shape): + + inputs = [torch.ones(input_shape) - 0.1] # value: 0.9000 + + pytorch_model = ModelDirect(torch.reshape, {"shape": target_shape}) + compiled_model = forge.compile(pytorch_model, sample_inputs=inputs) + + # forge.verify.verify.verify as forge_verify: + forge_verify( + inputs, + pytorch_model, + compiled_model, + verify_cfg=VerifyConfig(value_checker=AllCloseValueChecker()), + ) diff --git a/forge/test/operators/pytorch/tm/test_reshape_ids_failed_allclose_value_checker.txt b/forge/test/operators/pytorch/tm/test_reshape_ids_failed_allclose_value_checker.txt new file mode 100644 index 000000000..aaac37678 --- /dev/null +++ b/forge/test/operators/pytorch/tm/test_reshape_ids_failed_allclose_value_checker.txt @@ -0,0 +1,316 @@ +reshape-FROM_ANOTHER_OP-{'shape': (4, 1, 1)}-(1, 4)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (10, 10)}-(1, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (500, 1, 1)}-(1, 500)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (16, 2, 1, 2)}-(1, 64)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2, 48)}-(1, 96)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (3, 1, 1, 1)}-(1, 3)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (4, 3, 1)}-(3, 4)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (51, 15)}-(45, 17)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (16, 2, 1, 2)}-(64, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (10000, 1)}-(10, 1000)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2480, 4)}-(9920, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (625, 8, 2)}-(10000, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2, 16, 64)}-(32, 64)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 64, 1, 240)}-(160, 96)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 697)}-(17, 41)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (6, 2)}-(1, 3, 4)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (15, 17, 3)}-(1, 45, 17)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (23, 1, 1, 1)}-(1, 1, 23)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (50, 16, 125)}-(1, 1000, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2500, 1, 4)}-(1, 10, 1000)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2, 4960)}-(1, 9920, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (5, 125, 4, 4)}-(1, 10000, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (4, 512)}-(1, 32, 64)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 1536, 10)}-(1, 160, 96)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 697)}-(1, 17, 41)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 3, 1, 89)}-(1, 89, 3)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (3, 1, 8)}-(2, 3, 4)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (255, 11, 3)}-(11, 45, 17)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 1, 253)}-(11, 1, 23)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (22, 4, 8)}-(11, 64, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2, 1250, 400)}-(100, 100, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 10, 40, 2500)}-(10, 1000, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (25, 4000)}-(10, 10000, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 65536)}-(32, 32, 64)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (8, 3840, 2, 16)}-(64, 160, 96)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (89, 1, 39)}-(13, 89, 3)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 1, 253)}-(1, 11, 1, 23)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (11, 1, 64)}-(1, 11, 64, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (25000, 20, 2, 1)}-(1, 100, 100, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1250, 800)}-(1, 10, 1000, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (25, 200, 2)}-(1, 1, 10, 1000)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 320, 1, 31)}-(1, 1, 9920, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (10, 250, 10, 4)}-(1, 10, 10000, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (4, 2, 8192)}-(1, 32, 32, 64)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (15360, 16, 4)}-(1, 64, 160, 96)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (51, 1, 495)}-(3, 11, 45, 17)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (6, 1, 8)}-(2, 2, 3, 4)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1012, 1)}-(4, 11, 1, 23)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (110, 2, 16, 1)}-(5, 11, 64, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (32, 93750, 2)}-(6, 100, 100, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (625, 448, 1, 25)}-(7, 10, 1000, 100)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (64, 5, 1, 279)}-(9, 1, 9920, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (50, 625, 32, 1)}-(10, 10, 10000, 1)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (40, 294912)}-(12, 64, 160, 96)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (143, 697)}-(13, 11, 17, 41)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (7, 2, 3471)}-(14, 13, 89, 3)-None-None +reshape-FROM_HOST-{'shape': (4, 1, 1)}-(1, 4)-None-None +reshape-FROM_HOST-{'shape': (10, 10)}-(1, 100)-None-None +reshape-FROM_HOST-{'shape': (500, 1, 1)}-(1, 500)-None-None +reshape-FROM_HOST-{'shape': (16, 2, 1, 2)}-(1, 64)-None-None +reshape-FROM_HOST-{'shape': (2, 48)}-(1, 96)-None-None +reshape-FROM_HOST-{'shape': (3, 1, 1, 1)}-(1, 3)-None-None +reshape-FROM_HOST-{'shape': (4, 3, 1)}-(3, 4)-None-None +reshape-FROM_HOST-{'shape': (51, 15)}-(45, 17)-None-None +reshape-FROM_HOST-{'shape': (16, 2, 1, 2)}-(64, 1)-None-None +reshape-FROM_HOST-{'shape': (10000, 1)}-(10, 1000)-None-None +reshape-FROM_HOST-{'shape': (2480, 4)}-(9920, 1)-None-None +reshape-FROM_HOST-{'shape': (625, 8, 2)}-(10000, 1)-None-None +reshape-FROM_HOST-{'shape': (2, 16, 64)}-(32, 64)-None-None +reshape-FROM_HOST-{'shape': (1, 64, 1, 240)}-(160, 96)-None-None +reshape-FROM_HOST-{'shape': (1, 697)}-(17, 41)-None-None +reshape-FROM_HOST-{'shape': (6, 2)}-(1, 3, 4)-None-None +reshape-FROM_HOST-{'shape': (15, 17, 3)}-(1, 45, 17)-None-None +reshape-FROM_HOST-{'shape': (23, 1, 1, 1)}-(1, 1, 23)-None-None +reshape-FROM_HOST-{'shape': (50, 16, 125)}-(1, 1000, 100)-None-None +reshape-FROM_HOST-{'shape': (2500, 1, 4)}-(1, 10, 1000)-None-None +reshape-FROM_HOST-{'shape': (2, 4960)}-(1, 9920, 1)-None-None +reshape-FROM_HOST-{'shape': (5, 125, 4, 4)}-(1, 10000, 1)-None-None +reshape-FROM_HOST-{'shape': (4, 512)}-(1, 32, 64)-None-None +reshape-FROM_HOST-{'shape': (1, 1536, 10)}-(1, 160, 96)-None-None +reshape-FROM_HOST-{'shape': (1, 697)}-(1, 17, 41)-None-None +reshape-FROM_HOST-{'shape': (1, 3, 1, 89)}-(1, 89, 3)-None-None +reshape-FROM_HOST-{'shape': (3, 1, 8)}-(2, 3, 4)-None-None +reshape-FROM_HOST-{'shape': (255, 11, 3)}-(11, 45, 17)-None-None +reshape-FROM_HOST-{'shape': (1, 1, 253)}-(11, 1, 23)-None-None +reshape-FROM_HOST-{'shape': (22, 4, 8)}-(11, 64, 1)-None-None +reshape-FROM_HOST-{'shape': (2, 1250, 400)}-(100, 100, 100)-None-None +reshape-FROM_HOST-{'shape': (1, 10, 40, 2500)}-(10, 1000, 100)-None-None +reshape-FROM_HOST-{'shape': (25, 4000)}-(10, 10000, 1)-None-None +reshape-FROM_HOST-{'shape': (1, 65536)}-(32, 32, 64)-None-None +reshape-FROM_HOST-{'shape': (8, 3840, 2, 16)}-(64, 160, 96)-None-None +reshape-FROM_HOST-{'shape': (89, 1, 39)}-(13, 89, 3)-None-None +reshape-FROM_HOST-{'shape': (1, 1, 253)}-(1, 11, 1, 23)-None-None +reshape-FROM_HOST-{'shape': (11, 1, 64)}-(1, 11, 64, 1)-None-None +reshape-FROM_HOST-{'shape': (25000, 20, 2, 1)}-(1, 100, 100, 100)-None-None +reshape-FROM_HOST-{'shape': (1250, 800)}-(1, 10, 1000, 100)-None-None +reshape-FROM_HOST-{'shape': (25, 200, 2)}-(1, 1, 10, 1000)-None-None +reshape-FROM_HOST-{'shape': (1, 320, 1, 31)}-(1, 1, 9920, 1)-None-None +reshape-FROM_HOST-{'shape': (10, 250, 10, 4)}-(1, 10, 10000, 1)-None-None +reshape-FROM_HOST-{'shape': (4, 2, 8192)}-(1, 32, 32, 64)-None-None +reshape-FROM_HOST-{'shape': (15360, 16, 4)}-(1, 64, 160, 96)-None-None +reshape-FROM_HOST-{'shape': (51, 1, 495)}-(3, 11, 45, 17)-None-None +reshape-FROM_HOST-{'shape': (6, 1, 8)}-(2, 2, 3, 4)-None-None +reshape-FROM_HOST-{'shape': (1012, 1)}-(4, 11, 1, 23)-None-None +reshape-FROM_HOST-{'shape': (110, 2, 16, 1)}-(5, 11, 64, 1)-None-None +reshape-FROM_HOST-{'shape': (32, 93750, 2)}-(6, 100, 100, 100)-None-None +reshape-FROM_HOST-{'shape': (625, 448, 1, 25)}-(7, 10, 1000, 100)-None-None +reshape-FROM_HOST-{'shape': (64, 5, 1, 279)}-(9, 1, 9920, 1)-None-None +reshape-FROM_HOST-{'shape': (50, 625, 32, 1)}-(10, 10, 10000, 1)-None-None +reshape-FROM_HOST-{'shape': (40, 294912)}-(12, 64, 160, 96)-None-None +reshape-FROM_HOST-{'shape': (143, 697)}-(13, 11, 17, 41)-None-None +reshape-FROM_HOST-{'shape': (7, 2, 3471)}-(14, 13, 89, 3)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, 1, 1)}-(1, 4)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (10, 10)}-(1, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (500, 1, 1)}-(1, 500)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (16, 2, 1, 2)}-(1, 64)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2, 48)}-(1, 96)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (3, 1, 1, 1)}-(1, 3)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, 3, 1)}-(3, 4)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (51, 15)}-(45, 17)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (16, 2, 1, 2)}-(64, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (10000, 1)}-(10, 1000)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2480, 4)}-(9920, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (625, 8, 2)}-(10000, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2, 16, 64)}-(32, 64)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 64, 1, 240)}-(160, 96)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 697)}-(17, 41)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (6, 2)}-(1, 3, 4)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (15, 17, 3)}-(1, 45, 17)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (23, 1, 1, 1)}-(1, 1, 23)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (50, 16, 125)}-(1, 1000, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2500, 1, 4)}-(1, 10, 1000)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2, 4960)}-(1, 9920, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (5, 125, 4, 4)}-(1, 10000, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, 512)}-(1, 32, 64)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 1536, 10)}-(1, 160, 96)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 697)}-(1, 17, 41)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 3, 1, 89)}-(1, 89, 3)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (3, 1, 8)}-(2, 3, 4)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (255, 11, 3)}-(11, 45, 17)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 1, 253)}-(11, 1, 23)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (22, 4, 8)}-(11, 64, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2, 1250, 400)}-(100, 100, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 10, 40, 2500)}-(10, 1000, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (25, 4000)}-(10, 10000, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 65536)}-(32, 32, 64)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (8, 3840, 2, 16)}-(64, 160, 96)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (89, 1, 39)}-(13, 89, 3)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 1, 253)}-(1, 11, 1, 23)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (11, 1, 64)}-(1, 11, 64, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (25000, 20, 2, 1)}-(1, 100, 100, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1250, 800)}-(1, 10, 1000, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (25, 200, 2)}-(1, 1, 10, 1000)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 320, 1, 31)}-(1, 1, 9920, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (10, 250, 10, 4)}-(1, 10, 10000, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, 2, 8192)}-(1, 32, 32, 64)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (15360, 16, 4)}-(1, 64, 160, 96)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (51, 1, 495)}-(3, 11, 45, 17)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (6, 1, 8)}-(2, 2, 3, 4)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1012, 1)}-(4, 11, 1, 23)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (110, 2, 16, 1)}-(5, 11, 64, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (32, 93750, 2)}-(6, 100, 100, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (625, 448, 1, 25)}-(7, 10, 1000, 100)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (64, 5, 1, 279)}-(9, 1, 9920, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (50, 625, 32, 1)}-(10, 10, 10000, 1)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (40, 294912)}-(12, 64, 160, 96)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (143, 697)}-(13, 11, 17, 41)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (7, 2, 3471)}-(14, 13, 89, 3)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, 1, 1)}-(1, 4)-None-None +reshape-CONST_EVAL_PASS-{'shape': (10, 10)}-(1, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (500, 1, 1)}-(1, 500)-None-None +reshape-CONST_EVAL_PASS-{'shape': (16, 2, 1, 2)}-(1, 64)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2, 48)}-(1, 96)-None-None +reshape-CONST_EVAL_PASS-{'shape': (3, 1, 1, 1)}-(1, 3)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, 3, 1)}-(3, 4)-None-None +reshape-CONST_EVAL_PASS-{'shape': (51, 15)}-(45, 17)-None-None +reshape-CONST_EVAL_PASS-{'shape': (16, 2, 1, 2)}-(64, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (10000, 1)}-(10, 1000)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2480, 4)}-(9920, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (625, 8, 2)}-(10000, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2, 16, 64)}-(32, 64)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 64, 1, 240)}-(160, 96)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 697)}-(17, 41)-None-None +reshape-CONST_EVAL_PASS-{'shape': (6, 2)}-(1, 3, 4)-None-None +reshape-CONST_EVAL_PASS-{'shape': (15, 17, 3)}-(1, 45, 17)-None-None +reshape-CONST_EVAL_PASS-{'shape': (23, 1, 1, 1)}-(1, 1, 23)-None-None +reshape-CONST_EVAL_PASS-{'shape': (50, 16, 125)}-(1, 1000, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2500, 1, 4)}-(1, 10, 1000)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2, 4960)}-(1, 9920, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (5, 125, 4, 4)}-(1, 10000, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, 512)}-(1, 32, 64)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 1536, 10)}-(1, 160, 96)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 697)}-(1, 17, 41)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 3, 1, 89)}-(1, 89, 3)-None-None +reshape-CONST_EVAL_PASS-{'shape': (3, 1, 8)}-(2, 3, 4)-None-None +reshape-CONST_EVAL_PASS-{'shape': (255, 11, 3)}-(11, 45, 17)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 1, 253)}-(11, 1, 23)-None-None +reshape-CONST_EVAL_PASS-{'shape': (22, 4, 8)}-(11, 64, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2, 1250, 400)}-(100, 100, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 10, 40, 2500)}-(10, 1000, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (25, 4000)}-(10, 10000, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 65536)}-(32, 32, 64)-None-None +reshape-CONST_EVAL_PASS-{'shape': (8, 3840, 2, 16)}-(64, 160, 96)-None-None +reshape-CONST_EVAL_PASS-{'shape': (89, 1, 39)}-(13, 89, 3)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 1, 253)}-(1, 11, 1, 23)-None-None +reshape-CONST_EVAL_PASS-{'shape': (11, 1, 64)}-(1, 11, 64, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (25000, 20, 2, 1)}-(1, 100, 100, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1250, 800)}-(1, 10, 1000, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (25, 200, 2)}-(1, 1, 10, 1000)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 320, 1, 31)}-(1, 1, 9920, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (10, 250, 10, 4)}-(1, 10, 10000, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, 2, 8192)}-(1, 32, 32, 64)-None-None +reshape-CONST_EVAL_PASS-{'shape': (15360, 16, 4)}-(1, 64, 160, 96)-None-None +reshape-CONST_EVAL_PASS-{'shape': (51, 1, 495)}-(3, 11, 45, 17)-None-None +reshape-CONST_EVAL_PASS-{'shape': (6, 1, 8)}-(2, 2, 3, 4)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1012, 1)}-(4, 11, 1, 23)-None-None +reshape-CONST_EVAL_PASS-{'shape': (110, 2, 16, 1)}-(5, 11, 64, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (32, 93750, 2)}-(6, 100, 100, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (625, 448, 1, 25)}-(7, 10, 1000, 100)-None-None +reshape-CONST_EVAL_PASS-{'shape': (64, 5, 1, 279)}-(9, 1, 9920, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (50, 625, 32, 1)}-(10, 10, 10000, 1)-None-None +reshape-CONST_EVAL_PASS-{'shape': (40, 294912)}-(12, 64, 160, 96)-None-None +reshape-CONST_EVAL_PASS-{'shape': (143, 697)}-(13, 11, 17, 41)-None-None +reshape-CONST_EVAL_PASS-{'shape': (7, 2, 3471)}-(14, 13, 89, 3)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (4, 2)}-(1, 2, 2, 2)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, -1, 3, 24, 32)}-(1, 49, 2304)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 49, 6, -1)}-(1, 49, 2304)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, -1)}-(1, 49, 2304)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (3, -1)}-(3, 4, 5)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (-1, 15)}-(3, 4, 5)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (4, -1)}-(2, 2, 2, 2)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (8, -1)}-(2, 2, 2, 2)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (4, 6, 5)}-(2, 3, 4, 5)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2, 6, 4)}-(2, 2, 3, 4)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (3, 9, 3)}-(3, 3, 3, 3)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (24, 8)}-(2, 3, 4, 8)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (2, 3, 2, 2, 5)}-(6, 4, 5)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 32, 20, 128)}-(1, 32, 2560)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 32, 40, 64)}-(1, 32, 2560)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 32, 10, 256)}-(1, 32, 2560)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 32, 5, 512)}-(1, 32, 2560)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 32, 80, 32)}-(1, 32, 2560)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 64, 10, 128)}-(1, 64, 1280)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 64, 20, 64)}-(1, 64, 1280)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 64, 5, 256)}-(1, 64, 1280)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 64, 40, 32)}-(1, 64, 1280)-None-None +reshape-FROM_ANOTHER_OP-{'shape': (1, 64, 80, 16)}-(1, 64, 1280)-None-None +reshape-FROM_HOST-{'shape': (4, 2)}-(1, 2, 2, 2)-None-None +reshape-FROM_HOST-{'shape': (1, -1, 3, 24, 32)}-(1, 49, 2304)-None-None +reshape-FROM_HOST-{'shape': (1, 49, 6, -1)}-(1, 49, 2304)-None-None +reshape-FROM_HOST-{'shape': (1, -1)}-(1, 49, 2304)-None-None +reshape-FROM_HOST-{'shape': (3, -1)}-(3, 4, 5)-None-None +reshape-FROM_HOST-{'shape': (-1, 15)}-(3, 4, 5)-None-None +reshape-FROM_HOST-{'shape': (4, -1)}-(2, 2, 2, 2)-None-None +reshape-FROM_HOST-{'shape': (8, -1)}-(2, 2, 2, 2)-None-None +reshape-FROM_HOST-{'shape': (4, 6, 5)}-(2, 3, 4, 5)-None-None +reshape-FROM_HOST-{'shape': (2, 6, 4)}-(2, 2, 3, 4)-None-None +reshape-FROM_HOST-{'shape': (3, 9, 3)}-(3, 3, 3, 3)-None-None +reshape-FROM_HOST-{'shape': (24, 8)}-(2, 3, 4, 8)-None-None +reshape-FROM_HOST-{'shape': (2, 3, 2, 2, 5)}-(6, 4, 5)-None-None +reshape-FROM_HOST-{'shape': (1, 32, 20, 128)}-(1, 32, 2560)-None-None +reshape-FROM_HOST-{'shape': (1, 32, 40, 64)}-(1, 32, 2560)-None-None +reshape-FROM_HOST-{'shape': (1, 32, 10, 256)}-(1, 32, 2560)-None-None +reshape-FROM_HOST-{'shape': (1, 32, 5, 512)}-(1, 32, 2560)-None-None +reshape-FROM_HOST-{'shape': (1, 32, 80, 32)}-(1, 32, 2560)-None-None +reshape-FROM_HOST-{'shape': (1, 64, 10, 128)}-(1, 64, 1280)-None-None +reshape-FROM_HOST-{'shape': (1, 64, 20, 64)}-(1, 64, 1280)-None-None +reshape-FROM_HOST-{'shape': (1, 64, 5, 256)}-(1, 64, 1280)-None-None +reshape-FROM_HOST-{'shape': (1, 64, 40, 32)}-(1, 64, 1280)-None-None +reshape-FROM_HOST-{'shape': (1, 64, 80, 16)}-(1, 64, 1280)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, 2)}-(1, 2, 2, 2)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, -1, 3, 24, 32)}-(1, 49, 2304)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 49, 6, -1)}-(1, 49, 2304)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, -1)}-(1, 49, 2304)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (3, -1)}-(3, 4, 5)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (-1, 15)}-(3, 4, 5)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, -1)}-(2, 2, 2, 2)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (8, -1)}-(2, 2, 2, 2)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (4, 6, 5)}-(2, 3, 4, 5)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2, 6, 4)}-(2, 2, 3, 4)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (3, 9, 3)}-(3, 3, 3, 3)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (24, 8)}-(2, 3, 4, 8)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (2, 3, 2, 2, 5)}-(6, 4, 5)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 32, 20, 128)}-(1, 32, 2560)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 32, 40, 64)}-(1, 32, 2560)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 32, 10, 256)}-(1, 32, 2560)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 32, 5, 512)}-(1, 32, 2560)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 32, 80, 32)}-(1, 32, 2560)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 64, 10, 128)}-(1, 64, 1280)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 64, 20, 64)}-(1, 64, 1280)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 64, 5, 256)}-(1, 64, 1280)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 64, 40, 32)}-(1, 64, 1280)-None-None +reshape-FROM_DRAM_QUEUE-{'shape': (1, 64, 80, 16)}-(1, 64, 1280)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, 2)}-(1, 2, 2, 2)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, -1, 3, 24, 32)}-(1, 49, 2304)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 49, 6, -1)}-(1, 49, 2304)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, -1)}-(1, 49, 2304)-None-None +reshape-CONST_EVAL_PASS-{'shape': (3, -1)}-(3, 4, 5)-None-None +reshape-CONST_EVAL_PASS-{'shape': (-1, 15)}-(3, 4, 5)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, -1)}-(2, 2, 2, 2)-None-None +reshape-CONST_EVAL_PASS-{'shape': (8, -1)}-(2, 2, 2, 2)-None-None +reshape-CONST_EVAL_PASS-{'shape': (4, 6, 5)}-(2, 3, 4, 5)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2, 6, 4)}-(2, 2, 3, 4)-None-None +reshape-CONST_EVAL_PASS-{'shape': (3, 9, 3)}-(3, 3, 3, 3)-None-None +reshape-CONST_EVAL_PASS-{'shape': (24, 8)}-(2, 3, 4, 8)-None-None +reshape-CONST_EVAL_PASS-{'shape': (2, 3, 2, 2, 5)}-(6, 4, 5)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 32, 20, 128)}-(1, 32, 2560)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 32, 40, 64)}-(1, 32, 2560)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 32, 10, 256)}-(1, 32, 2560)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 32, 5, 512)}-(1, 32, 2560)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 32, 80, 32)}-(1, 32, 2560)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 64, 10, 128)}-(1, 64, 1280)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 64, 20, 64)}-(1, 64, 1280)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 64, 5, 256)}-(1, 64, 1280)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 64, 40, 32)}-(1, 64, 1280)-None-None +reshape-CONST_EVAL_PASS-{'shape': (1, 64, 80, 16)}-(1, 64, 1280)-None-None diff --git a/forge/test/operators/utils/compat.py b/forge/test/operators/utils/compat.py index 9a546ce5e..db64b3c1a 100644 --- a/forge/test/operators/utils/compat.py +++ b/forge/test/operators/utils/compat.py @@ -13,6 +13,8 @@ from forge import ForgeModule, Module, DepricatedVerifyConfig from forge.op_repo import TensorShape from forge.verify.compare import compare_with_golden +from forge.verify.verify import verify +from forge.verify.config import VerifyConfig from .datatypes import OperatorParameterTypes, ValueRanges, ValueRange @@ -271,7 +273,7 @@ def create_torch_inputs( return inputs -def verify_module_for_inputs( +def verify_module_for_inputs_deprecated( model: Module, inputs: List[torch.Tensor], pcc: Optional[float] = None, @@ -300,3 +302,15 @@ def verify_module_for_inputs( assert all( [compare_with_golden(golden=fo, calculated=co) for fo, co in zip(fw_out, co_out)] ), "PCC check failed" + + +def verify_module_for_inputs( + model: Module, + inputs: List[torch.Tensor], + verify_config: Optional[VerifyConfig] = VerifyConfig(), + dev_data_format: forge.DataFormat = None, +): + + forge_inputs = [forge.Tensor.create_from_torch(input, dev_data_format=dev_data_format) for input in inputs] + compiled_model = forge.compile(model, sample_inputs=forge_inputs) + verify(inputs, model, compiled_model, verify_config) diff --git a/forge/test/operators/utils/failing_reasons.py b/forge/test/operators/utils/failing_reasons.py index 54ca3d4c9..4c456233e 100644 --- a/forge/test/operators/utils/failing_reasons.py +++ b/forge/test/operators/utils/failing_reasons.py @@ -102,6 +102,7 @@ def validate_exception_message( FailingReasons.DATA_MISMATCH: [ lambda ex: isinstance(ex, AssertionError) and f"{ex}" == "PCC check failed", lambda ex: isinstance(ex, AssertionError) and f"{ex}".startswith("Data mismatch"), + lambda ex: isinstance(ex, ValueError) and f"{ex}".startswith("Data mismatch"), ], FailingReasons.UNSUPPORTED_SPECIAL_CASE: [ lambda ex: isinstance(ex, AssertionError) and f"{ex}" == "PCC check failed", @@ -158,6 +159,11 @@ def validate_exception_message( lambda ex: isinstance(ex, RuntimeError) and "tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/ttnn/cpp/ttnn/operations/data_movement/transpose/device/transpose_op.cpp:106: input_tensor.get_dtype() == DataType::BFLOAT16 || input_tensor.get_dtype() == DataType::FLOAT32" in f"{ex}", + lambda ex: isinstance(ex, RuntimeError) + and "Statically allocated circular buffers on core range [(x=0,y=0) - (x=0,y=0)] grow to 2663200 B which is beyond max L1 size of 1499136 B" + in f"{ex}", + lambda ex: isinstance(ex, RuntimeError) + and "Index is out of bounds for the rank, should be between 0 and 0 however is 1" in f"{ex}", ], } diff --git a/forge/test/operators/utils/utils.py b/forge/test/operators/utils/utils.py index 9170ffd8f..91674879a 100644 --- a/forge/test/operators/utils/utils.py +++ b/forge/test/operators/utils/utils.py @@ -23,8 +23,10 @@ from forge.config import _get_global_compiler_config from forge._C import MathFidelity +from forge.verify.config import VerifyConfig + from .compat import TestDevice -from .compat import create_torch_inputs, verify_module_for_inputs +from .compat import create_torch_inputs, verify_module_for_inputs, verify_module_for_inputs_deprecated from .datatypes import ValueRanges @@ -126,6 +128,8 @@ def verify( value_range: Optional[ValueRanges] = None, random_seed: Optional[int] = None, warm_reset: bool = False, + deprecated_verification: bool = True, + verify_config: Optional[VerifyConfig] = VerifyConfig(), ): """Perform Forge verification on the model @@ -141,6 +145,7 @@ def verify( value_range: Value range of input tensors random_seed: Random seed warm_reset: Warm reset the device before verification + deprecated_verification: Use deprecated verification method """ cls.setup( @@ -156,12 +161,20 @@ def verify( random_seed=random_seed, ) - cls.verify_module_for_inputs( - model=model, - inputs=inputs, - pcc=pcc, - dev_data_format=dev_data_format, - ) + if deprecated_verification: + cls.verify_module_for_inputs_deprecated( + model=model, + inputs=inputs, + pcc=pcc, + dev_data_format=dev_data_format, + ) + else: + cls.verify_module_for_inputs( + model=model, + inputs=inputs, + verify_config=verify_config, + dev_data_format=dev_data_format, + ) @classmethod def setup( @@ -201,7 +214,7 @@ def create_torch_inputs( return inputs @classmethod - def verify_module_for_inputs( + def verify_module_for_inputs_deprecated( cls, model: Module, inputs: List[torch.Tensor], @@ -209,13 +222,29 @@ def verify_module_for_inputs( dev_data_format: forge.DataFormat = None, ): - verify_module_for_inputs( + verify_module_for_inputs_deprecated( model=model, inputs=inputs, pcc=pcc, dev_data_format=dev_data_format, ) + @classmethod + def verify_module_for_inputs( + cls, + model: Module, + inputs: List[torch.Tensor], + verify_config: Optional[VerifyConfig] = VerifyConfig(), + dev_data_format: forge.DataFormat = None, + ): + + verify_module_for_inputs( + model=model, + inputs=inputs, + verify_config=verify_config, + dev_data_format=dev_data_format, + ) + class LoggerUtils: """Utility functions for logging"""