2828from jax .experimental .pallas .ops .gpu import decode_attention as gpu_pallas_decode_attention
2929from jax .experimental .pallas .ops .tpu .splash_attention import splash_attention_kernel
3030from jax .experimental .pallas .ops .tpu .splash_attention import splash_attention_mask
31- from jax .experimental .shard_map import shard_map
3231from jax .sharding import Mesh
3332import jax
3433import jax .numpy as jnp
@@ -946,11 +945,11 @@ def gpu_ragged_attention(self, q: Array, k: Array | KVTensor, v: Array | KVTenso
946945 bn = nn .logical_to_mesh_axes ((CACHE_BATCH , CACHE_HEADS ))
947946
948947 @functools .partial (
949- shard_map ,
948+ jax . shard_map ,
950949 mesh = self .mesh ,
951950 in_specs = (bnd , bsnd , bsnd , b , None ),
952951 out_specs = (bnd , bn , bn ),
953- check_rep = False ,
952+ check_vma = False ,
954953 )
955954 def wrap_ragged_attention (
956955 q : Array , k : Array , v : Array , lengths : Array , block_size : int
@@ -1000,7 +999,7 @@ def tpu_ragged_attention(
1000999 bsnd = nn .logical_to_mesh_axes (self .cache_logical_axis_names )
10011000
10021001 @functools .partial (
1003- shard_map ,
1002+ jax . shard_map ,
10041003 mesh = self .mesh ,
10051004 in_specs = (
10061005 bsnd ,
@@ -1010,7 +1009,7 @@ def tpu_ragged_attention(
10101009 None ,
10111010 ),
10121011 out_specs = bsnd ,
1013- check_rep = False ,
1012+ check_vma = False ,
10141013 )
10151014 def wrap_ragged_attention (query , key , value , lengths , block_size ):
10161015 if query .shape [- 2 ] == key .shape [- 2 ]:
@@ -1162,7 +1161,7 @@ def wrap_splash_kernel(multi_head_mask, shard_head_size=1):
11621161 # 'segment_axis_names_kv' maps to ['activation_kv_length', []] meaning that K and V are not sharded
11631162 # splash_kernel is sharded over (HEAD, LENGTH)
11641163 @functools .partial (
1165- shard_map ,
1164+ jax . shard_map ,
11661165 mesh = self .mesh ,
11671166 in_specs = (
11681167 axis_names_q ,
@@ -1176,7 +1175,7 @@ def wrap_splash_kernel(multi_head_mask, shard_head_size=1):
11761175 sink_axis_names , # sharding align with query heads
11771176 ),
11781177 out_specs = axis_names_q ,
1179- check_rep = False ,
1178+ check_vma = False ,
11801179 )
11811180 def wrap_flash_attention (
11821181 query ,
0 commit comments