testing: recognise Neuron for flash-attention platform support#66
Open
aws-dixuan wants to merge 1 commit into
Open
testing: recognise Neuron for flash-attention platform support#66aws-dixuan wants to merge 1 commit into
aws-dixuan wants to merge 1 commit into
Conversation
evaluate_platform_supports_flash_attention() only recognised CUDA/ROCm/XPU, so PLATFORM_SUPPORTS_FLASH_ATTENTION / _FUSED_ATTENTION evaluated False on Neuron -- including inside the spawn-ed subprocesses of multiprocess DTensor tests, where a main-process-only override cannot reach. This skipped the upstream context-parallel SDPA tests (e.g. RingAttentionTest.test_ring_attention_sdpa) at their @skipIf(not PLATFORM_SUPPORTS_FUSED_ATTENTION) guard. Gate on the PYTORCH_TESTING_DEVICE_ONLY_FOR=neuron env var (inherited by spawn) so the flag is correct in both the controller and subprocesses. Mem-efficient is left unchanged (Neuron presents as flash-only).
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.
Neuron runs the upstream attention / context-parallel tests through the PrivateUse1 dispatcher. The
PLATFORM_SUPPORTS_*LazyVals incommon_cuda.pyonly recognise CUDA / ROCm / XPU, so on Neuron they short-circuit to a CUDA-only skip — including inside the spawned subprocesses of multiprocess DTensor tests, where a main-process-only override doesn't run.Add a
TEST_NEURONflag gated on the inheritedPYTORCH_TESTING_DEVICE_ONLY_FORenv var and returnTruefromevaluate_platform_supports_flash_attention()when set, making the flag correct in both the controller and the subprocesses. This unskipstest_ring_attention_sdpa(and related attention / CP tests) on Neuron.