feat(linked): add MetaX FlashAttention providers - #934
Draft
voltjia wants to merge 1 commit into
Draft
Conversation
voltjia
force-pushed
the
feat/metax-linked-flash-attn
branch
from
August 19, 2026 03:39
8c5389a to
fa3f8ea
Compare
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.
Summary
flash_attn_varlen_funcandflash_attn_with_kvcacheoperators using the installedflash-attnshared library.ops.jsonmechanism.Motivation
InfiniCore's basic Llama/Qwen prefill and decode paths should call the canonical InfiniOps FlashAttention interfaces on MetaX. The installed MetaX
flash-attnpackage exports an ABI with one additional optional extension tensor, so it needs a platform-specific linked adapter while preserving the canonical public operator contract.Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Smoke Test Result
The generated linked manifest contains only:
Test Results on Supported Platforms
Additional checks:
python3 -m pytest tests/test_ops_config.py tests/test_generate_wrappers.py tests/test_resolve_linked_ops.py(84 passed)clang-format 21.1.8 --dry-run --Werroron all new C++ provider filesgit diff --check origin/master...HEADBenchmark / Performance Impact
N/A. This PR adds a MetaX adapter for an existing external implementation.
Notes for Reviewers
flash-attn 2.6.3+metax3.2.1.3torch2.4. The MetaX ABI adds a trailingstd::optional<at::Tensor>&; the adapter owns that extension argument and delegates through the canonical InfiniOps interface.ops.json, using the operator implementation selection added by feat(build): select operator implementations fromops.json#931. This PR adds no separate linked-provider selector or environment variable.