Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][VM] If not allocate on stack, VM runtime cannot work? #8977

Closed
zhanghaohit opened this issue Sep 10, 2021 · 2 comments
Closed

[Bug][VM] If not allocate on stack, VM runtime cannot work? #8977

zhanghaohit opened this issue Sep 10, 2021 · 2 comments
Labels
executor:vm runtime components of VM flow. src/runtime/vm, python/tvm/runtime/vm.py flow:vm type: bug

Comments

@zhanghaohit
Copy link
Contributor

In src/tir/transforms/lower_tvm_builtin.cc

    if (device_type_.defined()) {
      if (const auto* dev_type = device_type_.as<IntImmNode>()) {
        if (dev_type->value == kDLCPU) {
          int32_t constant_size = op->constant_allocation_size();
          if (constant_size > 0 && constant_size * nbytes < runtime::kMaxStackAlloca) {
            return stmt;
          }
        }
      }
    }

If the condition if (constant_size > 0 && constant_size * nbytes < runtime::kMaxStackAlloca) is not true, the generated IR cannot work in VM runtime. Please see the detailed explanation here #8274.

The bug is not triggering any problem for now, since this condition may be always true in our test. I'm not very sure this is a bug, but we need deeper investigation on this.

@mbrookhart
Copy link
Contributor

This is the test that fails in the VM without this code: #9019

@masahi
Copy link
Member

masahi commented Jan 9, 2022

What is the status of this issue and how it relates to #8978?

@areusch areusch added the needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it label Oct 19, 2022
@Lunderberg Lunderberg added flow:vm executor:vm runtime components of VM flow. src/runtime/vm, python/tvm/runtime/vm.py and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Nov 16, 2022
@tqchen tqchen closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
executor:vm runtime components of VM flow. src/runtime/vm, python/tvm/runtime/vm.py flow:vm type: bug
Projects
None yet
Development

No branches or pull requests

6 participants