Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add llama3 405b attention shapes. #29

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions attentionbench/problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ def bert_attn_sweep(dtype: str) -> list[AttentionConfig]:
configs.append(AttentionConfig(B, M, N, K1, K2, dtype))
return configs

def llama3_405b_attn_sweep(dtype: str) -> list[AttentionConfig]:
configs = []
for M in [1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192]:
K2 = M
configs.append(AttentionConfig(512, M, 128, 128, K2, dtype))
M += 128
return configs

def get_attention_configs() -> list[tuple[str, AttentionConfig]]:
configs: list[tuple[str, AttentionConfig]] = []
Expand All @@ -55,9 +62,12 @@ def get_attention_configs() -> list[tuple[str, AttentionConfig]]:
sdxl_configs += sdxl_unet_sweep("f8E4M3FNUZ")
bert_configs = bert_attn_sweep("f16")
bert_configs += bert_attn_sweep("f8E4M3FNUZ")
llama3_configs = llama3_405b_attn_sweep("f16")
llama3_configs += llama3_405b_attn_sweep("f8E4M3FNUZ")

configs += [("llm_sweep", x) for x in llm_configs]
configs += [("sdxl_unet_sweep", x) for x in sdxl_configs]
configs += [("bert_attn_sweep", x) for x in bert_configs]
configs += [("llm", x) for x in llm_configs]
configs += [("sdxl_unet", x) for x in sdxl_configs]
configs += [("bert", x) for x in bert_configs]
configs += [("llama3_405b", x) for x in llama3_configs]

return configs