@@ -381,7 +381,7 @@ def _extract_custom_block_sizes(flash_block_sizes):
381381 bq = 4864
382382 bkv = 1024
383383 bkv_compute = 1024
384- bkv_compute_in = 1024
384+ bkv_compute_in = None
385385 heads_per_tile = 1
386386 vmem_limit_bytes = None
387387 if flash_block_sizes is not None :
@@ -390,22 +390,25 @@ def _extract_custom_block_sizes(flash_block_sizes):
390390 bq = get ("block_q" , None ) or bq
391391 bkv = get ("block_kv" , None ) or bkv
392392 bkv_compute = get ("block_kv_compute" , None ) or bkv_compute
393- bkv_compute_in = get ("block_kv_compute_in" , None ) or bkv_compute_in
393+ bkv_compute_in = get ("block_kv_compute_in" , None )
394394 heads_per_tile = get ("heads_per_tile" , None ) or heads_per_tile
395395 vmem_limit_bytes = get ("vmem_limit_bytes" , None ) or vmem_limit_bytes
396396 else :
397397 bq = getattr (flash_block_sizes , "block_q" , None ) or bq
398398 bkv = getattr (flash_block_sizes , "block_kv" , None ) or bkv
399399 bkv_compute = getattr (flash_block_sizes , "block_kv_compute" , None ) or bkv_compute
400- bkv_compute_in = getattr (flash_block_sizes , "block_kv_compute_in" , None ) or bkv_compute_in
400+ bkv_compute_in = getattr (flash_block_sizes , "block_kv_compute_in" , None )
401401 heads_per_tile = getattr (flash_block_sizes , "heads_per_tile" , None ) or heads_per_tile
402402 vmem_limit_bytes = getattr (flash_block_sizes , "vmem_limit_bytes" , None ) or vmem_limit_bytes
403403 # A BlockSizes object carries heads_per_tile=None when the config dict omitted
404404 # it; getattr then returns that None instead of the default, so coerce it back
405405 # to 1 (the custom-kernel default) to keep the `heads_per_tile > 1` guards safe.
406406 if heads_per_tile is None :
407407 heads_per_tile = 1
408- bkv_compute_in = min (bkv_compute , bkv_compute_in )
408+ if bkv_compute_in is None :
409+ bkv_compute_in = bkv_compute
410+ else :
411+ bkv_compute_in = min (bkv_compute , bkv_compute_in )
409412 return bq , bkv , bkv_compute , bkv_compute_in , heads_per_tile , vmem_limit_bytes
410413
411414
0 commit comments