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

InternalError: Check failed: (pval != nullptr) is false: Cannot allocate memory symbolic tensor shape [T.Any(), 1] #15440

Closed
tingyuzaixiao opened this issue Jul 31, 2023 · 1 comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type:ci Relates to TVM CI infrastructure

Comments

@tingyuzaixiao
Copy link

tingyuzaixiao commented Jul 31, 2023

my code is:
with tvm.transform.PassContext(opt_level=3):
self.graph, self.lib, self.params = relay.build(
mod, target=target, target_host=target_host, params=params
)
while running it, it report an error:
58: TVMFuncCall
57: tvm::relay::backend::RelayBuildModule::GetFunction(tvm::runtime::String const&, tvm::runtime::ObjectPtrtvm::runtime::Object const&)::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#3}::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const
56: tvm::relay::backend::RelayBuildModule::BuildRelay(tvm::IRModule, tvm::runtime::String const&)
55: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::relay::backend::GraphExecutorCodegenModule::GetFunction(tvm::runtime::String const&, tvm::runtime::ObjectPtrtvm::runtime::Object const&)::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#2}> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
54: tvm::relay::backend::GraphExecutorCodegen::Codegen(tvm::IRModule, tvm::relay::Function, tvm::runtime::String)
53: tvm::relay::GraphPlanMemory(tvm::relay::Function const&)
52: tvm::relay::StorageAllocator::Plan(tvm::relay::Function const&)
51: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
50: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
49: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::FunctionNode const*)
48: tvm::relay::StorageAllocaBaseVisitor::DeviceAwareVisitExpr_(tvm::relay::FunctionNode const*)
47: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
46: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
45: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
44: tvm::relay::StorageAllocaBaseVisitor::VisitExpr_(tvm::relay::TupleNode const*)
43: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
42: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
41: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
40: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
39: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
38: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
37: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
36: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
35: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
34: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
33: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
32: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
31: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
30: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
29: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
28: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
27: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
26: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
25: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
24: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
23: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
22: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
21: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
20: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
19: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
18: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
17: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
16: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
15: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
14: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
13: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
12: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
11: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
10: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
9: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
8: tvm::relay::StorageAllocaBaseVisitor::GetToken(tvm::RelayExpr const&)
7: tvm::relay::ExprVisitor::VisitExpr(tvm::RelayExpr const&)
6: tvm::relay::ExprFunctor<void (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
5: tvm::relay::transform::DeviceAwareExprVisitor::VisitExpr_(tvm::relay::CallNode const*)
4: tvm::relay::StorageAllocator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
3: tvm::relay::StorageAllocaBaseVisitor::CreateToken(tvm::RelayExprNode const*, bool)
2: tvm::relay::StorageAllocator::CreateTokenOnDevice(tvm::RelayExprNode const*, tvm::VirtualDevice const&, bool)
1: tvm::relay::TokenAllocator1D::Request(tvm::relay::StorageToken*)
0: tvm::relay::TokenAllocator1D::GetMemorySize(tvm::relay::StorageToken*)
File "/code/zhanli/tvm/src/relay/backend/token_allocator.cc", line 41
InternalError: Check failed: (pval != nullptr) is false: Cannot allocate memory symbolic tensor shape [T.Any(), 1]

The version of TVM is 0.13.0. I don't know why it happened,please help me.

@tingyuzaixiao tingyuzaixiao added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type:ci Relates to TVM CI infrastructure labels Jul 31, 2023
@masahi
Copy link
Member

masahi commented Jul 31, 2023

You need to use vm.build for dynamic shape models.

@masahi masahi closed this as completed Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type:ci Relates to TVM CI infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants