[all-commits] [llvm/llvm-project] 3651f3: [mlir][tosa] Check for unranked tensors during val...

Sarthak Gupta via All-commits all-commits at lists.llvm.org
Mon Oct 23 01:45:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3651f377f632d9152f2bd8fc2f9302ec9f9bdd5e
      https://github.com/llvm/llvm-project/commit/3651f377f632d9152f2bd8fc2f9302ec9f9bdd5e
  Author: Sarthak Gupta <sarthakgpt95 at gmail.com>
  Date:   2023-10-23 (Mon, 23 Oct 2023)

  Changed paths:
    M mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
    M mlir/test/Dialect/Tosa/level_check.mlir

  Log Message:
  -----------
  [mlir][tosa] Check for unranked tensors during validation (#68509)

Fixes https://github.com/llvm/llvm-project/issues/67760
`levelCheckRank` ensures that the tensors for tosa operations are not
unranked

During tosa validation in `levelCheckRank`, we were trying to get the
rank of a tensor without checking if it is ranked or unranked, which
leads to an `assert` error. I see two ways to fix this:

- Only check `type.getRank() > tosa_level.MAX_RANK` if the tensor is
ranked, and then proceed as usual.
(like `if (type.hasRank() && type.getRank() > tosa_level.MAX_RANK)` , OR
- Throw an error for unranked tensors as result.




More information about the All-commits mailing list