[PeleeNet] an internal invariant was violated while typechecking your program


#1

Hi,

I tried to compile PeeleNet model for x86 CPU with TVM (master branch).

And I got the following error:

 v0.0.1
fn (%v0: Tensor[(1, 3, 224, 224), float32]) -> Tensor[(1, 536, 7, 7), float32] {
  %0 = layout_transform(%v0, src_layout="NCHW", dst_layout="NCHW1c")
  %1 = layout_transform(meta[relay.Constant][0], src_layout="OIHW", dst_layout="OIHW1i4o")
  %2 = nn.contrib_conv2d_NCHWc(%0, %1, meta[relay.attrs.Conv2DAttrs][0])
  %3 = layout_transform(meta[relay.Constant][1], src_layout="CHW", dst_layout="CHW4c")
  %4 = add(%2, %3)
  %5 = nn.relu(%4)
  %6 = nn.max_pool2d(%5, pool_size=[2, 2], strides=[2, 2], layout="NCHW4c")
  %7 = layout_transform(%5, src_layout="NCHW4c", dst_layout="NCHW32c")
  %8 = layout_transform(meta[relay.Constant][2], src_layout="OIHW", dst_layout="OIHW32i4o")
  %9 = nn.contrib_conv2d_NCHWc(%7, %8, meta[relay.attrs.Conv2DAttrs][1])
  %10 = layout_transform(meta[relay.Constant][3], src_layout="CHW", dst_layout="CHW4c")
  %11 = add(%9, %10)
  %12 = nn.relu(%11)
  %13 = layout_transform(%12, src_layout="NCHW4c", dst_layout="NCHW8c")
  %14 = layout_transform(meta[relay.Constant][4], src_layout="OIHW", dst_layout="OIHW8i8o")
  %15 = nn.contrib_conv2d_NCHWc(%13, %14, meta[relay.attrs.Conv2DAttrs][2])
  %16 = layout_transform(meta[relay.Constant][5], src_layout="CHW", dst_layout="CHW8c")
  %17 = add(%15, %16)
  %18 = nn.relu(%17)
  %19 = layout_transform(%18, src_layout="NCHW8c", dst_layout="NCHW4c")
  %20 = (%6, %19)
  %21 = concatenate(%20, axis=1)
  %22 = layout_transform(%21, src_layout="NCHW4c", dst_layout="NCHW1c")
  %23 = layout_transform(meta[relay.Constant][6], src_layout="OIHW", dst_layout="OIHW1i16o")
  %24 = nn.contrib_conv2d_NCHWc(%22, %23, meta[relay.attrs.Conv2DAttrs][3])
  %25 = layout_transform(meta[relay.Constant][7], src_layout="CHW", dst_layout="CHW16c")
  %26 = add(%24, %25)
  %27 = nn.relu(%26)
  %28 = layout_transform(meta[relay.Constant][8], src_layout="OIHW", dst_layout="OIHW16i6o")
  %29 = nn.contrib_conv2d_NCHWc(%27, %28, meta[relay.attrs.Conv2DAttrs][4])
  %30 = layout_transform(meta[relay.Constant][9], src_layout="CHW", dst_layout="CHW6c")
  %31 = add(%29, %30)
  %32 = nn.relu(%31)
  %33 = layout_transform(%32, src_layout="NCHW6c", dst_layout="NCHW2c")
  %34 = layout_transform(meta[relay.Constant][10], src_layout="OIHW", dst_layout="OIHW2i3o")
  %35 = nn.contrib_conv2d_NCHWc(%33, %34, meta[relay.attrs.Conv2DAttrs][5])
  %36 = layout_transform(meta[relay.Constant][11], src_layout="CHW", dst_layout="CHW3c")
  %37 = add(%35, %36)
  %38 = nn.relu(%37)
  %39 = layout_transform(%38, src_layout="NCHW3c", dst_layout="NCHW16c")
  %40 = layout_transform(meta[relay.Constant][12], src_layout="OIHW", dst_layout="OIHW16i6o")
  %41 = nn.contrib_conv2d_NCHWc(%27, %40, meta[relay.attrs.Conv2DAttrs][6])
  %42 = layout_transform(meta[relay.Constant][13], src_layout="CHW", dst_layout="CHW6c")
  %43 = add(%41, %42)
  %44 = nn.relu(%43)
  %45 = layout_transform(%44, src_layout="NCHW6c", dst_layout="NCHW2c")
  %46 = layout_transform(meta[relay.Constant][14], src_layout="OIHW", dst_layout="OIHW2i3o")
  %47 = nn.contrib_conv2d_NCHWc(%45, %46, meta[relay.attrs.Conv2DAttrs][7])
  %48 = layout_transform(meta[relay.Constant][15], src_layout="CHW", dst_layout="CHW3c")
  %49 = add(%47, %48)
  %50 = nn.relu(%49)
  %51 = layout_transform(%50, src_layout="NCHW3c", dst_layout="NCHW2c")
  %52 = layout_transform(meta[relay.Constant][16], src_layout="OIHW", dst_layout="OIHW2i3o")
  %53 = nn.contrib_conv2d_NCHWc(%51, %52, meta[relay.attrs.Conv2DAttrs][8])
  %54 = layout_transform(meta[relay.Constant][17], src_layout="CHW", dst_layout="CHW3c")
  %55 = add(%53, %54)
  %56 = nn.relu(%55)
  %57 = layout_transform(%56, src_layout="NCHW3c", dst_layout="NCHW16c")
  %58 = (%27, %39, %57)
  %59 = concatenate(%58, axis=1)
  %60 = layout_transform(%59, src_layout="NCHW16c", dst_layout="NCHW8c")
  %61 = layout_transform(meta[relay.Constant][18], src_layout="OIHW", dst_layout="OIHW8i6o")
  %62 = nn.contrib_conv2d_NCHWc(%60, %61, meta[relay.attrs.Conv2DAttrs][9])an internal invariant was violated while typechecking your program [16:25:19] /home/cam/sources/github/tvm/src/relay/pass/type_solver.cc:119: Check failed: resolved.defined(): Unable to unify parent types: TensorType([2, 4, 1, 1, 8, 6], float32) and TensorType([2, 7, 1, 1, 8, 6], float32)
; 
  %63 = layout_transform(meta[relay.Constant][19], src_layout="CHW", dst_layout="CHW6c")
  %64 = add(%62, %63)
  %65 = nn.relu(%64)
  %66 = layout_transform(%65, src_layout="NCHW6c", dst_layout="NCHW2c")an internal invariant was violated while typechecking your program [16:25:19] /home/cam/sources/github/tvm/src/relay/op/tensor/transform.cc:2072: Check failed: data != nullptr: 
; 

Tank you