Added AITER V3 API check mechanism#662
Conversation
Claude WalkthroughIntent. Expose a lightweight way to ask AITER whether its v3 (asm) fused-attention path would run for a given config, without launching a kernel. This gives TE a hook to make future backend-selection / dispatch decisions (e.g. fall back to CK v2 when v3 is not available) based on AITER own capability check rather than TE-side heuristics. Key changes.
Walkthrough.
Testing. No tests added. The probe is a pure dry-run against AITER, so behavior is only exercised once a caller (a future PR, per the "for future flexibility" framing in the description) wires it into dispatch. Notes for reviewers.
Generated by Claude. To request a code review, comment |
| // Probe whether AITER's v3 (asm) path will run for the given config, without | ||
| // launching a kernel (backed by AITER's v3_api_check dry-run). Returns true iff | ||
| // the v3 path is selected; false means the CK v2 path (or no support) would run. | ||
| bool ck_attn_fwd_uses_v3(const CKAttnFwdArgs& args); | ||
| bool ck_attn_bwd_uses_v3(const CkAttnBwdArgs& args); |
There was a problem hiding this comment.
Minor doc-clarity nit for future callers: the probe's result depends on the caller's uses_fwd_v3 / uses_bwd_v3 flags, because build_{fwd,bwd}_fmha_args copies them into fmha_args.use_asm_v3 before flipping v3_api_check. So this reports "would v3 dispatch given this config as-configured", not "is v3 available for this config regardless of the opt-in flag".
If future callers use the probe to decide whether to enable v3 (rather than confirm an already-decided choice), they'll need to pre-set args.uses_{fwd,bwd}_v3 = true before calling — worth mentioning in this comment block so that's not a surprise. Not blocking.
|
Reviewed the diff ( Verdict: Looks good. The refactor extracts Left one non-blocking inline nit on the header docstring around how the probe interacts with the caller's Copyright headers: OK — all three edited files already carry |
wenchenvincent
left a comment
There was a problem hiding this comment.
Can we add a test?
What kind of test would you want added? Since this is pretty internal to the CK FA API we'd need to either test directly in C w/ known kernel configs, or create a python binding to expose to pytest. I personally think it should be okay without a test (we had this mechanism before) and that it'll actually be indirectly tested by other downstream mechanisms that rely on it (e.g. your PR). |
|
@Micky774 Could you check if the CI failures are related? |
Failures seem unrelated. They're a combo of group GEMM failures, timeouts and resource errors. |
Description
Added mechanism to check for V3 API usage for future flexibility.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: