[Flex Attention] Add a Triton version so we can test autoWS#983
Draft
manman-ren wants to merge 7 commits intomainfrom
Draft
[Flex Attention] Add a Triton version so we can test autoWS#983manman-ren wants to merge 7 commits intomainfrom
manman-ren wants to merge 7 commits intomainfrom
Conversation
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary:
if is_full:
forward_block_mn(..., IS_FULL_BLOCKS=True) # compile-time specialized
else:
forward_block_mn(..., IS_FULL_BLOCKS=False) # compile-time specialized
This can cause an issue with autoWS, we can use a variable.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Branchless masking to avoid scf.if with else blocks (unsupported by
WSSpecialize), add merge_epilogue annotation, use tl.where instead of
Python ternary for runtime conditionals, and add BLOCK_M=128 WS config.
Authored with Claude.
dp_factor of 1 works
CUDA_VISIBLE_DEVICES=5 TORCHINDUCTOR_COMPILE_THREADS=1 TRITON_USE_META_PARTITION=1 TRITON_USE_META_WS=1 python run.py --op flex_attention --mode fwd --only triton_ws,compiled --seq-len 1024 --mod-type causal --force --metrics accuracy --baseline compiled
(B, Hq, M, Hkv, N, D) | Mask Type triton_ws-accuracy
---------------------------------------------- --------------------
(8, 16, 1024, 16, 1024, 128) | causal 1
c569bc8 to
a84a90d
Compare
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.