Skip to content

Commit 2d42918

Browse files
authored
fix T273852480
Differential Revision: D107919134 Pull Request resolved: pytorch#20118
1 parent e285edf commit 2d42918

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

extension/module/test/module_device_memory_test.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,13 @@ TEST_F(ModuleDeviceMemoryTest, DeviceModelMethodMetaReportsCudaBuffer) {
107107
ASSERT_EQ(meta->num_memory_planned_buffers(), 2);
108108

109109
{
110+
// After turn on on-device memory planning, the output cpu tensor shares
111+
// the same buffer with the input cpu tensor. So the memory planned buffer
112+
// only needs 2 * 16 = 32 bytes.
113+
110114
auto size = meta->memory_planned_buffer_size(0);
111115
ASSERT_TRUE(size.ok());
112-
EXPECT_EQ(size.get(), 48);
116+
EXPECT_EQ(size.get(), 32);
113117

114118
auto device = meta->memory_planned_buffer_device(0);
115119
ASSERT_TRUE(device.ok());

0 commit comments

Comments
 (0)