Skip to content

Commit

Permalink
admlakd
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Apr 26, 2024
1 parent 324f881 commit 1ad2a42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/levanter/models/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ def wrap_flash_attention(q, k, v):
mask=kernel_mask, head_shards=1, q_seq_shards=1, block_sizes=block_sizes
)

# try upcasting to float32 to see if it fixes crash?
q = q.astype(jnp.float32)
k = k.astype(jnp.float32)
v = v.astype(jnp.float32)
print(q.dtype, k.dtype, v.dtype)
return jax.vmap(splash_kernel)(q, k, v, segment_ids=None)

Expand Down

0 comments on commit 1ad2a42

Please sign in to comment.