-
Couldn't load subscription status.
- Fork 6.4k
[docs] Attention checks #12486
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
[docs] Attention checks #12486
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| try: | ||
| with attention_backend("flash"): | ||
| output = dispatch_attention_fn(query, key, value) | ||
| print("✓ Flash Attention works with checks enabled") | ||
| except Exception as e: | ||
| print(f"✗ Flash Attention failed: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be set as export DIFFUSERS_ATTN_CHECKS=yes before running any execution because of how DIFFUSERS_ATTN_CHECKS is used:
| from ..utils.constants import DIFFUSERS_ATTN_BACKEND, DIFFUSERS_ATTN_CHECKS, DIFFUSERS_ENABLE_HUB_KERNELS |
| DIFFUSERS_ATTN_CHECKS = os.getenv("DIFFUSERS_ATTN_CHECKS", "0") in ENV_VARS_TRUE_VALUES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be enabled here https://github.com/huggingface/diffusers/pull/12486/files#diff-249c332f10872ba150d634947de12055f99d9db5c3dbf2bef092ccba775f39bdR98 with os.environ["DIFFUSERS_ATTN_CHECKS"] = "1" no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah DIFFUSERS_ATTN_CHECKS is determined at the module-level so I am not sure setting it that way would be effective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, updated to use export DIFFUSERS_ATTN_CHECKS=yes then!
Adds docs for how to enable checks when using different attention backends