Skip to content

Commit a74e52f

Browse files
janeyx99geodavic
authored andcommitted
Use narrow over indexing in hadacore_transform to prep for ABI stable (vllm-project#28756)
Signed-off-by: Jane Xu <janeyx@meta.com> Signed-off-by: George D. Torres <gdavtor@gmail.com>
1 parent e9abfe7 commit a74e52f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csrc/quantization/hadamard/hadacore/hadamard_transform_cuda.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ torch::Tensor hadacore_transform(torch::Tensor& x, bool inplace) {
802802
});
803803

804804
if (numel % 256 != 0) {
805-
out = out.index({torch::indexing::Slice(0, numel / had_size)});
805+
out = out.narrow(0, 0, numel / had_size);
806806
}
807807

808808
if (inplace && out.data_ptr() != x.data_ptr()) {

0 commit comments

Comments
 (0)