Commit 5442036
authored
Fix portable pybindings COW ABI dependency (#21019)
Summary:
Avoid at::Tensor::data_ptr() in portable pybindings input conversion by
using storage-level no-COW pointer access with the tensor storage
offset. This prevents _portable_lib from depending on removed or renamed
COW ABI symbols in newer Torch builds.
Test Plan:
cmake --build pip-out/temp.linux-x86_64-cpython-311/cmake-out --target
portable_lib --config=Release -j8
nm -D
pip-out/temp.linux-x86_64-cpython-311/cmake-out/_portable_lib.cpython-311-x86_64-linux-gnu.so
| c++filt | rg "c10::impl::cow|materialize_cow|is_cow_data_ptr" -n ||
true
Direct-loaded rebuilt _portable_lib in Python and verified
ExecuTorchModule is present.1 parent 667c91b commit 5442036
1 file changed
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
| |||
1117 | 1133 | | |
1118 | 1134 | | |
1119 | 1135 | | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1126 | 1144 | | |
1127 | 1145 | | |
1128 | 1146 | | |
| |||
0 commit comments