Skip to content

Simple function that just returns produces a module that can't be loaded #21066

Closed

Description

@sogartar

What happened?

An MLIR that is a function that just returns the argument results in a module that can not be loaded.

c/runtime/src/iree/vm/bytecode/module.c:99: NOT_FOUND; no type registered with name '!torch.vtensor<[5],f32>'; loading bytecode module at 'model.vmfb'; loading modules and dependencies; creating run context

Steps to reproduce your issue

  1. Compile
module @module {
  func.func @forward(%arg0: !torch.vtensor<[5],f32>) -> !torch.vtensor<[5],f32> attributes {torch.assume_strict_symbolic_shapes} {
    return %arg0 : !torch.vtensor<[5],f32>
  }
}

with command

iree-compile \
  model.mlir \
  -o=model.vmfb \
  --iree-hal-local-target-device-backends=llvm-cpu \
  --iree-hal-target-device=local
  1. Run with
iree-run-module \
  --device=local-task \
  --module=model.vmfb \
  --function=forward \
  --input="5xf32=1 2 3 4 5"

What component(s) does this issue relate to?

Compiler, Runtime

Version information

3.5.0rc20250609

Additional context

No response

Activity

  1. added
    bug 🐞
    on Jun 10, 2025
  2. changed the title [-]Simple function that just returns can't produces a module that can't be loaded[/-] [+]Simple function that just returns can't produces a module that can be loaded[/+] on Jun 10, 2025
  3. changed the title [-]Simple function that just returns can't produces a module that can be loaded[/-] [+]Simple function that just returns produces a module that can't be loaded[/+] on Jun 10, 2025
  4. benvanik commented on Jun 10, 2025

    @benvanik
    Collaborator

    I suspect the input type auto detection is looking for ops and not finding any. The error you're getting is what happens with custom types, and if the torch input pipeline never runs the vtensor remains. The auto input selection needs to also look at function types.

  5. self-assigned this
    on Jun 10, 2025
  6. added
    integrations/pytorch
    on Jun 10, 2025
  7. added a commit that references this issue on Jun 10, 2025
    b3bc0ef
  8. added a commit that references this issue on Jun 10, 2025
    bfc106e
  9. added a commit that references this issue on Dec 1, 2025
    2ed6f86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐞integrations/pytorch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions