Skip to content

Commit e8e8b20

Browse files
committed
Update base for Update on "[ExecuTorch][Weight Sharing][XNNPACK] load named data map data for xnnpack"
If data is serialized into the NamedDataMap, then we overload getConstantDataPtr to retrieve the data from the named data map. This should be done in a Backwards Compatible way. Meaning if no data is serialized into the named data map, then we are still loading the data from the flatbuffer payload. Since the runtime change here is being made before the AoT changes, All CI on this diff by itself should test that the changes made here are backwards compatitble. Note: We do not resolve Runtime Memory usage at this point. WeightCache will be implemented in the next diff. Meaning If we load via the same key across different methods, we still pack twice and allocate two instances for the packed weights. Differential Revision: [D70315209](https://our.internmc.facebook.com/intern/diff/D70315209/) [ghstack-poisoned]
1 parent 4d3404f commit e8e8b20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exir/backend/test/test_backend_with_named_data_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def false_branch(self, x):
6767

6868
def forward(self, x, y):
6969
z = x / y
70-
z = torch.cond(z > 1, self.true_branch, self.false_branch, [x])
70+
z = torch.cond(z.sum() > 0, self.true_branch, self.false_branch, [x])
7171
return z - z
7272

7373
ep = to_edge(torch.export.export(M(), (torch.randn(1, 2), torch.randn(1, 2))))

0 commit comments

Comments
 (0)