Multi-vendor GPU (PR3): port PDM, CE, String-Length, MHAOV, TLS to torch - #11
Merged
Merged
Conversation
tjayasinghe
commented
Jun 30, 2026
Owner
…ackend Extends the portable array-API path from GLS/BLS (PR1) to the remaining five methods, so all seven now run on any torch device (CUDA/ROCm/MPS/XPU/CPU) with the NVIDIA fast paths untouched. - CE / PDM: vectorized histogram/box kernels re-spelled to array-API ops (scatter_add shim, xp.astype/remainder/clip, dtype-following-periods); numpy + torch flow through array_api_compat namespaces. cupy RawKernels unchanged. - String-Length: sort/gather re-spelled with fancy indexing + slicing (no take_along_axis/diff, which aren't in every namespace). - MHAOV: einsum + linalg.solve are available in the compat namespaces, so the torch path is a thin add; raw numpy/cupy keep einsum. - TLS: matched filter re-spelled (notably explicit float dtype on every zeros(), since torch defaults to float32; clip instead of minimum-with-scalar, which torch rejects). - config: device/precision mixin + "torch" backend on all five settings. - New tests/test_torch_bonus.py: torch:cpu vs numpy parity + period recovery for all five (harmonic-aware, since String-Length/MHAOV legitimately lock onto a harmonic identically on both backends). Validated on torch:cpu: CE 1.3e-15, String-Length 2.8e-14, PDM 0.0, TLS 0.0 (bit-identical); MHAOV 2.7e-10 relative (linalg.solve rounding, peak unaffected). 160 passed, 8 skipped (CUDA-only); ruff + mypy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tjayasinghe
changed the base branch from
feat/arrayapi-foundations
to
dev/multi-vendor-gpu
June 30, 2026 21:55
This was referenced Jun 30, 2026
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.