Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the root cause for _aligned_free issues on row_offset_ allocation (…
…pytorch#277) Summary: Pull Request resolved: pytorch#277 Previously in pytorch#275, we provided a quick fix on the test case (as row_offset_buf is declared but not used in the test case). The root cause should be the inappropriate allocation API (not Windows compatible) in the Packing routines in FBGEMM. It turned out when we pass `row_offset` as `nullptr` in the Packing routine (e.g., `PackAWithQuantRowOffset`), we will use `fbgemmAlignedAlloc` to allocate the buffer (On Windows using `_aligned_malloc`) and set the flag `rowOffsetAllocatedHere` to be `true`. However, when we deallocate the `row_offset` buffer in the end, we use the normal `free` instead of `fbgemmAlignedFree` (On Windows using `_aligned_free`). This is the root cause for the issue. Reviewed By: jspark1105 Differential Revision: D19665851 fbshipit-source-id: 3d393aaf6a165d30cdedf9eed39db9b1d162d93d
- Loading branch information