Skip to content

[Bug][VTA][OpenCL] If allowed to allocate in stack, VTA multiple target test will fail #8978

Description

@zhanghaohit

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 above optimization code is here, it will raise LLVM function signature errors when there are multiple targets. This piece of code was removed in #6126 to fix this issue. But it was reverted back in #8274, as removal of this code will cause some VM test failed.

To quick fix, the multiple target unittests are disabled in the current main branch. But we need further investigation on how to resolve this nicely.

cc @echuraev @elvin-n

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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