From db5e40b92a13fc3d3e83a5fe9e53af14947d0170 Mon Sep 17 00:00:00 2001 From: Kimish Patel Date: Mon, 21 Apr 2025 08:11:41 -0700 Subject: [PATCH] [Executorch][BE] Fix error logging with better message Pull Request resolved: https://github.com/pytorch/executorch/pull/10283 ATT ghstack-source-id: 279292326 @exported-using-ghexport Differential Revision: [D73222738](https://our.internmc.facebook.com/intern/diff/D73222738/) --- extension/llm/custom_ops/op_sdpa_impl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extension/llm/custom_ops/op_sdpa_impl.h b/extension/llm/custom_ops/op_sdpa_impl.h index 689537923d5..c907a84f14c 100644 --- a/extension/llm/custom_ops/op_sdpa_impl.h +++ b/extension/llm/custom_ops/op_sdpa_impl.h @@ -605,7 +605,11 @@ void cpu_flash_attention( */ ET_CHECK_MSG(attn_mask.value().dim() == 2, "attn_mask must be 2D"); ET_CHECK_MSG( - attn_mask.value().size(0) == qSize, "attn_mask shape mismatch"); + attn_mask.value().size(0) == qSize, + "attn_mask shape mismatch" + "attn_mask.size(0)=%zd qSize=%" PRId64, + attn_mask.value().size(0), + qSize); ET_CHECK_MSG( attn_mask.value().size(1) == kvSize, "attn_mask shape mismatch"