Skip to content

Add tt mlir override #453

Add tt mlir override

Add tt mlir override #453

GitHub Actions / TT-Forge-FE Tests failed Dec 10, 2024 in 0s

751 tests run, 448 passed, 300 skipped, 3 failed.

Annotations

Check failure on line 190 in forge/test/mlir/test_ops_tf.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_ops_tf.test_maxpool2d[act_shape24]

ValueError: Data mismatch (compare_with_golden): framework_model=tensor([[[[ 0.18066, -0.17285, -0.57031,  ...,  0.13867, -0.34961,  0.04736],
          [-0.50391,  0.12207, -0.46484,  ...,  0.37891, -0.28906, -0.30664],
          [-0.03760,  0.28516, -0.29492,  ...,  0.53906, -0.55859, -0.55469],
          ...,
          [-0.47070,  0.21387, -0.46289,  ...,  0.61719, -0.47266, -0.41797],
          [-0.21289, -0.11084, -0.59375,  ...,  0.43359, -0.72656, -0.46875],
          [-0.63672,  0.54297, -0.15137,  ..., -0.43164, -0.81250, -0.32422]],

         [[ 0.10352,  0.48828, -0.78125,  ...,  0.67969, -0.60938, -0.03857],
          [-0.22852,  0.57812, -0.75391,  ...,  1.05469, -1.16406, -0.20605],
          [-0.42383,  0.72266, -1.01562,  ...,  1.13281, -0.89453, -0.08447],
          ...,
          [-0.17578,  0.68359, -0.61719,  ...,  0.97266, -1.07031, -0.07373],
          [-0.37891,  0.48047, -0.81641,  ...,  1.21875, -0.75391,  0.02563],
          [-0.55469,  0.42969, -0.46289,  ..., -0.62109, -0.94141,  0.47656]],

         [[-0.03369,  0.60547, -0.96875,  ...,  0.57031, -0.56250, -0.15430],
          [ 0.05786,  0.55469, -1.00000,  ...,  0.63672, -1.18750, -0.37500],
          [-0.42578,  0.23047, -0.73828,  ...,  1.35156, -1.00781,  0.01965],
          ...,
          [-0.21094,  0.38867, -1.24219,  ...,  0.78906, -0.67578,  0.03540],
          [-0.17969,  0.62109, -1.26562,  ...,  0.89453, -0.86328,  0.00278],
          [-0.49414,  0.58984, -0.32031,  ..., -0.69922, -1.01562,  0.36523]],

         ...,

         [[-0.23340,  0.58594, -0.77344,  ...,  0.76562, -0.71094, -0.18652],
          [-0.28711,  0.58594, -0.65234,  ...,  0.87891, -0.83203, -0.11182],
          [-0.31836,  0.62891, -0.54297,  ...,  1.05469, -0.92188, -0.02283],
          ...,
          [-0.71484,  0.78125, -0.75000,  ...,  0.99219, -1.11719, -0.07764],
          [-0.31055,  0.56641, -0.71875,  ...,  0.88672, -0.71484, -0.34375],
          [-0.45508,  0.64844, -0.39648,  ..., -0.45898, -0.91797,  0.29883]],

         [[-0.01282,  0.60938, -0.66016,  ...,  0.92969, -0.34180,  0.17676],
          [-0.83594,  0.68750, -0.92578,  ...,  0.99609, -0.86719, -0.24805],
          [-0.29688,  0.72266, -0.96875,  ...,  0.87109, -1.12500,  0.25391],
          ...,
          [-0.25781,  0.52344, -0.82031,  ...,  1.39062, -1.08594, -0.08350],
          [-0.28711,  0.55469, -0.83203,  ...,  1.02344, -0.96484,  0.15625],
          [-0.38086,  0.61328, -0.33008,  ..., -0.41797, -1.05469,  0.34180]],

         [[ 0.06445,  0.90625, -1.07031,  ...,  0.41211, -0.33008,  0.72656],
          [ 0.01929,  0.53516, -1.15625,  ...,  0.33594, -0.58203,  0.62109],
          [ 0.00287,  0.35742, -1.08594,  ...,  0.37305, -0.50781,  0.80859],
          ...,
          [ 0.24609,  0.66797, -1.41406,  ...,  0.10791, -0.59375,  1.00000],
          [ 0.02625,  0.52344, -1.22656,  ...,  0.18848, -0.62109,  0.71484],
          [ 0.16992,  0.25000, -0.66406,  ..., -0.75781, -0.66797,  1.07031]]]], dtype=torch.bfloat16, requires_grad=True), compiled_model=tensor([[[[ 2.00195e-01, -2.14844e-01, -4.90234e-01,  ...,  2.12891e-01, -3.55469e-01, -3.83301e-02],
          [-3.67188e-01,  9.52148e-02, -4.14062e-01,  ...,  4.23828e-01, -3.14453e-01, -3.49609e-01],
          [-2.75391e-01,  2.48047e-01, -2.67578e-01,  ...,  6.48438e-01, -5.39062e-01, -4.84375e-01],
          ...,
          [-7.30167e+33,  9.81344e+35,  3.40095e+35,  ..., -1.00211e+36,  1.19423e+36, -1.32404e+36],
          [-1.39569e+37,  9.09690e+36, -1.45384e+37,  ...,  2.62523e+37,  4.51938e+37,  4.07076e+37],
          [ 9.26306e+36, -3.67199e+37,  2.10288e+35,  ...,  8.14152e+36, -2.59615e+34, -2.12676e+37]],

         [[-2.34604e-04,  9.29688e-01, -8.08594e-01,  ...,  7.69531e-01, -6.28906e-01, -9.76562e-02],
          [-3.95508e-02,  4.39453e-01, -9.53125e-01,  ...,  1.07031e+00, -8.00781e-01, -2.77344e-01],
          [-2.38281e-01,  6.52344e-01, -1.00000e+00,  ...,  7.61719e-01, -9.06250e-01,  5.24902e-02],
          ...,
          [ 2.95753e+37,  4.51938e+37,  2.01046e+37,  ...,  1.53692e+37, -2.99076e+36, -3.30645e+37],
          [ 8.84767e+36, -4.38645e+37,  5.73230e+36,  ..., -2.50269e+36,  6.77076e+36,  2.92430e+37],
          [ 2.69169e+37,  1.84430e+37,  5.45191e+35,  ...,  6.77076e+36,  3.90461e+37, -1.30430e+37]],

         [[-2.95410e-02,  6.87500e-01, -6.83594e-01,  ...,  6.56250e-01, -3.08594e-01,  3.73535e-02],
          [-4.68750e-01,  4.58984e-01, -1.07812e+00,  ...,  1.03125e+00, -7.69531e-01, -1.68457e-02],
          [-3.82812e-01,  3.33984e-01, -9.06250e-01,  ...,  1.17969e+00, -1.09375e+00, -4.08203e-01],
          ...,
          [ 1.57015e+37,  4.48614e+37, -1.77784e+37,  ..., -7.47691e+36, -3.01153e+36,  1.35415e+37],
          [ 2.84122e+37,  1.39569e+37,  1.18800e+37,  ...,  4.42384e+36,  3.93784e+37,  2.32615e+37],
          [ 1.42061e+37, -4.21615e+36, -5.51630e+37,  ...,  1.47877e+37,  4.23691e+37, -1.53692e+37]],

         ...,

         [[-1.92871e-02,  6.79688e-01, -3.84766e-01,  ...,  8.82812e-01, -5.82031e-01, -1.42212e-02],
          [-5.07812e-01,  4.49219e-01, -1.09375e+00,  ...,  1.19531e+00, -1.21094e+00,  6.68945e-02],
          [-4.12109e-01,  5.50781e-01, -1.12500e+00,  ...,  1.20312e+00, -1.19531e+00, -4.88281e-02],
          ...,
          [ 1.34584e+37,  2.09353e+37, -3.73845e+37,  ...,  9.19037e+35, -2.97415e+37, -3.50584e+37],
          [-2.84122e+37, -1.96061e+37, -2.55876e+37,  ...,  5.41660e+37, -8.55691e+36,  4.75199e+37],
          [-5.73230e+36,  9.38767e+36, -3.62215e+37,  ..., -3.88799e+37, -3.10707e+37,  5.08430e+37]],

         [[ 3.14713e-04,  6.60156e-01, -8.90625e-01,  ...,  5.50781e-01, -3.98438e-01, -9.71680e-02],
          [-4.98047e-01,  3.94531e-01, -6.99219e-01,  ...,  1.03125e+00, -6.52344e-01, -1.81641e-01],
          [-6.44531e-01,  5.54688e-01, -9.57031e-01,  ...,  1.28906e+00, -1.12500e+00, -7.32422e-02],
          ...,
          [ 2.59199e+37, -4.45291e+37, -3.02399e+37,  ...,  9.59536e+36, -1.22954e+37, -3.37292e+37],
          [-2.92430e+37,  1.61169e+37, -1.57846e+37,  ..., -1.47877e+37, -6.64614e+37, -3.43938e+37],
          [-4.85168e+37,  3.65538e+37,  2.75815e+37,  ...,  3.19015e+37,  2.92846e+36,  2.19323e+37]],

         [[-6.39648e-02,  9.64844e-01, -7.73438e-01,  ...,  3.98438e-01, -3.02734e-01,  6.17188e-01],
          [ 3.63770e-02,  4.47266e-01, -1.02344e+00,  ...,  2.61719e-01, -5.82031e-01,  7.42188e-01],
          [ 2.19727e-01,  5.07812e-01, -1.30469e+00,  ...,  2.44141e-01, -8.08594e-01,  6.91406e-01],
          ...,
          [-5.18399e+37,  2.35938e+37,  5.94830e+37,  ...,  6.21414e+37,  3.80492e+37,  4.28676e+37],
          [ 4.31999e+36,  1.52861e+37, -9.67844e+36,  ..., -4.28676e+37, -1.99384e+37, -1.08000e+37],
          [ 3.15692e+37,  9.13844e+36, -2.06030e+37,  ..., -1.24615e+37,  8.41152e+35,  2.14338e+37]]]], dtype=torch.bfloat16)
Raw output
act_shape = (1, 128, 128, 32)

    @pytest.mark.parametrize(
        "act_shape",  ## NHWC
        [
            (1, 32, 32, 32),
            (1, 32, 32, 64),
            (1, 32, 32, 128),
            (1, 32, 64, 32),
            (1, 32, 64, 64),
            (1, 32, 64, 128),
            (1, 32, 128, 32),
            (1, 32, 128, 64),
            (1, 32, 128, 128),
            (1, 64, 32, 32),
            (1, 64, 32, 64),
            (1, 64, 32, 128),
            (1, 64, 64, 32),
            (1, 64, 64, 64),
            (1, 64, 64, 128),
            (1, 64, 128, 32),
            (1, 64, 128, 64),
            (1, 64, 128, 128),
            (1, 128, 32, 32),
            (1, 128, 32, 64),
            (1, 128, 32, 128),
            (1, 128, 64, 32),
            (1, 128, 64, 64),
            (1, 128, 64, 128),
            (1, 128, 128, 32),
            (1, 128, 128, 64),
            (1, 128, 128, 128),
        ],
    )
    @pytest.mark.push
    def test_maxpool2d(
        act_shape,
    ):
        # NOTE: Only shapes that are tile-dim aligned before and after
        # the maxpool operation work through the forge-mlir flow. This,
        # limits the variablity that is supported for padding, pool size,
        # strides, and dilation.
        tf.random.set_seed(0)
    
        class MaxPool(tf.keras.Model):
            def __init__(self):
                super().__init__()
                self.pool = tf.keras.layers.MaxPool2D(pool_size=(2, 2), padding="valid", dtype=tf.bfloat16)
                self.conv = tf.keras.layers.Conv2D(act_shape[-1], (3, 3), padding="same", dtype=tf.bfloat16)
    
            def call(self, x):
                x = self.pool(x)
                x = self.conv(x)
                return x
    
        _get_global_compiler_config().default_df_override = DataFormat.Float16_b
        inputs = [tf.random.uniform(act_shape, dtype=tf.bfloat16)]
    
        framework_model = MaxPool()
        compiled_model = forge.compile(framework_model, sample_inputs=inputs)
    
>       verify(inputs, framework_model, compiled_model, VerifyConfig(verify_allclose=False))

forge/test/mlir/test_ops_tf.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

inputs = [<tf.Tensor: shape=(1, 128, 128, 32), dtype=bfloat16, numpy=
array([[[[0.882812, 0.539062, 0.367188, ..., 0.257812, 0...., 0.046875, 0.21875, 0.5],
         [0.0703125, 0.828125, 0.179688, ..., 0.414062, 0.5, 0.710938]]]], dtype=bfloat16)>]
framework_model = <test_ops_tf.test_maxpool2d.<locals>.MaxPool object at 0x7f63f64c7010>
compiled_model = <forge.compiled_graph_state.CompiledModel object at 0x7f64c2705630>
verify_cfg = VerifyConfig(enabled=True, verify_size=True, verify_dtype=True, verify_shape=True, verify_data=True, verify_allclose=F...bfloat16: 1e-08}, relative_atol=0.1, pcc=0.99, dissimilarity_threshold=0.001, dump_tensors=False, dump_tensors_path='')

    def verify(
        inputs: List[Union[torch.Tensor, tf.Tensor, tf.Variable]],
        framework_model: Union[torch.nn.Module, tf.Module, tf.keras.Model],
        compiled_model: CompiledModel,
        verify_cfg: VerifyConfig = VerifyConfig(),
    ):
        """
        Verify the compiled model against the framework model
        """
        if not verify_cfg.enabled:
            logger.warning("Verification is disabled")
            return
    
        from forge.op.eval.common import compare_with_golden  # avoid circular import
    
        # 0th step: input checks
    
        # Check if inputs are of the correct type
        if not inputs:
            raise ValueError("Input tensors must be provided")
        for input_tensor in inputs:
            if not isinstance(input_tensor, verify_cfg.supported_tensor_types):
                raise TypeError(
                    f"Input tensor must be of type {verify_cfg.supported_tensor_types}, but got {type(input_tensor)}"
                )
    
        if not isinstance(framework_model, verify_cfg.framework_model_types):
            raise TypeError(
                f"Framework model must be of type {verify_cfg.framework_model_types}, but got {type(framework_model)}"
            )
    
        if not isinstance(compiled_model, verify_cfg.compiled_model_types):
            raise TypeError(
                f"Compiled model must be of type {verify_cfg.compiled_model_types}, but got {type(compiled_model)}"
            )
    
        # 1st step: run forward pass for the networks
        fw_out = framework_model(*inputs)
        co_out = compiled_model(*inputs)
    
        # 2nd step: apply preprocessing (push tensors to cpu, perform any reshape if necessary,
        #  cast from tensorflow tensors to pytorch tensors if needed)
        if not isinstance(fw_out, torch.Tensor):
            fw_out = to_pt_tensors(fw_out)
    
        co_out = [co.to("cpu") for co in co_out]
        fw_out = [fw_out] if isinstance(fw_out, torch.Tensor) else fw_out
    
        # 3rd step: verifications of outputs
        # - dtype check
        # - shape check
        # - compare with golden
        if verify_cfg.verify_size:
            if len(fw_out) != len(co_out):
                raise ValueError(
                    f"Number of outputs from framework model and compiled model do not match: framework model has {len(fw_out)} outputs, compiled model has {len(co_out)} outputs"
                )
    
        for fw, co in zip(fw_out, co_out):
            if verify_cfg.verify_dtype:
                if fw.dtype != co.dtype:
                    raise TypeError(f"Dtype mismatch: framework_model.dtype={fw.dtype}, compiled_model.dtype={co.dtype}")
            if verify_cfg.verify_shape:
                if fw.shape != co.shape:
                    raise ValueError(f"Shape mismatch: framework_model.shape={fw.shape}, compiled_model.shape={co.shape}")
            if verify_cfg.verify_data:
                if not compare_with_golden(golden=fw, calculated=co, verify_cfg=verify_cfg):
>                   raise ValueError(f"Data mismatch (compare_with_golden): framework_model={fw}, compiled_model={co}")
E                   ValueError: Data mismatch (compare_with_golden): framework_model=tensor([[[[ 0.18066, -0.17285, -0.57031,  ...,  0.13867, -0.34961,  0.04736],
E                             [-0.50391,  0.12207, -0.46484,  ...,  0.37891, -0.28906, -0.30664],
E                             [-0.03760,  0.28516, -0.29492,  ...,  0.53906, -0.55859, -0.55469],
E                             ...,
E                             [-0.47070,  0.21387, -0.46289,  ...,  0.61719, -0.47266, -0.41797],
E                             [-0.21289, -0.11084, -0.59375,  ...,  0.43359, -0.72656, -0.46875],
E                             [-0.63672,  0.54297, -0.15137,  ..., -0.43164, -0.81250, -0.32422]],
E                   
E                            [[ 0.10352,  0.48828, -0.78125,  ...,  0.67969, -0.60938, -0.03857],
E                             [-0.22852,  0.57812, -0.75391,  ...,  1.05469, -1.16406, -0.20605],
E                             [-0.42383,  0.72266, -1.01562,  ...,  1.13281, -0.89453, -0.08447],
E                             ...,
E                             [-0.17578,  0.68359, -0.61719,  ...,  0.97266, -1.07031, -0.07373],
E                             [-0.37891,  0.48047, -0.81641,  ...,  1.21875, -0.75391,  0.02563],
E                             [-0.55469,  0.42969, -0.46289,  ..., -0.62109, -0.94141,  0.47656]],
E                   
E                            [[-0.03369,  0.60547, -0.96875,  ...,  0.57031, -0.56250, -0.15430],
E                             [ 0.05786,  0.55469, -1.00000,  ...,  0.63672, -1.18750, -0.37500],
E                             [-0.42578,  0.23047, -0.73828,  ...,  1.35156, -1.00781,  0.01965],
E                             ...,
E                             [-0.21094,  0.38867, -1.24219,  ...,  0.78906, -0.67578,  0.03540],
E                             [-0.17969,  0.62109, -1.26562,  ...,  0.89453, -0.86328,  0.00278],
E                             [-0.49414,  0.58984, -0.32031,  ..., -0.69922, -1.01562,  0.36523]],
E                   
E                            ...,
E                   
E                            [[-0.23340,  0.58594, -0.77344,  ...,  0.76562, -0.71094, -0.18652],
E                             [-0.28711,  0.58594, -0.65234,  ...,  0.87891, -0.83203, -0.11182],
E                             [-0.31836,  0.62891, -0.54297,  ...,  1.05469, -0.92188, -0.02283],
E                             ...,
E                             [-0.71484,  0.78125, -0.75000,  ...,  0.99219, -1.11719, -0.07764],
E                             [-0.31055,  0.56641, -0.71875,  ...,  0.88672, -0.71484, -0.34375],
E                             [-0.45508,  0.64844, -0.39648,  ..., -0.45898, -0.91797,  0.29883]],
E                   
E                            [[-0.01282,  0.60938, -0.66016,  ...,  0.92969, -0.34180,  0.17676],
E                             [-0.83594,  0.68750, -0.92578,  ...,  0.99609, -0.86719, -0.24805],
E                             [-0.29688,  0.72266, -0.96875,  ...,  0.87109, -1.12500,  0.25391],
E                             ...,
E                             [-0.25781,  0.52344, -0.82031,  ...,  1.39062, -1.08594, -0.08350],
E                             [-0.28711,  0.55469, -0.83203,  ...,  1.02344, -0.96484,  0.15625],
E                             [-0.38086,  0.61328, -0.33008,  ..., -0.41797, -1.05469,  0.34180]],
E                   
E                            [[ 0.06445,  0.90625, -1.07031,  ...,  0.41211, -0.33008,  0.72656],
E                             [ 0.01929,  0.53516, -1.15625,  ...,  0.33594, -0.58203,  0.62109],
E                             [ 0.00287,  0.35742, -1.08594,  ...,  0.37305, -0.50781,  0.80859],
E                             ...,
E                             [ 0.24609,  0.66797, -1.41406,  ...,  0.10791, -0.59375,  1.00000],
E                             [ 0.02625,  0.52344, -1.22656,  ...,  0.18848, -0.62109,  0.71484],
E                             [ 0.16992,  0.25000, -0.66406,  ..., -0.75781, -0.66797,  1.07031]]]], dtype=torch.bfloat16, requires_grad=True), compiled_model=tensor([[[[ 2.00195e-01, -2.14844e-01, -4.90234e-01,  ...,  2.12891e-01, -3.55469e-01, -3.83301e-02],
E                             [-3.67188e-01,  9.52148e-02, -4.14062e-01,  ...,  4.23828e-01, -3.14453e-01, -3.49609e-01],
E                             [-2.75391e-01,  2.48047e-01, -2.67578e-01,  ...,  6.48438e-01, -5.39062e-01, -4.84375e-01],
E                             ...,
E                             [-7.30167e+33,  9.81344e+35,  3.40095e+35,  ..., -1.00211e+36,  1.19423e+36, -1.32404e+36],
E                             [-1.39569e+37,  9.09690e+36, -1.45384e+37,  ...,  2.62523e+37,  4.51938e+37,  4.07076e+37],
E                             [ 9.26306e+36, -3.67199e+37,  2.10288e+35,  ...,  8.14152e+36, -2.59615e+34, -2.12676e+37]],
E                   
E                            [[-2.34604e-04,  9.29688e-01, -8.08594e-01,  ...,  7.69531e-01, -6.28906e-01, -9.76562e-02],
E                             [-3.95508e-02,  4.39453e-01, -9.53125e-01,  ...,  1.07031e+00, -8.00781e-01, -2.77344e-01],
E                             [-2.38281e-01,  6.52344e-01, -1.00000e+00,  ...,  7.61719e-01, -9.06250e-01,  5.24902e-02],
E                             ...,
E                             [ 2.95753e+37,  4.51938e+37,  2.01046e+37,  ...,  1.53692e+37, -2.99076e+36, -3.30645e+37],
E                             [ 8.84767e+36, -4.38645e+37,  5.73230e+36,  ..., -2.50269e+36,  6.77076e+36,  2.92430e+37],
E                             [ 2.69169e+37,  1.84430e+37,  5.45191e+35,  ...,  6.77076e+36,  3.90461e+37, -1.30430e+37]],
E                   
E                            [[-2.95410e-02,  6.87500e-01, -6.83594e-01,  ...,  6.56250e-01, -3.08594e-01,  3.73535e-02],
E                             [-4.68750e-01,  4.58984e-01, -1.07812e+00,  ...,  1.03125e+00, -7.69531e-01, -1.68457e-02],
E                             [-3.82812e-01,  3.33984e-01, -9.06250e-01,  ...,  1.17969e+00, -1.09375e+00, -4.08203e-01],
E                             ...,
E                             [ 1.57015e+37,  4.48614e+37, -1.77784e+37,  ..., -7.47691e+36, -3.01153e+36,  1.35415e+37],
E                             [ 2.84122e+37,  1.39569e+37,  1.18800e+37,  ...,  4.42384e+36,  3.93784e+37,  2.32615e+37],
E                             [ 1.42061e+37, -4.21615e+36, -5.51630e+37,  ...,  1.47877e+37,  4.23691e+37, -1.53692e+37]],
E                   
E                            ...,
E                   
E                            [[-1.92871e-02,  6.79688e-01, -3.84766e-01,  ...,  8.82812e-01, -5.82031e-01, -1.42212e-02],
E                             [-5.07812e-01,  4.49219e-01, -1.09375e+00,  ...,  1.19531e+00, -1.21094e+00,  6.68945e-02],
E                             [-4.12109e-01,  5.50781e-01, -1.12500e+00,  ...,  1.20312e+00, -1.19531e+00, -4.88281e-02],
E                             ...,
E                             [ 1.34584e+37,  2.09353e+37, -3.73845e+37,  ...,  9.19037e+35, -2.97415e+37, -3.50584e+37],
E                             [-2.84122e+37, -1.96061e+37, -2.55876e+37,  ...,  5.41660e+37, -8.55691e+36,  4.75199e+37],
E                             [-5.73230e+36,  9.38767e+36, -3.62215e+37,  ..., -3.88799e+37, -3.10707e+37,  5.08430e+37]],
E                   
E                            [[ 3.14713e-04,  6.60156e-01, -8.90625e-01,  ...,  5.50781e-01, -3.98438e-01, -9.71680e-02],
E                             [-4.98047e-01,  3.94531e-01, -6.99219e-01,  ...,  1.03125e+00, -6.52344e-01, -1.81641e-01],
E                             [-6.44531e-01,  5.54688e-01, -9.57031e-01,  ...,  1.28906e+00, -1.12500e+00, -7.32422e-02],
E                             ...,
E                             [ 2.59199e+37, -4.45291e+37, -3.02399e+37,  ...,  9.59536e+36, -1.22954e+37, -3.37292e+37],
E                             [-2.92430e+37,  1.61169e+37, -1.57846e+37,  ..., -1.47877e+37, -6.64614e+37, -3.43938e+37],
E                             [-4.85168e+37,  3.65538e+37,  2.75815e+37,  ...,  3.19015e+37,  2.92846e+36,  2.19323e+37]],
E                   
E                            [[-6.39648e-02,  9.64844e-01, -7.73438e-01,  ...,  3.98438e-01, -3.02734e-01,  6.17188e-01],
E                             [ 3.63770e-02,  4.47266e-01, -1.02344e+00,  ...,  2.61719e-01, -5.82031e-01,  7.42188e-01],
E                             [ 2.19727e-01,  5.07812e-01, -1.30469e+00,  ...,  2.44141e-01, -8.08594e-01,  6.91406e-01],
E                             ...,
E                             [-5.18399e+37,  2.35938e+37,  5.94830e+37,  ...,  6.21414e+37,  3.80492e+37,  4.28676e+37],
E                             [ 4.31999e+36,  1.52861e+37, -9.67844e+36,  ..., -4.28676e+37, -1.99384e+37, -1.08000e+37],
E                             [ 3.15692e+37,  9.13844e+36, -2.06030e+37,  ..., -1.24615e+37,  8.41152e+35,  2.14338e+37]]]], dtype=torch.bfloat16)

forge/forge/verify/verify.py:333: ValueError

Check failure on line 190 in forge/test/mlir/test_ops_tf.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_ops_tf.test_maxpool2d[act_shape25]

ValueError: Data mismatch (compare_with_golden): framework_model=tensor([[[[-0.07080, -0.08740, -1.27344,  ..., -0.75781, -0.37500,  0.77734],
          [ 0.24707,  0.50000, -0.96094,  ..., -0.58203, -0.42773,  1.22656],
          [ 0.45117,  0.60156, -0.94141,  ..., -0.29297, -0.35547,  1.42969],
          ...,
          [ 0.09375,  0.34766, -0.94531,  ..., -0.54297, -0.29883,  1.31250],
          [ 0.30664,  0.79297, -1.05469,  ..., -0.54297, -0.51562,  1.44531],
          [ 0.13770,  0.58203,  0.01410,  ...,  0.25586,  0.23242,  1.20312]],

         [[ 0.20117,  0.25391, -1.20312,  ..., -0.36914, -1.25781,  0.30859],
          [ 0.49414,  0.81641, -0.88672,  ..., -0.36719, -1.37500,  0.51172],
          [ 0.51562,  0.81250, -0.93750,  ...,  0.27930, -1.21875,  0.42969],
          ...,
          [ 0.56641,  0.80859, -0.80078,  ...,  0.20020, -1.65625,  0.79297],
          [ 0.82031,  0.99219, -0.78906,  ..., -0.34766, -1.32031,  0.51562],
          [ 0.48438,  0.75781, -0.13672,  ...,  0.35352, -0.82812,  1.03125]],

         [[ 0.34180,  0.22461, -1.21875,  ..., -0.25000, -1.39844,  0.31250],
          [ 0.75781,  0.80078, -0.86719,  ..., -0.09326, -1.23438,  0.47656],
          [ 0.57031,  0.92188, -0.80859,  ..., -0.20996, -1.64062,  0.48242],
          ...,
          [ 0.58594,  0.61328, -0.98828,  ...,  0.11230, -1.17188,  0.80859],
          [ 0.51172,  0.72656, -0.87109,  ..., -0.03223, -1.35938,  0.74219],
          [ 0.37109,  0.72656, -0.46094,  ...,  0.28125, -0.67188,  1.01562]],

         ...,

         [[ 0.37305, -0.04272, -1.26562,  ..., -0.58984, -1.37500,  0.31836],
          [ 0.87500,  0.80078, -0.67578,  ...,  0.05127, -1.26562,  0.34766],
          [ 0.69141,  0.98047, -0.82812,  ..., -0.22168, -1.14844,  0.67578],
          ...,
          [ 0.91797,  0.80859, -0.92969,  ...,  0.04614, -1.65625,  0.60547],
          [ 0.66016,  1.14844, -0.86719,  ...,  0.25781, -1.31250,  0.82031],
          [ 0.55469,  0.75000, -0.22852,  ...,  0.21484, -0.79297,  1.17188]],

         [[ 0.21387,  0.04053, -1.35938,  ..., -0.42383, -1.39062,  0.42578],
          [ 0.80469,  0.57812, -0.96484,  ..., -0.09326, -1.42969,  1.03906],
          [ 0.74219,  0.53516, -1.00000,  ..., -0.25000, -1.59375,  0.60547],
          ...,
          [ 0.72656,  0.33984, -1.03125,  ...,  0.20508, -1.39062,  0.39258],
          [ 0.66797,  0.91797, -0.80469,  ...,  0.07178, -1.43750,  0.83594],
          [ 0.46289,  1.03906, -0.15234,  ...,  0.16406, -0.27734,  0.95703]],

         [[ 0.36914,  0.66406, -0.55078,  ...,  0.01575, -1.29688, -0.25391],
          [ 0.49023,  0.85156,  0.00339,  ..., -0.26367, -1.09375,  0.25586],
          [ 0.53516,  1.15625, -0.08691,  ..., -0.10645, -1.32031,  0.28906],
          ...,
          [ 0.62891,  1.01562, -0.03418,  ..., -0.00879, -1.32812,  0.28711],
          [ 0.55859,  0.92969, -0.00339,  ...,  0.00778, -1.64844,  0.22266],
          [ 0.32031,  0.70312,  0.23828,  ...,  0.15332, -0.60156,  0.79297]]]], dtype=torch.bfloat16, requires_grad=True), compiled_model=tensor([[[[-3.39355e-02, -7.17773e-02, -1.22656e+00,  ..., -6.67969e-01, -2.37305e-01,  9.17969e-01],
          [ 2.65625e-01,  5.97656e-01, -9.02344e-01,  ..., -5.07812e-01, -3.14453e-01,  1.32031e+00],
          [ 5.15625e-01,  4.96094e-01, -7.96875e-01,  ..., -4.82422e-01, -5.03906e-01,  1.36719e+00],
          ...,
          [ 4.72499e+35, -1.03846e+36, -9.65767e+35,  ...,  2.19115e+36, -8.37258e+34,  1.65115e+36],
          [-2.49230e+37, -1.14646e+37,  2.01046e+37,  ..., -1.60338e+37,  1.75292e+37,  1.77784e+37],
          [ 8.22460e+36, -1.11323e+37, -1.85261e+37,  ..., -1.02184e+37, -6.10614e+36,  1.67938e+34]],

         [[ 4.72656e-01,  3.78906e-01, -1.19531e+00,  ..., -4.17969e-01, -1.40625e+00,  1.87500e-01],
          [ 5.66406e-01,  9.17969e-01, -8.32031e-01,  ..., -4.04297e-01, -1.27344e+00,  5.82031e-01],
          [ 4.88281e-01,  7.92969e-01, -1.03125e+00,  ...,  5.93262e-02, -1.33594e+00,  6.28906e-01],
          ...,
          [-1.08000e+37,  9.01383e+36,  1.86923e+37,  ..., -2.76490e+35,  1.08000e+37,  6.18922e+36],
          [-1.07169e+37,  1.32923e+37,  2.09769e+36,  ...,  1.86923e+37,  1.23317e+35,  3.67199e+37],
          [-2.57538e+37,  1.48707e+37,  2.40923e+37,  ..., -4.13722e+37,  2.60861e+37,  2.94092e+37]],

         [[ 1.48438e-01,  3.94531e-01, -1.13281e+00,  ..., -4.68750e-01, -1.39844e+00,  4.37012e-02],
          [ 6.75781e-01,  7.57812e-01, -7.53906e-01,  ...,  1.46484e-01, -1.58594e+00,  6.71875e-01],
          [ 5.00000e-01,  9.29688e-01, -9.68750e-01,  ...,  1.57227e-01, -1.53906e+00,  3.76953e-01],
          ...,
          [-2.75815e+37,  6.85383e+35, -1.26277e+37,  ...,  6.35537e+36, -2.74153e+37, -2.77476e+37],
          [-1.99384e+37, -1.02184e+37, -2.80799e+37,  ..., -3.50584e+37, -5.69076e+36,  3.17353e+37],
          [ 5.15076e+37,  2.74153e+36, -1.09661e+37,  ..., -3.05722e+37, -3.30645e+37,  2.95753e+37]],

         ...,

         [[ 3.65234e-01,  1.58203e-01, -8.86719e-01,  ..., -1.36719e-01, -1.21094e+00,  3.14453e-01],
          [ 6.87500e-01,  5.15625e-01, -1.10938e+00,  ...,  4.76074e-02, -1.32031e+00,  5.50781e-01],
          [ 6.36719e-01,  1.11719e+00, -7.96875e-01,  ..., -2.35352e-01, -1.28125e+00,  6.95312e-01],
          ...,
          [ 5.54953e+37,  6.77906e+37, -3.80492e+37,  ...,  1.32923e+37,  3.63876e+37,  6.89537e+36],
          [ 5.18399e+37,  9.63690e+37, -3.52245e+37,  ..., -1.45384e+37,  3.09046e+37,  3.38953e+37],
          [-1.12984e+37,  4.08738e+37, -2.59199e+37,  ..., -2.14338e+37, -2.17661e+37,  2.31576e+36]],

         [[ 3.82812e-01,  6.20117e-02, -1.10938e+00,  ..., -4.04297e-01, -1.36719e+00,  1.74805e-01],
          [ 6.21094e-01,  8.98438e-01, -9.76562e-01,  ...,  2.08008e-01, -1.47656e+00,  9.02344e-01],
          [ 5.89844e-01,  7.14844e-01, -6.95312e-01,  ..., -9.13086e-02, -1.33594e+00,  9.88281e-01],
          ...,
          [ 1.74461e+37, -2.14338e+37,  3.25661e+37,  ...,  2.69169e+37, -2.27630e+37,  3.35630e+37],
          [-1.70307e+37,  2.95753e+37, -5.10922e+36,  ...,  1.37077e+36, -3.32307e+36,  2.74153e+37],
          [ 2.65846e+37, -3.70522e+37,  2.27630e+37,  ...,  4.56922e+36,  3.52245e+37,  1.03431e+37]],

         [[ 2.94922e-01,  6.79688e-01, -5.97656e-01,  ..., -5.02930e-02, -1.46094e+00, -3.65234e-01],
          [ 7.38281e-01,  9.14062e-01, -1.54297e-01,  ...,  9.42383e-02, -1.41406e+00, -6.01196e-03],
          [ 6.67969e-01,  1.15625e+00, -1.99219e-01,  ..., -1.99219e-01, -1.39062e+00,  1.43555e-01],
          ...,
          [-1.66153e+37, -2.59199e+37, -2.34276e+37,  ...,  3.02399e+37,  1.45384e+37,  3.20676e+37],
          [-2.90769e+36,  4.25353e+37, -1.45384e+37,  ..., -1.22123e+37,  2.11846e+36,  4.08738e+37],
          [-1.08000e+37, -1.13815e+37, -2.18076e+36,  ...,  4.00845e+36, -9.22152e+36,  1.76953e+37]]]], dtype=torch.bfloat16)
Raw output
act_shape = (1, 128, 128, 64)

    @pytest.mark.parametrize(
        "act_shape",  ## NHWC
        [
            (1, 32, 32, 32),
            (1, 32, 32, 64),
            (1, 32, 32, 128),
            (1, 32, 64, 32),
            (1, 32, 64, 64),
            (1, 32, 64, 128),
            (1, 32, 128, 32),
            (1, 32, 128, 64),
            (1, 32, 128, 128),
            (1, 64, 32, 32),
            (1, 64, 32, 64),
            (1, 64, 32, 128),
            (1, 64, 64, 32),
            (1, 64, 64, 64),
            (1, 64, 64, 128),
            (1, 64, 128, 32),
            (1, 64, 128, 64),
            (1, 64, 128, 128),
            (1, 128, 32, 32),
            (1, 128, 32, 64),
            (1, 128, 32, 128),
            (1, 128, 64, 32),
            (1, 128, 64, 64),
            (1, 128, 64, 128),
            (1, 128, 128, 32),
            (1, 128, 128, 64),
            (1, 128, 128, 128),
        ],
    )
    @pytest.mark.push
    def test_maxpool2d(
        act_shape,
    ):
        # NOTE: Only shapes that are tile-dim aligned before and after
        # the maxpool operation work through the forge-mlir flow. This,
        # limits the variablity that is supported for padding, pool size,
        # strides, and dilation.
        tf.random.set_seed(0)
    
        class MaxPool(tf.keras.Model):
            def __init__(self):
                super().__init__()
                self.pool = tf.keras.layers.MaxPool2D(pool_size=(2, 2), padding="valid", dtype=tf.bfloat16)
                self.conv = tf.keras.layers.Conv2D(act_shape[-1], (3, 3), padding="same", dtype=tf.bfloat16)
    
            def call(self, x):
                x = self.pool(x)
                x = self.conv(x)
                return x
    
        _get_global_compiler_config().default_df_override = DataFormat.Float16_b
        inputs = [tf.random.uniform(act_shape, dtype=tf.bfloat16)]
    
        framework_model = MaxPool()
        compiled_model = forge.compile(framework_model, sample_inputs=inputs)
    
>       verify(inputs, framework_model, compiled_model, VerifyConfig(verify_allclose=False))

forge/test/mlir/test_ops_tf.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

inputs = [<tf.Tensor: shape=(1, 128, 128, 64), dtype=bfloat16, numpy=
array([[[[0.882812, 0.539062, 0.367188, ..., 0.992188, 0....992188, 0.359375, 0.132812],
         [0.53125, 0.0625, 0.375, ..., 0.773438, 0.484375, 0.609375]]]], dtype=bfloat16)>]
framework_model = <test_ops_tf.test_maxpool2d.<locals>.MaxPool object at 0x7f64c263efe0>
compiled_model = <forge.compiled_graph_state.CompiledModel object at 0x7f63f64eff10>
verify_cfg = VerifyConfig(enabled=True, verify_size=True, verify_dtype=True, verify_shape=True, verify_data=True, verify_allclose=F...bfloat16: 1e-08}, relative_atol=0.1, pcc=0.99, dissimilarity_threshold=0.001, dump_tensors=False, dump_tensors_path='')

    def verify(
        inputs: List[Union[torch.Tensor, tf.Tensor, tf.Variable]],
        framework_model: Union[torch.nn.Module, tf.Module, tf.keras.Model],
        compiled_model: CompiledModel,
        verify_cfg: VerifyConfig = VerifyConfig(),
    ):
        """
        Verify the compiled model against the framework model
        """
        if not verify_cfg.enabled:
            logger.warning("Verification is disabled")
            return
    
        from forge.op.eval.common import compare_with_golden  # avoid circular import
    
        # 0th step: input checks
    
        # Check if inputs are of the correct type
        if not inputs:
            raise ValueError("Input tensors must be provided")
        for input_tensor in inputs:
            if not isinstance(input_tensor, verify_cfg.supported_tensor_types):
                raise TypeError(
                    f"Input tensor must be of type {verify_cfg.supported_tensor_types}, but got {type(input_tensor)}"
                )
    
        if not isinstance(framework_model, verify_cfg.framework_model_types):
            raise TypeError(
                f"Framework model must be of type {verify_cfg.framework_model_types}, but got {type(framework_model)}"
            )
    
        if not isinstance(compiled_model, verify_cfg.compiled_model_types):
            raise TypeError(
                f"Compiled model must be of type {verify_cfg.compiled_model_types}, but got {type(compiled_model)}"
            )
    
        # 1st step: run forward pass for the networks
        fw_out = framework_model(*inputs)
        co_out = compiled_model(*inputs)
    
        # 2nd step: apply preprocessing (push tensors to cpu, perform any reshape if necessary,
        #  cast from tensorflow tensors to pytorch tensors if needed)
        if not isinstance(fw_out, torch.Tensor):
            fw_out = to_pt_tensors(fw_out)
    
        co_out = [co.to("cpu") for co in co_out]
        fw_out = [fw_out] if isinstance(fw_out, torch.Tensor) else fw_out
    
        # 3rd step: verifications of outputs
        # - dtype check
        # - shape check
        # - compare with golden
        if verify_cfg.verify_size:
            if len(fw_out) != len(co_out):
                raise ValueError(
                    f"Number of outputs from framework model and compiled model do not match: framework model has {len(fw_out)} outputs, compiled model has {len(co_out)} outputs"
                )
    
        for fw, co in zip(fw_out, co_out):
            if verify_cfg.verify_dtype:
                if fw.dtype != co.dtype:
                    raise TypeError(f"Dtype mismatch: framework_model.dtype={fw.dtype}, compiled_model.dtype={co.dtype}")
            if verify_cfg.verify_shape:
                if fw.shape != co.shape:
                    raise ValueError(f"Shape mismatch: framework_model.shape={fw.shape}, compiled_model.shape={co.shape}")
            if verify_cfg.verify_data:
                if not compare_with_golden(golden=fw, calculated=co, verify_cfg=verify_cfg):
>                   raise ValueError(f"Data mismatch (compare_with_golden): framework_model={fw}, compiled_model={co}")
E                   ValueError: Data mismatch (compare_with_golden): framework_model=tensor([[[[-0.07080, -0.08740, -1.27344,  ..., -0.75781, -0.37500,  0.77734],
E                             [ 0.24707,  0.50000, -0.96094,  ..., -0.58203, -0.42773,  1.22656],
E                             [ 0.45117,  0.60156, -0.94141,  ..., -0.29297, -0.35547,  1.42969],
E                             ...,
E                             [ 0.09375,  0.34766, -0.94531,  ..., -0.54297, -0.29883,  1.31250],
E                             [ 0.30664,  0.79297, -1.05469,  ..., -0.54297, -0.51562,  1.44531],
E                             [ 0.13770,  0.58203,  0.01410,  ...,  0.25586,  0.23242,  1.20312]],
E                   
E                            [[ 0.20117,  0.25391, -1.20312,  ..., -0.36914, -1.25781,  0.30859],
E                             [ 0.49414,  0.81641, -0.88672,  ..., -0.36719, -1.37500,  0.51172],
E                             [ 0.51562,  0.81250, -0.93750,  ...,  0.27930, -1.21875,  0.42969],
E                             ...,
E                             [ 0.56641,  0.80859, -0.80078,  ...,  0.20020, -1.65625,  0.79297],
E                             [ 0.82031,  0.99219, -0.78906,  ..., -0.34766, -1.32031,  0.51562],
E                             [ 0.48438,  0.75781, -0.13672,  ...,  0.35352, -0.82812,  1.03125]],
E                   
E                            [[ 0.34180,  0.22461, -1.21875,  ..., -0.25000, -1.39844,  0.31250],
E                             [ 0.75781,  0.80078, -0.86719,  ..., -0.09326, -1.23438,  0.47656],
E                             [ 0.57031,  0.92188, -0.80859,  ..., -0.20996, -1.64062,  0.48242],
E                             ...,
E                             [ 0.58594,  0.61328, -0.98828,  ...,  0.11230, -1.17188,  0.80859],
E                             [ 0.51172,  0.72656, -0.87109,  ..., -0.03223, -1.35938,  0.74219],
E                             [ 0.37109,  0.72656, -0.46094,  ...,  0.28125, -0.67188,  1.01562]],
E                   
E                            ...,
E                   
E                            [[ 0.37305, -0.04272, -1.26562,  ..., -0.58984, -1.37500,  0.31836],
E                             [ 0.87500,  0.80078, -0.67578,  ...,  0.05127, -1.26562,  0.34766],
E                             [ 0.69141,  0.98047, -0.82812,  ..., -0.22168, -1.14844,  0.67578],
E                             ...,
E                             [ 0.91797,  0.80859, -0.92969,  ...,  0.04614, -1.65625,  0.60547],
E                             [ 0.66016,  1.14844, -0.86719,  ...,  0.25781, -1.31250,  0.82031],
E                             [ 0.55469,  0.75000, -0.22852,  ...,  0.21484, -0.79297,  1.17188]],
E                   
E                            [[ 0.21387,  0.04053, -1.35938,  ..., -0.42383, -1.39062,  0.42578],
E                             [ 0.80469,  0.57812, -0.96484,  ..., -0.09326, -1.42969,  1.03906],
E                             [ 0.74219,  0.53516, -1.00000,  ..., -0.25000, -1.59375,  0.60547],
E                             ...,
E                             [ 0.72656,  0.33984, -1.03125,  ...,  0.20508, -1.39062,  0.39258],
E                             [ 0.66797,  0.91797, -0.80469,  ...,  0.07178, -1.43750,  0.83594],
E                             [ 0.46289,  1.03906, -0.15234,  ...,  0.16406, -0.27734,  0.95703]],
E                   
E                            [[ 0.36914,  0.66406, -0.55078,  ...,  0.01575, -1.29688, -0.25391],
E                             [ 0.49023,  0.85156,  0.00339,  ..., -0.26367, -1.09375,  0.25586],
E                             [ 0.53516,  1.15625, -0.08691,  ..., -0.10645, -1.32031,  0.28906],
E                             ...,
E                             [ 0.62891,  1.01562, -0.03418,  ..., -0.00879, -1.32812,  0.28711],
E                             [ 0.55859,  0.92969, -0.00339,  ...,  0.00778, -1.64844,  0.22266],
E                             [ 0.32031,  0.70312,  0.23828,  ...,  0.15332, -0.60156,  0.79297]]]], dtype=torch.bfloat16, requires_grad=True), compiled_model=tensor([[[[-3.39355e-02, -7.17773e-02, -1.22656e+00,  ..., -6.67969e-01, -2.37305e-01,  9.17969e-01],
E                             [ 2.65625e-01,  5.97656e-01, -9.02344e-01,  ..., -5.07812e-01, -3.14453e-01,  1.32031e+00],
E                             [ 5.15625e-01,  4.96094e-01, -7.96875e-01,  ..., -4.82422e-01, -5.03906e-01,  1.36719e+00],
E                             ...,
E                             [ 4.72499e+35, -1.03846e+36, -9.65767e+35,  ...,  2.19115e+36, -8.37258e+34,  1.65115e+36],
E                             [-2.49230e+37, -1.14646e+37,  2.01046e+37,  ..., -1.60338e+37,  1.75292e+37,  1.77784e+37],
E                             [ 8.22460e+36, -1.11323e+37, -1.85261e+37,  ..., -1.02184e+37, -6.10614e+36,  1.67938e+34]],
E                   
E                            [[ 4.72656e-01,  3.78906e-01, -1.19531e+00,  ..., -4.17969e-01, -1.40625e+00,  1.87500e-01],
E                             [ 5.66406e-01,  9.17969e-01, -8.32031e-01,  ..., -4.04297e-01, -1.27344e+00,  5.82031e-01],
E                             [ 4.88281e-01,  7.92969e-01, -1.03125e+00,  ...,  5.93262e-02, -1.33594e+00,  6.28906e-01],
E                             ...,
E                             [-1.08000e+37,  9.01383e+36,  1.86923e+37,  ..., -2.76490e+35,  1.08000e+37,  6.18922e+36],
E                             [-1.07169e+37,  1.32923e+37,  2.09769e+36,  ...,  1.86923e+37,  1.23317e+35,  3.67199e+37],
E                             [-2.57538e+37,  1.48707e+37,  2.40923e+37,  ..., -4.13722e+37,  2.60861e+37,  2.94092e+37]],
E                   
E                            [[ 1.48438e-01,  3.94531e-01, -1.13281e+00,  ..., -4.68750e-01, -1.39844e+00,  4.37012e-02],
E                             [ 6.75781e-01,  7.57812e-01, -7.53906e-01,  ...,  1.46484e-01, -1.58594e+00,  6.71875e-01],
E                             [ 5.00000e-01,  9.29688e-01, -9.68750e-01,  ...,  1.57227e-01, -1.53906e+00,  3.76953e-01],
E                             ...,
E                             [-2.75815e+37,  6.85383e+35, -1.26277e+37,  ...,  6.35537e+36, -2.74153e+37, -2.77476e+37],
E                             [-1.99384e+37, -1.02184e+37, -2.80799e+37,  ..., -3.50584e+37, -5.69076e+36,  3.17353e+37],
E                             [ 5.15076e+37,  2.74153e+36, -1.09661e+37,  ..., -3.05722e+37, -3.30645e+37,  2.95753e+37]],
E                   
E                            ...,
E                   
E                            [[ 3.65234e-01,  1.58203e-01, -8.86719e-01,  ..., -1.36719e-01, -1.21094e+00,  3.14453e-01],
E                             [ 6.87500e-01,  5.15625e-01, -1.10938e+00,  ...,  4.76074e-02, -1.32031e+00,  5.50781e-01],
E                             [ 6.36719e-01,  1.11719e+00, -7.96875e-01,  ..., -2.35352e-01, -1.28125e+00,  6.95312e-01],
E                             ...,
E                             [ 5.54953e+37,  6.77906e+37, -3.80492e+37,  ...,  1.32923e+37,  3.63876e+37,  6.89537e+36],
E                             [ 5.18399e+37,  9.63690e+37, -3.52245e+37,  ..., -1.45384e+37,  3.09046e+37,  3.38953e+37],
E                             [-1.12984e+37,  4.08738e+37, -2.59199e+37,  ..., -2.14338e+37, -2.17661e+37,  2.31576e+36]],
E                   
E                            [[ 3.82812e-01,  6.20117e-02, -1.10938e+00,  ..., -4.04297e-01, -1.36719e+00,  1.74805e-01],
E                             [ 6.21094e-01,  8.98438e-01, -9.76562e-01,  ...,  2.08008e-01, -1.47656e+00,  9.02344e-01],
E                             [ 5.89844e-01,  7.14844e-01, -6.95312e-01,  ..., -9.13086e-02, -1.33594e+00,  9.88281e-01],
E                             ...,
E                             [ 1.74461e+37, -2.14338e+37,  3.25661e+37,  ...,  2.69169e+37, -2.27630e+37,  3.35630e+37],
E                             [-1.70307e+37,  2.95753e+37, -5.10922e+36,  ...,  1.37077e+36, -3.32307e+36,  2.74153e+37],
E                             [ 2.65846e+37, -3.70522e+37,  2.27630e+37,  ...,  4.56922e+36,  3.52245e+37,  1.03431e+37]],
E                   
E                            [[ 2.94922e-01,  6.79688e-01, -5.97656e-01,  ..., -5.02930e-02, -1.46094e+00, -3.65234e-01],
E                             [ 7.38281e-01,  9.14062e-01, -1.54297e-01,  ...,  9.42383e-02, -1.41406e+00, -6.01196e-03],
E                             [ 6.67969e-01,  1.15625e+00, -1.99219e-01,  ..., -1.99219e-01, -1.39062e+00,  1.43555e-01],
E                             ...,
E                             [-1.66153e+37, -2.59199e+37, -2.34276e+37,  ...,  3.02399e+37,  1.45384e+37,  3.20676e+37],
E                             [-2.90769e+36,  4.25353e+37, -1.45384e+37,  ..., -1.22123e+37,  2.11846e+36,  4.08738e+37],
E                             [-1.08000e+37, -1.13815e+37, -2.18076e+36,  ...,  4.00845e+36, -9.22152e+36,  1.76953e+37]]]], dtype=torch.bfloat16)

forge/forge/verify/verify.py:333: ValueError

Check failure on line 190 in forge/test/mlir/test_ops_tf.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_ops_tf.test_maxpool2d[act_shape26]

ValueError: Data mismatch (compare_with_golden): framework_model=tensor([[[[-4.96094e-01, -2.43164e-01, -9.02344e-01,  ...,  2.91016e-01, -6.60156e-01,  2.08008e-01],
          [-3.80859e-02, -7.85156e-01, -7.07031e-01,  ..., -3.00781e-01, -5.85938e-01, -4.45312e-01],
          [ 1.36719e-01, -6.13281e-01, -8.71094e-01,  ..., -5.23438e-01, -6.21094e-01, -5.31250e-01],
          ...,
          [ 7.22656e-02, -5.78125e-01, -8.32031e-01,  ..., -4.06250e-01, -7.14844e-01, -3.82812e-01],
          [ 7.50732e-03, -3.04688e-01, -9.25781e-01,  ..., -4.14062e-01, -3.63281e-01, -6.21094e-01],
          [ 6.21094e-01, -1.48438e-01, -3.08594e-01,  ...,  4.83398e-02, -2.51953e-01, -5.31250e-01]],

         [[-8.63281e-01, -4.64844e-01, -1.38281e+00,  ...,  4.31641e-01, -8.75000e-01,  7.42188e-01],
          [ 9.27734e-02, -3.55469e-01, -1.26562e+00,  ..., -3.90625e-01, -1.36719e+00,  2.55859e-01],
          [ 4.27246e-02, -2.77344e-01, -1.26562e+00,  ..., -5.11719e-01, -1.46094e+00,  2.07031e-01],
          ...,
          [ 2.89062e-01, -6.01562e-01, -1.16406e+00,  ..., -7.14844e-01, -1.25000e+00,  2.53906e-01],
          [ 3.49609e-01, -4.10156e-01, -1.01562e+00,  ..., -4.45312e-01, -1.20312e+00,  2.35352e-01],
          [ 6.32812e-01, -3.30078e-01, -1.00781e+00,  ..., -4.49219e-01, -4.72656e-01, -3.75000e-01]],

         [[-6.28906e-01, -3.51562e-01, -1.32031e+00,  ...,  5.54688e-01, -6.28906e-01,  9.41406e-01],
          [ 1.22559e-01, -3.02734e-01, -1.59375e+00,  ..., -5.78125e-01, -1.45312e+00,  1.15967e-03],
          [ 4.86328e-01, -3.28125e-01, -1.32031e+00,  ..., -7.30469e-01, -1.07812e+00, -9.15527e-03],
          ...,
          [ 2.43164e-01, -5.89844e-01, -1.09375e+00,  ..., -3.30078e-01, -1.21875e+00,  2.24609e-01],
          [ 1.66016e-01, -5.07812e-01, -1.31250e+00,  ..., -3.30078e-01, -1.55469e+00,  5.11719e-01],
          [ 2.81250e-01, -1.10352e-01, -1.22656e+00,  ..., -5.50781e-01, -8.08594e-01, -3.35938e-01]],

         ...,

         [[-9.25781e-01, -3.61328e-01, -1.46875e+00,  ...,  6.67969e-01, -7.10938e-01,  9.21875e-01],
          [ 3.94531e-01, -4.55078e-01, -1.42969e+00,  ..., -3.55469e-01, -1.18750e+00, -4.10156e-02],
          [ 2.63672e-01, -7.10938e-01, -1.43750e+00,  ..., -7.53906e-01, -1.35156e+00,  2.69531e-01],
          ...,
          [ 2.75391e-01, -4.37500e-01, -1.32031e+00,  ..., -6.91406e-01, -1.25781e+00,  3.94531e-01],
          [-1.43433e-02, -5.78125e-01, -1.48438e+00,  ..., -3.96484e-01, -1.28125e+00,  2.24609e-01],
          [ 1.02344e+00,  1.28906e-01, -1.15625e+00,  ..., -4.31641e-01, -9.76562e-01, -1.28906e-01]],

         [[-5.27344e-01, -2.87109e-01, -1.37500e+00,  ...,  4.74609e-01, -9.14062e-01,  1.00781e+00],
          [ 2.22656e-01, -6.21094e-01, -1.23438e+00,  ..., -4.70703e-01, -1.32031e+00,  2.71484e-01],
          [ 5.00000e-01, -2.43164e-01, -1.46094e+00,  ..., -4.19922e-01, -1.39062e+00,  1.66992e-01],
          ...,
          [ 3.29590e-03, -6.79688e-01, -1.21094e+00,  ..., -5.35156e-01, -1.35156e+00,  6.83594e-02],
          [ 4.41895e-02, -4.74609e-01, -1.20312e+00,  ..., -6.87500e-01, -1.32812e+00,  5.12695e-02],
          [ 7.34375e-01, -3.20312e-01, -9.25781e-01,  ..., -5.70312e-01, -8.98438e-01, -3.80859e-01]],

         [[-1.07812e+00, -6.22559e-02, -1.16406e+00,  ...,  1.04688e+00, -1.00781e+00,  1.28125e+00],
          [-1.23047e-01, -2.08984e-01, -1.12500e+00,  ...,  5.31250e-01, -1.43750e+00,  4.12109e-01],
          [ 8.88672e-02, -1.66016e-01, -7.69531e-01,  ...,  5.27344e-01, -1.33594e+00,  7.61719e-01],
          ...,
          [-1.25000e-01, -1.19629e-01, -1.10938e+00,  ...,  2.98828e-01, -1.57031e+00,  5.85938e-01],
          [-1.41602e-01,  7.71484e-02, -1.13281e+00,  ...,  6.79688e-01, -1.43750e+00,  5.31250e-01],
          [ 5.82031e-01,  9.71680e-02, -7.65625e-01,  ..., -7.12891e-02, -9.96094e-01,  3.71094e-02]]]], dtype=torch.bfloat16, requires_grad=True), compiled_model=tensor([[[[-4.08203e-01, -1.29883e-01, -9.88281e-01,  ...,  2.31445e-01, -5.66406e-01,  1.98242e-01],
          [ 6.12793e-02, -7.03125e-01, -8.28125e-01,  ..., -5.39062e-01, -6.17188e-01, -4.76562e-01],
          [ 1.53320e-01, -6.56250e-01, -8.24219e-01,  ..., -5.93750e-01, -7.65625e-01, -4.60938e-01],
          ...,
          [-1.29288e+36,  1.08000e+36, -1.20981e+36,  ...,  1.20981e+36,  6.69806e+35, -8.35960e+35],
          [ 2.27630e+37,  2.92430e+37, -1.24615e+37,  ...,  3.73845e+36,  3.07384e+36, -2.27630e+37],
          [-1.60338e+37, -1.52030e+37,  1.59507e+37,  ..., -7.47691e+35,  1.18800e+37, -1.37077e+36]],

         [[-8.35938e-01, -5.46875e-01, -1.45312e+00,  ...,  3.78906e-01, -6.28906e-01,  7.89062e-01],
          [-4.71191e-02, -3.14453e-01, -1.23438e+00,  ..., -6.21094e-01, -1.39062e+00,  3.67188e-01],
          [ 1.68945e-01, -1.98242e-01, -1.40625e+00,  ..., -4.17969e-01, -1.48438e+00,  2.51953e-01],
          ...,
          [-5.37403e+35, -9.42921e+36,  1.85261e+37,  ...,  3.09046e+37, -6.47999e+36,  1.05507e+37],
          [-2.84122e+37, -2.34276e+37, -2.60861e+37,  ...,  9.88613e+36, -3.67615e+36,  1.73630e+37],
          [-1.79446e+37,  1.29600e+37,  1.21292e+37,  ..., -2.40923e+37, -9.63690e+36, -2.29292e+37]],

         [[-9.57031e-01, -5.58594e-01, -1.20312e+00,  ...,  5.00000e-01, -1.06250e+00,  9.96094e-01],
          [ 9.27734e-02, -5.62500e-01, -1.19531e+00,  ..., -4.35547e-01, -1.53906e+00,  3.90625e-01],
          [-1.08887e-01, -5.54688e-01, -1.30469e+00,  ..., -4.96094e-01, -1.28125e+00,  4.21875e-01],
          ...,
          [-1.03015e+37,  4.00430e+37,  4.29922e+36,  ..., -2.49230e+37, -1.19631e+37,  1.06338e+37],
          [-2.02707e+37, -2.19323e+37, -1.52030e+37,  ..., -5.15076e+36,  1.63661e+37,  2.35938e+37],
          [-4.27845e+36, -4.81845e+37, -4.94307e+36,  ..., -1.64492e+37, -1.91077e+37,  1.49538e+37]],

         ...,

         [[-1.17969e+00, -4.76562e-01, -1.42969e+00,  ...,  5.78125e-01, -1.01562e+00,  1.11719e+00],
          [ 5.44434e-02, -4.14062e-01, -1.55469e+00,  ..., -1.23047e-01, -1.42188e+00,  7.95898e-02],
          [ 6.54297e-02, -2.57812e-01, -1.60156e+00,  ..., -3.78906e-01, -1.17969e+00,  1.34766e-01],
          ...,
          [-2.39261e+37, -1.86092e+37, -6.94522e+37,  ..., -2.95753e+37, -2.75815e+37,  3.05722e+37],
          [ 9.70336e+37,  1.68646e+37, -9.92767e+36,  ..., -1.60338e+37,  6.68768e+36, -7.14460e+37],
          [ 3.28984e+37,  3.42692e+36, -5.11753e+37,  ..., -4.58584e+37, -5.15076e+36,  3.23999e+37]],

         [[-9.57031e-01, -7.77344e-01, -1.24219e+00,  ...,  4.55078e-01, -9.45312e-01,  1.18750e+00],
          [ 1.83594e-01, -5.50781e-01, -9.14062e-01,  ..., -4.76562e-01, -1.39062e+00,  8.00781e-02],
          [ 3.02734e-01, -5.70312e-01, -1.12500e+00,  ..., -3.16406e-01, -1.39844e+00,  4.57031e-01],
          ...,
          [ 3.14030e+37, -1.73423e+36, -2.14338e+37,  ...,  7.76768e+36, -4.51938e+37,  6.77906e+37],
          [-1.90246e+37,  4.48614e+37, -8.90583e+37,  ..., -1.71138e+37, -4.51938e+37,  1.91907e+37],
          [ 3.04061e+37, -2.80799e+37, -5.35014e+37,  ...,  1.02600e+37, -2.85784e+37,  3.35630e+37]],

         [[-1.14062e+00,  2.14844e-02, -1.08594e+00,  ...,  1.05469e+00, -9.25781e-01,  1.21875e+00],
          [ 1.31836e-01,  9.03320e-02, -8.51562e-01,  ...,  4.47266e-01, -1.44531e+00,  3.69141e-01],
          [ 1.55273e-01, -8.69141e-02, -9.37500e-01,  ...,  4.80469e-01, -1.45312e+00,  5.58594e-01],
          ...,
          [ 2.32615e+37, -1.68230e+36, -5.85691e+36,  ...,  3.75507e+37, -1.14646e+37, -1.25446e+37],
          [-8.84767e+36, -2.79138e+37,  4.75199e+37,  ...,  2.16000e+37, -2.25969e+37,  2.18076e+36],
          [ 9.76152e+36, -4.42384e+36,  5.89845e+36,  ..., -3.33969e+37,  1.30430e+37, -7.80921e+36]]]], dtype=torch.bfloat16)
Raw output
act_shape = (1, 128, 128, 128)

    @pytest.mark.parametrize(
        "act_shape",  ## NHWC
        [
            (1, 32, 32, 32),
            (1, 32, 32, 64),
            (1, 32, 32, 128),
            (1, 32, 64, 32),
            (1, 32, 64, 64),
            (1, 32, 64, 128),
            (1, 32, 128, 32),
            (1, 32, 128, 64),
            (1, 32, 128, 128),
            (1, 64, 32, 32),
            (1, 64, 32, 64),
            (1, 64, 32, 128),
            (1, 64, 64, 32),
            (1, 64, 64, 64),
            (1, 64, 64, 128),
            (1, 64, 128, 32),
            (1, 64, 128, 64),
            (1, 64, 128, 128),
            (1, 128, 32, 32),
            (1, 128, 32, 64),
            (1, 128, 32, 128),
            (1, 128, 64, 32),
            (1, 128, 64, 64),
            (1, 128, 64, 128),
            (1, 128, 128, 32),
            (1, 128, 128, 64),
            (1, 128, 128, 128),
        ],
    )
    @pytest.mark.push
    def test_maxpool2d(
        act_shape,
    ):
        # NOTE: Only shapes that are tile-dim aligned before and after
        # the maxpool operation work through the forge-mlir flow. This,
        # limits the variablity that is supported for padding, pool size,
        # strides, and dilation.
        tf.random.set_seed(0)
    
        class MaxPool(tf.keras.Model):
            def __init__(self):
                super().__init__()
                self.pool = tf.keras.layers.MaxPool2D(pool_size=(2, 2), padding="valid", dtype=tf.bfloat16)
                self.conv = tf.keras.layers.Conv2D(act_shape[-1], (3, 3), padding="same", dtype=tf.bfloat16)
    
            def call(self, x):
                x = self.pool(x)
                x = self.conv(x)
                return x
    
        _get_global_compiler_config().default_df_override = DataFormat.Float16_b
        inputs = [tf.random.uniform(act_shape, dtype=tf.bfloat16)]
    
        framework_model = MaxPool()
        compiled_model = forge.compile(framework_model, sample_inputs=inputs)
    
>       verify(inputs, framework_model, compiled_model, VerifyConfig(verify_allclose=False))

forge/test/mlir/test_ops_tf.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

inputs = [<tf.Tensor: shape=(1, 128, 128, 128), dtype=bfloat16, numpy=
array([[[[0.882812, 0.539062, 0.367188, ..., 0.984375, 0....., 0.664062, 0, 0.75],
         [0.148438, 0.328125, 0.773438, ..., 0.65625, 0.570312, 0.992188]]]], dtype=bfloat16)>]
framework_model = <test_ops_tf.test_maxpool2d.<locals>.MaxPool object at 0x7f63f7335900>
compiled_model = <forge.compiled_graph_state.CompiledModel object at 0x7f63f52d8e20>
verify_cfg = VerifyConfig(enabled=True, verify_size=True, verify_dtype=True, verify_shape=True, verify_data=True, verify_allclose=F...bfloat16: 1e-08}, relative_atol=0.1, pcc=0.99, dissimilarity_threshold=0.001, dump_tensors=False, dump_tensors_path='')

    def verify(
        inputs: List[Union[torch.Tensor, tf.Tensor, tf.Variable]],
        framework_model: Union[torch.nn.Module, tf.Module, tf.keras.Model],
        compiled_model: CompiledModel,
        verify_cfg: VerifyConfig = VerifyConfig(),
    ):
        """
        Verify the compiled model against the framework model
        """
        if not verify_cfg.enabled:
            logger.warning("Verification is disabled")
            return
    
        from forge.op.eval.common import compare_with_golden  # avoid circular import
    
        # 0th step: input checks
    
        # Check if inputs are of the correct type
        if not inputs:
            raise ValueError("Input tensors must be provided")
        for input_tensor in inputs:
            if not isinstance(input_tensor, verify_cfg.supported_tensor_types):
                raise TypeError(
                    f"Input tensor must be of type {verify_cfg.supported_tensor_types}, but got {type(input_tensor)}"
                )
    
        if not isinstance(framework_model, verify_cfg.framework_model_types):
            raise TypeError(
                f"Framework model must be of type {verify_cfg.framework_model_types}, but got {type(framework_model)}"
            )
    
        if not isinstance(compiled_model, verify_cfg.compiled_model_types):
            raise TypeError(
                f"Compiled model must be of type {verify_cfg.compiled_model_types}, but got {type(compiled_model)}"
            )
    
        # 1st step: run forward pass for the networks
        fw_out = framework_model(*inputs)
        co_out = compiled_model(*inputs)
    
        # 2nd step: apply preprocessing (push tensors to cpu, perform any reshape if necessary,
        #  cast from tensorflow tensors to pytorch tensors if needed)
        if not isinstance(fw_out, torch.Tensor):
            fw_out = to_pt_tensors(fw_out)
    
        co_out = [co.to("cpu") for co in co_out]
        fw_out = [fw_out] if isinstance(fw_out, torch.Tensor) else fw_out
    
        # 3rd step: verifications of outputs
        # - dtype check
        # - shape check
        # - compare with golden
        if verify_cfg.verify_size:
            if len(fw_out) != len(co_out):
                raise ValueError(
                    f"Number of outputs from framework model and compiled model do not match: framework model has {len(fw_out)} outputs, compiled model has {len(co_out)} outputs"
                )
    
        for fw, co in zip(fw_out, co_out):
            if verify_cfg.verify_dtype:
                if fw.dtype != co.dtype:
                    raise TypeError(f"Dtype mismatch: framework_model.dtype={fw.dtype}, compiled_model.dtype={co.dtype}")
            if verify_cfg.verify_shape:
                if fw.shape != co.shape:
                    raise ValueError(f"Shape mismatch: framework_model.shape={fw.shape}, compiled_model.shape={co.shape}")
            if verify_cfg.verify_data:
                if not compare_with_golden(golden=fw, calculated=co, verify_cfg=verify_cfg):
>                   raise ValueError(f"Data mismatch (compare_with_golden): framework_model={fw}, compiled_model={co}")
E                   ValueError: Data mismatch (compare_with_golden): framework_model=tensor([[[[-4.96094e-01, -2.43164e-01, -9.02344e-01,  ...,  2.91016e-01, -6.60156e-01,  2.08008e-01],
E                             [-3.80859e-02, -7.85156e-01, -7.07031e-01,  ..., -3.00781e-01, -5.85938e-01, -4.45312e-01],
E                             [ 1.36719e-01, -6.13281e-01, -8.71094e-01,  ..., -5.23438e-01, -6.21094e-01, -5.31250e-01],
E                             ...,
E                             [ 7.22656e-02, -5.78125e-01, -8.32031e-01,  ..., -4.06250e-01, -7.14844e-01, -3.82812e-01],
E                             [ 7.50732e-03, -3.04688e-01, -9.25781e-01,  ..., -4.14062e-01, -3.63281e-01, -6.21094e-01],
E                             [ 6.21094e-01, -1.48438e-01, -3.08594e-01,  ...,  4.83398e-02, -2.51953e-01, -5.31250e-01]],
E                   
E                            [[-8.63281e-01, -4.64844e-01, -1.38281e+00,  ...,  4.31641e-01, -8.75000e-01,  7.42188e-01],
E                             [ 9.27734e-02, -3.55469e-01, -1.26562e+00,  ..., -3.90625e-01, -1.36719e+00,  2.55859e-01],
E                             [ 4.27246e-02, -2.77344e-01, -1.26562e+00,  ..., -5.11719e-01, -1.46094e+00,  2.07031e-01],
E                             ...,
E                             [ 2.89062e-01, -6.01562e-01, -1.16406e+00,  ..., -7.14844e-01, -1.25000e+00,  2.53906e-01],
E                             [ 3.49609e-01, -4.10156e-01, -1.01562e+00,  ..., -4.45312e-01, -1.20312e+00,  2.35352e-01],
E                             [ 6.32812e-01, -3.30078e-01, -1.00781e+00,  ..., -4.49219e-01, -4.72656e-01, -3.75000e-01]],
E                   
E                            [[-6.28906e-01, -3.51562e-01, -1.32031e+00,  ...,  5.54688e-01, -6.28906e-01,  9.41406e-01],
E                             [ 1.22559e-01, -3.02734e-01, -1.59375e+00,  ..., -5.78125e-01, -1.45312e+00,  1.15967e-03],
E                             [ 4.86328e-01, -3.28125e-01, -1.32031e+00,  ..., -7.30469e-01, -1.07812e+00, -9.15527e-03],
E                             ...,
E                             [ 2.43164e-01, -5.89844e-01, -1.09375e+00,  ..., -3.30078e-01, -1.21875e+00,  2.24609e-01],
E                             [ 1.66016e-01, -5.07812e-01, -1.31250e+00,  ..., -3.30078e-01, -1.55469e+00,  5.11719e-01],
E                             [ 2.81250e-01, -1.10352e-01, -1.22656e+00,  ..., -5.50781e-01, -8.08594e-01, -3.35938e-01]],
E                   
E                            ...,
E                   
E                            [[-9.25781e-01, -3.61328e-01, -1.46875e+00,  ...,  6.67969e-01, -7.10938e-01,  9.21875e-01],
E                             [ 3.94531e-01, -4.55078e-01, -1.42969e+00,  ..., -3.55469e-01, -1.18750e+00, -4.10156e-02],
E                             [ 2.63672e-01, -7.10938e-01, -1.43750e+00,  ..., -7.53906e-01, -1.35156e+00,  2.69531e-01],
E                             ...,
E                             [ 2.75391e-01, -4.37500e-01, -1.32031e+00,  ..., -6.91406e-01, -1.25781e+00,  3.94531e-01],
E                             [-1.43433e-02, -5.78125e-01, -1.48438e+00,  ..., -3.96484e-01, -1.28125e+00,  2.24609e-01],
E                             [ 1.02344e+00,  1.28906e-01, -1.15625e+00,  ..., -4.31641e-01, -9.76562e-01, -1.28906e-01]],
E                   
E                            [[-5.27344e-01, -2.87109e-01, -1.37500e+00,  ...,  4.74609e-01, -9.14062e-01,  1.00781e+00],
E                             [ 2.22656e-01, -6.21094e-01, -1.23438e+00,  ..., -4.70703e-01, -1.32031e+00,  2.71484e-01],
E                             [ 5.00000e-01, -2.43164e-01, -1.46094e+00,  ..., -4.19922e-01, -1.39062e+00,  1.66992e-01],
E                             ...,
E                             [ 3.29590e-03, -6.79688e-01, -1.21094e+00,  ..., -5.35156e-01, -1.35156e+00,  6.83594e-02],
E                             [ 4.41895e-02, -4.74609e-01, -1.20312e+00,  ..., -6.87500e-01, -1.32812e+00,  5.12695e-02],
E                             [ 7.34375e-01, -3.20312e-01, -9.25781e-01,  ..., -5.70312e-01, -8.98438e-01, -3.80859e-01]],
E                   
E                            [[-1.07812e+00, -6.22559e-02, -1.16406e+00,  ...,  1.04688e+00, -1.00781e+00,  1.28125e+00],
E                             [-1.23047e-01, -2.08984e-01, -1.12500e+00,  ...,  5.31250e-01, -1.43750e+00,  4.12109e-01],
E                             [ 8.88672e-02, -1.66016e-01, -7.69531e-01,  ...,  5.27344e-01, -1.33594e+00,  7.61719e-01],
E                             ...,
E                             [-1.25000e-01, -1.19629e-01, -1.10938e+00,  ...,  2.98828e-01, -1.57031e+00,  5.85938e-01],
E                             [-1.41602e-01,  7.71484e-02, -1.13281e+00,  ...,  6.79688e-01, -1.43750e+00,  5.31250e-01],
E                             [ 5.82031e-01,  9.71680e-02, -7.65625e-01,  ..., -7.12891e-02, -9.96094e-01,  3.71094e-02]]]], dtype=torch.bfloat16, requires_grad=True), compiled_model=tensor([[[[-4.08203e-01, -1.29883e-01, -9.88281e-01,  ...,  2.31445e-01, -5.66406e-01,  1.98242e-01],
E                             [ 6.12793e-02, -7.03125e-01, -8.28125e-01,  ..., -5.39062e-01, -6.17188e-01, -4.76562e-01],
E                             [ 1.53320e-01, -6.56250e-01, -8.24219e-01,  ..., -5.93750e-01, -7.65625e-01, -4.60938e-01],
E                             ...,
E                             [-1.29288e+36,  1.08000e+36, -1.20981e+36,  ...,  1.20981e+36,  6.69806e+35, -8.35960e+35],
E                             [ 2.27630e+37,  2.92430e+37, -1.24615e+37,  ...,  3.73845e+36,  3.07384e+36, -2.27630e+37],
E                             [-1.60338e+37, -1.52030e+37,  1.59507e+37,  ..., -7.47691e+35,  1.18800e+37, -1.37077e+36]],
E                   
E                            [[-8.35938e-01, -5.46875e-01, -1.45312e+00,  ...,  3.78906e-01, -6.28906e-01,  7.89062e-01],
E                             [-4.71191e-02, -3.14453e-01, -1.23438e+00,  ..., -6.21094e-01, -1.39062e+00,  3.67188e-01],
E                             [ 1.68945e-01, -1.98242e-01, -1.40625e+00,  ..., -4.17969e-01, -1.48438e+00,  2.51953e-01],
E                             ...,
E                             [-5.37403e+35, -9.42921e+36,  1.85261e+37,  ...,  3.09046e+37, -6.47999e+36,  1.05507e+37],
E                             [-2.84122e+37, -2.34276e+37, -2.60861e+37,  ...,  9.88613e+36, -3.67615e+36,  1.73630e+37],
E                             [-1.79446e+37,  1.29600e+37,  1.21292e+37,  ..., -2.40923e+37, -9.63690e+36, -2.29292e+37]],
E                   
E                            [[-9.57031e-01, -5.58594e-01, -1.20312e+00,  ...,  5.00000e-01, -1.06250e+00,  9.96094e-01],
E                             [ 9.27734e-02, -5.62500e-01, -1.19531e+00,  ..., -4.35547e-01, -1.53906e+00,  3.90625e-01],
E                             [-1.08887e-01, -5.54688e-01, -1.30469e+00,  ..., -4.96094e-01, -1.28125e+00,  4.21875e-01],
E                             ...,
E                             [-1.03015e+37,  4.00430e+37,  4.29922e+36,  ..., -2.49230e+37, -1.19631e+37,  1.06338e+37],
E                             [-2.02707e+37, -2.19323e+37, -1.52030e+37,  ..., -5.15076e+36,  1.63661e+37,  2.35938e+37],
E                             [-4.27845e+36, -4.81845e+37, -4.94307e+36,  ..., -1.64492e+37, -1.91077e+37,  1.49538e+37]],
E                   
E                            ...,
E                   
E                            [[-1.17969e+00, -4.76562e-01, -1.42969e+00,  ...,  5.78125e-01, -1.01562e+00,  1.11719e+00],
E                             [ 5.44434e-02, -4.14062e-01, -1.55469e+00,  ..., -1.23047e-01, -1.42188e+00,  7.95898e-02],
E                             [ 6.54297e-02, -2.57812e-01, -1.60156e+00,  ..., -3.78906e-01, -1.17969e+00,  1.34766e-01],
E                             ...,
E                             [-2.39261e+37, -1.86092e+37, -6.94522e+37,  ..., -2.95753e+37, -2.75815e+37,  3.05722e+37],
E                             [ 9.70336e+37,  1.68646e+37, -9.92767e+36,  ..., -1.60338e+37,  6.68768e+36, -7.14460e+37],
E                             [ 3.28984e+37,  3.42692e+36, -5.11753e+37,  ..., -4.58584e+37, -5.15076e+36,  3.23999e+37]],
E                   
E                            [[-9.57031e-01, -7.77344e-01, -1.24219e+00,  ...,  4.55078e-01, -9.45312e-01,  1.18750e+00],
E                             [ 1.83594e-01, -5.50781e-01, -9.14062e-01,  ..., -4.76562e-01, -1.39062e+00,  8.00781e-02],
E                             [ 3.02734e-01, -5.70312e-01, -1.12500e+00,  ..., -3.16406e-01, -1.39844e+00,  4.57031e-01],
E                             ...,
E                             [ 3.14030e+37, -1.73423e+36, -2.14338e+37,  ...,  7.76768e+36, -4.51938e+37,  6.77906e+37],
E                             [-1.90246e+37,  4.48614e+37, -8.90583e+37,  ..., -1.71138e+37, -4.51938e+37,  1.91907e+37],
E                             [ 3.04061e+37, -2.80799e+37, -5.35014e+37,  ...,  1.02600e+37, -2.85784e+37,  3.35630e+37]],
E                   
E                            [[-1.14062e+00,  2.14844e-02, -1.08594e+00,  ...,  1.05469e+00, -9.25781e-01,  1.21875e+00],
E                             [ 1.31836e-01,  9.03320e-02, -8.51562e-01,  ...,  4.47266e-01, -1.44531e+00,  3.69141e-01],
E                             [ 1.55273e-01, -8.69141e-02, -9.37500e-01,  ...,  4.80469e-01, -1.45312e+00,  5.58594e-01],
E                             ...,
E                             [ 2.32615e+37, -1.68230e+36, -5.85691e+36,  ...,  3.75507e+37, -1.14646e+37, -1.25446e+37],
E                             [-8.84767e+36, -2.79138e+37,  4.75199e+37,  ...,  2.16000e+37, -2.25969e+37,  2.18076e+36],
E                             [ 9.76152e+36, -4.42384e+36,  5.89845e+36,  ..., -3.33969e+37,  1.30430e+37, -7.80921e+36]]]], dtype=torch.bfloat16)

forge/forge/verify/verify.py:333: ValueError