Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ various types of prompts:
further interactive refinements with points.
- [`sam3_image_batched_inference.ipynb`](examples/sam3_image_batched_inference.ipynb)
: Demonstrates how to run batched inference with SAM 3 on images.
- [`sam3_agent.ipynb`](examples/sam3_agent.ipynb): Demonsterates the use of SAM
- [`sam3_agent.ipynb`](examples/sam3_agent.ipynb): Demonstrates the use of SAM
3 Agent to segment complex text prompt on images.
- [`saco_gold_silver_vis_example.ipynb`](examples/saco_gold_silver_vis_example.ipynb)
: Shows a few examples from SA-Co image evaluation set.
Expand Down
8 changes: 7 additions & 1 deletion sam3/model/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,13 @@ def functional_attention(
assert dropout == 0.0
out = flash_attn_func(q.transpose(1, 2), k.transpose(1, 2), v.transpose(1, 2))
else:
with sdpa_kernel(SDPBackend.FLASH_ATTENTION):
with sdpa_kernel(
[
SDPBackend.FLASH_ATTENTION,
SDPBackend.EFFICIENT_ATTENTION,
SDPBackend.MATH,
]
):
out = torchF.scaled_dot_product_attention(q, k, v, dropout_p=dropout)
out = out.transpose(1, 2) # B * n * n_heads * (cv // num_heads)

Expand Down