[XPU] Cap topk/topp Triton BLOCK_SIZE to 4096 to fix Top-p mask difference failures (#44470)
Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
This commit is contained in:
Regular → Executable
+4
@@ -929,8 +929,12 @@ def apply_top_k_top_p_triton(
|
||||
normal_cdf_to_sigma_table, percentile_to_std_table = tables
|
||||
|
||||
# Smaller tiles compile and run faster on CPU; GPU benefits from larger tiles.
|
||||
# On XPU, large BLOCK_SIZE causes precision loss in the single-pass pivot
|
||||
# approximation; use smaller tiles for accurate top-p results.
|
||||
if logits.device.type == "cpu":
|
||||
block_size, block_size_trunc = 256, 128
|
||||
elif logits.device.type == "xpu":
|
||||
block_size, block_size_trunc = 4096, 2048
|
||||
else:
|
||||
block_size, block_size_trunc = 8192, 4096
|
||||
|
||||
|
||||
Reference in New Issue
Block a user