MasterJH5574 commented on code in PR #16750:
URL: https://github.com/apache/tvm/pull/16750#discussion_r1571435063
##########
include/tvm/runtime/memory/memory_manager.h:
##########
@@ -157,7 +160,7 @@ class StorageObj : public Object {
/*! \brief reference to storage. */
class Storage : public ObjectRef {
public:
- TVM_DLL explicit Storage(Buffer buffer);
+ TVM_DLL explicit Storage(Buffer buffer, Allocator* allocator);
Review Comment:
There are mixture usages of `Storage`/`StorageObj` in TVM. The only use of
the constructor seems to be in `paged_kv_cache.cc` in TVM. For other
constructions of `Storage`, they all use `make_object` and directly set the
allocator
https://github.com/apache/tvm/blob/622bd150dd331780eb41a1c67c65aae802eb9b20/src/runtime/disco/cuda_ipc/cuda_ipc_memory.cc#L204-L210
https://github.com/apache/tvm/blob/622bd150dd331780eb41a1c67c65aae802eb9b20/src/runtime/relax_vm/builtin.cc
https://github.com/apache/tvm/blob/622bd150dd331780eb41a1c67c65aae802eb9b20/src/runtime/vm/vm.cc#L848-L859
There is a use of the constructor on MLC LLM side
https://github.com/mlc-ai/mlc-llm/blob/main/cpp/serve/model.cc#L68-L69, where
we use the constructor so that we don't need to expand it into the
`make_object` lines.
--
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]