Skip to content

Commit 7b1a5f6

Browse files
committed
addressed upstream comments-3
1 parent db6d324 commit 7b1a5f6

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

include/tvm/ir/memory_pools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ struct ConstantInfoNode : public Object {
258258
hash_reduce(data);
259259
}
260260

261-
static constexpr const char* _type_key = "tir.usmp.ConstantInfo";
261+
static constexpr const char* _type_key = "ir.ConstantInfo";
262262
static constexpr bool _type_has_method_sequal_reduce = true;
263263
static constexpr bool _type_has_method_shash_reduce = true;
264264
TVM_DECLARE_FINAL_OBJECT_INFO(ConstantInfoNode, Object);

python/tvm/ir/memory_pools.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ class PoolInfo(Object):
7474
7575
"""
7676

77-
# The string parameter to indicate read and write access to a pool
78-
# This needs to be kept in sync with kTargetPoolReadWriteAccess in
79-
# include/tvm/ir/memory_pools.h
80-
READ_WRITE_ACCESS = "rw"
81-
# The string parameter to indicate read only access to a pool
82-
# This needs to be kept in sync with kTargetPoolReadOnlyAccess in
83-
# include/tvm/ir/memory_pools.h
84-
READ_ONLY_ACCESS = "ro"
85-
8677
def __init__(
8778
self,
8879
pool_name: str,
@@ -98,18 +89,15 @@ def __init__(
9889
if not target_burst_bytes:
9990
target_burst_bytes = dict()
10091

101-
self.__init_handle_by_constructor__(
102-
_ffi_api.PoolInfo, # type: ignore # pylint: disable=no-member
103-
pool_name,
104-
target_access,
105-
size_hint_bytes,
106-
clock_frequency_hz,
107-
read_bandwidth_bytes_per_cycle,
108-
write_bandwidth_bytes_per_cycle,
109-
read_latency_cycles,
110-
write_latency_cycles,
111-
target_burst_bytes,
112-
)
92+
self.pool_name = pool_name
93+
self.target_access = target_access
94+
self.size_hint_bytes = size_hint_bytes
95+
self.clock_frequency_hz = clock_frequency_hz
96+
self.read_bandwidth_bytes_per_cycle = read_bandwidth_bytes_per_cycle
97+
self.write_bandwidth_bytes_per_cycle = write_bandwidth_bytes_per_cycle
98+
self.read_latency_cycles = read_latency_cycles
99+
self.write_latency_cycles = write_latency_cycles
100+
self.target_burst_bytes = target_burst_bytes
113101

114102

115103
@register_object("ir.PoolInfoProperties")
@@ -196,13 +184,13 @@ class WorkspacePoolInfo(PoolInfo):
196184
The properties of the pool.
197185
"""
198186

199-
# pylint: disable=W0231
200187
def __init__(
201188
self,
202189
pool_name: str,
203190
targets,
204191
pool_info_properties=None,
205192
):
193+
super().__init__(pool_name, targets)
206194
if pool_info_properties is None:
207195
pool_info_properties = PoolInfoProperties()
208196

@@ -231,14 +219,14 @@ class ConstantPoolInfo(PoolInfo):
231219
The properties of the pool.
232220
"""
233221

234-
# pylint: disable=W0231
235222
def __init__(
236223
self,
237224
pool_name: str,
238225
targets, # list[Target]
239226
constant_info_arr=None, # list[ConstantInfo]
240227
pool_info_properties=None,
241228
):
229+
super().__init__(pool_name, targets)
242230
if constant_info_arr is None:
243231
constant_info_arr = []
244232
if pool_info_properties is None:

src/ir/memory_pools.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ConstantInfo::ConstantInfo(String name_hint, Integer byte_offset, runtime::NDArr
148148
}
149149

150150
TVM_REGISTER_NODE_TYPE(ConstantInfoNode);
151-
TVM_REGISTER_GLOBAL("tir.usmp.ConstantInfo")
151+
TVM_REGISTER_GLOBAL("ir.ConstantInfo")
152152
.set_body_typed([](String name_hint, Integer byte_offset, runtime::NDArray data) {
153153
return ConstantInfo(name_hint, byte_offset, data);
154154
});

0 commit comments

Comments
 (0)