Prince-Takkar opened a new issue, #11385:
URL: https://github.com/apache/tvm/issues/11385
Hi,
I just started with TVM code. I am doing local changes in the TVM source
code. The problem is after declaring variable in RelayExprNode class, while
running the task_rust.sh script rust tests are failing from rust/tvm directory.
Here is the code snippet (patchfile)-
diff --git a/include/tvm/ir/expr.h b/include/tvm/ir/expr.h
index 4a00de802..936473e22 100644
--- a/include/tvm/ir/expr.h
+++ b/include/tvm/ir/expr.h
@@ -151,6 +151,9 @@ class RelayExprNode : public BaseExprNode {
* This value is discarded during serialization.
*/
mutable Type checked_type_ = Type(nullptr);
+
+ mutable int64_t id;
+
/*!
* \return The checked_type
*/
@@ -205,6 +208,15 @@ class RelayExprNode : public BaseExprNode {
*/
VirtualDevice virtual_device() const;
+ void VisitAttrs(AttrVisitor* v) {
+ v->Visit("virtual_device_", &virtual_device_);
+ v->Visit("id", &id);
+ v->Visit("span", &span);
+ v->Visit("_checked_type_", &checked_type_);
+ }
+
static constexpr const char* _type_key = "RelayExpr";
static constexpr const uint32_t _type_child_slots = 22;
TVM_DECLARE_BASE_OBJECT_INFO(RelayExprNode, BaseExprNode);
I am thinking this is the way to declare a variable. I am able to declare
variables in other class. But while declaring variable in RelayExprNode class,
rust tests started failing. It looks like it is not allowing me to declare
variable or some step may missing here.
Does anyone knows what I am doing wrong here in declaring variable, as I am
new to rust.
Here are the tests failing while running task_rust.sh-
Running unittests
(/home/mluser/ptakkar/tvm_work/tvm/rust/target/debug/deps/tvm-efbed68ac04ef268)
running 14 tests
error: test failed, to rerun pass '--lib'
Caused by:
process didn't exit successfully:
`/home/mluser/ptakkar/tvm_work/tvm/rust/target/debug/deps/tvm-efbed68ac04ef268`
(signal: 11, SIGSEGV: invalid memory reference)
I looked into rust code also and find out if I marked some of the test as
[ignore] that it runs successfully. See here-
test ir::module::tests::test_contains_global_var ... ignored
test ir::module::tests::test_from_expr ... ignored
test ir::module::tests::test_get_global_var ... ignored
test ir::module::tests::test_get_global_vars ... ignored
test ir::module::tests::test_module_add ... ignored
test ir::relay::tests::test_global ... ignored
test ir::relay::tests::test_parse_constant ... ignored
test ir::relay::tests::test_var ... ignored
test python::tests::test_run ... ignored
test ir::relay::tests::test_id ... ok
test ir::module::tests::test_contains_global_type_var ... ok
test ir::module::tests::test_module_add_def ... ok
test ir::module::tests::test_get_global_type_vars ... ok
test ir::module::tests::test_import ... ok
test result: ok. 5 passed; 0 failed; 9 ignored; 0 measured; 0 filtered out;
finished in 0.10s
It tells there is some dependency between rust and .cc files. But I am more
interesting to know why it is not allowing me to declare or initialize variable
in RelayExprNode class.
### Environment
I am using docker image- "tlcpack/ci-cpu" on my host machine is Ubuntu-18.04
### Steps to reproduce
Apply the above patch, build the tvm libraries and run the
./tests/scripts/task_rust.sh
Any leads would be really helpful and appreciated.
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]