Optimize Triton decoding kernel for long context (#2394)

This commit is contained in:
Ke Bao
2024-12-08 01:17:37 -08:00
committed by GitHub
parent 1f09e84b9a
commit 7dc66fcb40
4 changed files with 344 additions and 376 deletions
+7
View File
@@ -141,6 +141,7 @@ class ServerArgs:
enable_nan_detection: bool = False
enable_p2p_check: bool = False
triton_attention_reduce_in_fp32: bool = False
triton_attention_num_kv_splits: int = 8
num_continuous_decode_steps: int = 1
delete_ckpt_after_loading: bool = False
@@ -753,6 +754,12 @@ class ServerArgs:
help="Cast the intermidiate attention results to fp32 to avoid possible crashes related to fp16."
"This only affects Triton attention kernels.",
)
parser.add_argument(
"--triton-attention-num-kv-splits",
type=int,
default=ServerArgs.triton_attention_num_kv_splits,
help="The number of KV splits in flash decoding Triton kernel. Larger value is better in longer context scenarios. The default value is 8.",
)
parser.add_argument(
"--num-continuous-decode-steps",
type=int,