Repository navigation
Add numerical tests for Ascend ViT varlen attention - #139
Open
zhachar14h-cell wants to merge 1 commit into
Open
zhachar14h-cell wants to merge 1 commit into
zhachar14h-cell wants to merge 1 commit into
Conversation
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.
The Ascend ViT attention shim has no standalone numerical pytest coverage. Changes to cumulative sequence ends, attention scaling, or packed QKV strides could corrupt image embeddings without a small, model-free check.
Add 34
ci_npucases for the originalvit_attn._flash_attn_fwdimplementation:NoneLSE return value.The fixture loads the standalone shim by file path to avoid installing the package's process-wide import redirects. It skips when PyTorch, torch_npu, or an NPU is unavailable. No model weights or custom kernel dependencies are needed.
Validation:
OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 python -m pytest -q -m ci_npu tests/npu_ops/test_vit_attn.py— 34 passed in 11.37s.--collect-only -m ci_npuselects all 34.ruff check --no-cacheandruff format --check --no-cachepassed;git diff --cached --checkpassed.This is a tests-only change. The A2 run exercises the standalone shim, not package initialization (the project requires Python 3.12), complete model inference, or other custom kernels. A3/Ascend950 and the declared production dependency stack were not tested.