Skip to content

testing: recognise Neuron for flash-attention platform support#66

Open
aws-dixuan wants to merge 1 commit into
mainfrom
neuron-enable-cp-attention-tests
Open

testing: recognise Neuron for flash-attention platform support#66
aws-dixuan wants to merge 1 commit into
mainfrom
neuron-enable-cp-attention-tests

Conversation

@aws-dixuan

Copy link
Copy Markdown

Neuron runs the upstream attention / context-parallel tests through the PrivateUse1 dispatcher. The PLATFORM_SUPPORTS_* LazyVals in common_cuda.py only 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_NEURON flag gated on the inherited PYTORCH_TESTING_DEVICE_ONLY_FOR env var and return True from evaluate_platform_supports_flash_attention() when set, making the flag correct in both the controller and the subprocesses. This unskips test_ring_attention_sdpa (and related attention / CP tests) on Neuron.

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant