You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/05/28 13:28:08 UTC
[GitHub] [tvm] vvchernov opened a new pull request, #11504: [VM] check DLManagedTensor for conditions to construct NDArray
vvchernov opened a new pull request, #11504:
URL: https://github.com/apache/tvm/pull/11504
During developing #11003 #11391 It was observed that DLTensor should satisfy some conditions (data contiguous and alignment) for correct construction of NDArray based on it to avoid problems with memory using.
Further analysis of NDArray class methods showed the same problem in other public method. There is fix of it.
@tkonolige could you check it?
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vvchernov commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
vvchernov commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r886004293
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
Hello @tkonolige! Please see again
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vvchernov commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
vvchernov commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r886104303
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
Ok, done. It still is not clear for me descriptions from 65 and 83 lines (initial code). Looks like idea is related to non-contiguous data copying, but I'm not sure
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tmoreau89 commented on pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on PR #11504:
URL: https://github.com/apache/tvm/pull/11504#issuecomment-1144075604
Thanks @vvchernov and @tkonolige - the PR has been merged.
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vvchernov commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
vvchernov commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r886104303
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
Ok, done. It is not clear for me description from 65 and 83 lines (initial code). Looks like idea is related to non-contiguous data copying, but I'm not sure
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tkonolige commented on PR #11504:
URL: https://github.com/apache/tvm/pull/11504#issuecomment-1143921776
I've approved it. But you'll also need a committer to approve it. @tmoreau89
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vvchernov commented on pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
vvchernov commented on PR #11504:
URL: https://github.com/apache/tvm/pull/11504#issuecomment-1143244768
Hello @tkonolige could you approve it? if not we can ask Thierry
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tkonolige commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r886008925
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
How about "DLTensor is not contiguous. Copying from non-contiguous data is currently not supported."
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tkonolige commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r886128821
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
The wording on those lines is a little awkward but I believe they mean that ArrayCopyFromBytes and ArrayCopyToBytes only support contiguous data.
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tmoreau89 merged pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tmoreau89 merged PR #11504:
URL: https://github.com/apache/tvm/pull/11504
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tkonolige commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r885913430
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
```suggestion
<< "DLManagedTensor must be contiguous.";
```
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tkonolige commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
tkonolige commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r885979953
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
Personally I think saying something will be supported in the future doesn't really add any useful information. But, if you do want to say that "Only contiguous DLManagedTensors are currently supported." would be a better message.
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vvchernov commented on a diff in pull request #11504: [VM] check DLManagedTensor for conditions to construct NDArray
Posted by GitBox <gi...@apache.org>.
vvchernov commented on code in PR #11504:
URL: https://github.com/apache/tvm/pull/11504#discussion_r885961977
##########
src/runtime/ndarray.cc:
##########
@@ -240,6 +240,10 @@ NDArray NDArray::FromDLPack(DLManagedTensor* tensor) {
data->SetDeleter(Internal::DLPackDeleter);
// fill up content.
data->manager_ctx = tensor;
+ ICHECK(::tvm::runtime::IsContiguous(tensor->dl_tensor))
+ << "DLManagedTensor is not contiguous. It does not support for now";
Review Comment:
Ok, I will redo it. But I based on similar description in other ICHECK. I think TVM design assumes contiguous tensors only and what we can potentially support in the future it is copying from incontiguous to contiguous ones.
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org