Skip to content

Commit

Permalink
Build fix for Android (pytorch#2290)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#2290

Reviewed By: manuelcandales

Differential Revision: D54620005
  • Loading branch information
kirklandsign authored and facebook-github-bot committed Mar 11, 2024
1 parent caade55 commit a7342f5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/models/llama2/custom_ops/op_sdpa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ inline void fill_stub(scalar_t* data, scalar_t val, int64_t size) {
for (; d < size - (size % Vec::size()); d += Vec::size()) {
data_vec.store(data + d);
}
#if !defined(_MSC_VER) && !defined(COMPILING_FOR_MIN_SIZE)
#if !defined(_MSC_VER) && !defined(COMPILING_FOR_MIN_SIZE) && \
!defined(__ANDROID__)
#pragma unroll
#endif
for (; d < size; d++) {
Expand Down Expand Up @@ -249,7 +250,7 @@ void cpu_flash_attention(
ET_CHECK_MSG(
attn_mask.value().size(1) == kvSize,
"attn_mask shape mismatch"
"attn_mask.size(1)=%ld kvSize=%" PRId64,
"attn_mask.size(1)=%zd kvSize=%" PRId64,
attn_mask.value().size(1),
kvSize);
}
Expand Down Expand Up @@ -578,7 +579,7 @@ bool validate_cache_params(
"start_post + seq_length must be less than max seq length supported by key cache."
"start pos: %" PRId64 ", seq_length: %" PRId64
"."
"key cache size: %ld",
"key cache size: %zd",
start_pos,
seq_length,
k_cache.size(2));
Expand All @@ -588,7 +589,7 @@ bool validate_cache_params(
"start_post + seq_length must be less than max seq length supported by key cache."
"start pos: %" PRId64 ", seq_length: %" PRId64
"."
"value cache size: %ld",
"value cache size: %zd",
start_pos,
seq_length,
v_cache.size(2));
Expand Down

0 comments on commit a7342f5

Please sign in to comment.