Skip to content

[Bug] Possible error in strided_slice_checker #14142

@AreopagX

Description

@AreopagX

Hello, I'm trying to use TensorRT for tuning my model. For that matter, I use partition_for_tensorrt before building the model. However, this function fails when processing strided_slice ops. This might be related to strided_slice ops, where fewer axes than tensor dimensions are sliced, e.g., %435 = strided_slice(%376, begin=[0i64], end=[1i64], strides=[1i64], axes=[0i64]) with input tensors of 4 dims. I suspect that these ops will fail since the for loop

for i in range(0, len(args[0].checked_type.shape)):
begin = int(attrs.begin[i])
iterates over the number of input dimensions while the strided_slice op does not necessarily cover all dimensions, e.g., in the above call only the 0th axis.

Expected behavior

I expected the partition_for_tensorrt function to return without error.

Actual behavior

IndexError in strided_slice_checker:

begin = int(attrs.begin[i])
, error thrown at:
raise IndexError("Index out of range. size: {}, got index {}".format(length, idx))

Environment

OS: Ubuntu 20.04, Kernel 5.15
TVM: built from master branch, commit 0e046da

Triage

  • needs-triage
  • byoc:ethosu

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions