Skip to content

Commit fe53daf

Browse files
swolchokfacebook-github-bot
authored andcommitted
Check for contiguous dim order in op_fast_hadamard_transform (#5419)
Summary: Pull Request resolved: #5419 Lunwen pointed out we didn't handle this case. ghstack-source-id: 243051227 exported-using-ghexport Reviewed By: helunwencser Differential Revision: D62788230 fbshipit-source-id: d8e892d84f6a1a4631818a9bbafd9c98d28edc1b
1 parent 442b45a commit fe53daf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

extension/llm/custom_ops/op_fast_hadamard_transform.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ Tensor& fast_hadamard_transform_out(
3434
return out;
3535
}
3636

37+
ET_KERNEL_CHECK(
38+
ctx,
39+
is_contiguous_dim_order(mat.dim_order().data(), mat.dim()),
40+
InvalidArgument,
41+
out);
42+
43+
ET_KERNEL_CHECK(
44+
ctx,
45+
is_contiguous_dim_order(out.dim_order().data(), out.dim()),
46+
InvalidArgument,
47+
out);
48+
3749
ET_KERNEL_CHECK_MSG(
3850
ctx,
3951
mat.strides().back() == 1,

0 commit comments

Comments
 (0)