Skip to content

[Stream] Failed compilation in onnx.NonMaxSuppression with SSA dominance error #21982

Open

Description

@jrlvdr

What happened?

Compiling a ONNX model that contains onnx.NonMaxSuppression (opset 18) fails in IREE with an "operand #0 does not dominate this use" error after import to torch-onnx and during stream scheduling/lowering.

Image

Steps to reproduce your issue

  1. Import ONNX:
    iree-import-onnx nms_cpu.onnx -o nms_cpu.mlir

  2. Minimal IR (after import)

module {
  func.func @nms(
    %arg0: !torch.vtensor<[1,1,6300],f32>,  // scores
    %arg2: !torch.vtensor<[1,6300,4],f32>   // boxes
  ) -> (!torch.vtensor<[?,3],si64>)
  attributes {torch.onnx_meta.ir_version = 8 : si64,
              torch.onnx_meta.opset_version = 18 : si64,
              torch.onnx_meta.producer_name = "onnx.utils.extract_model",
              torch.onnx_meta.producer_version = ""} {
    %0 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<2.500000e-01> : tensor<1xf32>} : () -> !torch.vtensor<[1],f32>
    %1 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<4.500000e-01> : tensor<1xf32>} : () -> !torch.vtensor<[1],f32>
    %2 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<300> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
    %3 = torch.operator "onnx.NonMaxSuppression"(
           %arg2, %arg0, %2, %1, %0
         ) {torch.onnx.center_point_box = 1 : si64}
         : (!torch.vtensor<[1,6300,4],f32>, !torch.vtensor<[1,1,6300],f32>,
            !torch.vtensor<[1],si64>, !torch.vtensor<[1],f32>, !torch.vtensor<[1],f32>)
           -> !torch.vtensor<[?,3],si64>
    return %3 : !torch.vtensor<[?,3],si64>
  }
}
  1. Compile with IREE (CPU):
iree-compile \
  --iree-hal-target-device=local \
  --iree-hal-local-target-device-backends=llvm-cpu \
  nms_cpu.mlir
  1. Actual result
nms_cpu.mlir:6:10: error: operand #0 does not dominate this use
    %3 = torch.operator "onnx.NonMaxSuppression"(%arg2, %arg0, %2, %1, %0) {torch.onnx.center_point_box = 1 : si64} : ...
         ^
nms_cpu.mlir:6:10: note: see current operation: %44 = "stream.timepoint.await"(%47#0, %41, %47#2) <...>
nms_cpu.mlir:6:10: note: operand defined here (op in the same block)

IREE’s debug dump shows the failure during ScheduleExecutionPass

What component(s) does this issue relate to?

Compiler

Version information

No response

Activity

  1. added
    bug 🐞
    on Sep 15, 2025
  2. changed the title [-]onnx.NonMaxSuppression compile fails with SSA dominance error in IREE[/-] [+][CPU] onnx.NonMaxSuppression compile fails with SSA dominance error in IREE[/+] on Sep 15, 2025
  3. changed the title [-][CPU] onnx.NonMaxSuppression compile fails with SSA dominance error in IREE[/-] [+][CPU] Failed compilation in onnx.NonMaxSuppression with SSA dominance error in IREE[/+] on Sep 15, 2025
  4. changed the title [-][CPU] Failed compilation in onnx.NonMaxSuppression with SSA dominance error in IREE[/-] [+][CPU] Failed compilation in `onnx.NonMaxSuppression` with SSA dominance error in IREE[/+] on Sep 15, 2025
  5. changed the title [-][CPU] Failed compilation in `onnx.NonMaxSuppression` with SSA dominance error in IREE[/-] [+][CPU] Failed compilation in `onnx.NonMaxSuppression` with SSA dominance error[/+] on Sep 15, 2025
  6. changed the title [-][CPU] Failed compilation in `onnx.NonMaxSuppression` with SSA dominance error[/-] [+][Stream] Failed compilation in `onnx.NonMaxSuppression` with SSA dominance error[/+] on Sep 15, 2025
  7. added 4 commits that reference this issue on Dec 27, 2025
    3793507
    99b1e0f
    fcab427
    67682a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions