Skip to content

Commit

Permalink
[cp] Add cudnn attention support to Context Parallel
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
XilunWu committed Jan 17, 2025
1 parent 95677cb commit a89cf3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion torchtitan/models/llama/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"debugmodel": ModelArgs(dim=256, n_layers=8, n_heads=16, rope_theta=500000),
"8B": ModelArgs(
dim=4096,
n_layers=32,
n_layers=1,
n_heads=32,
n_kv_heads=8,
ffn_dim_multiplier=1.3,
Expand Down
3 changes: 2 additions & 1 deletion torchtitan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def context(cp_context: Optional[Generator[None, None, None]] = None):
# TODO (xilunwu): support cuDNN backend
stack.enter_context(
sdpa_kernel(
[SDPBackend.FLASH_ATTENTION, SDPBackend.EFFICIENT_ATTENTION]
# [SDPBackend.FLASH_ATTENTION, SDPBackend.EFFICIENT_ATTENTION]
[SDPBackend.CUDNN_ATTENTION]
)
)
stack.enter_context(cp_context)
Expand Down

0 comments on commit a89cf3c

Please sign in to comment.