Repository navigation
Correct stale block-size-512 performance claims - #280
Merged
Merged
Conversation
This was referenced Aug 23, 2026
Merged
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
Partially addresses #216 (documentation half; the block-size sweep remains open).
Every affected claim compared PyTorch-MPS/Metal to CPU or MLX using numbers measured at the old
block_size=512default, without stating that condition, whileblock_sizemoved to 8192 in #229. #216's sweep on the bundled 32-channel sample shows the PyTorch-Metal/MPS backend is far more block-size-sensitive than CPU or MLX, so "PyTorch-MPS never wins" does not generalize; MLX stays the fastest Apple backend at every block size measured.Rework (this update):
paper.mdno longer cites a GitHub issue — both "pamica issue 216" references were replaced with a pointer to the project documentation, and the sweep evidence itself was moved intodocs/guides/validation.md(a new "Block-size sensitivity" subsection) so that citation resolves to real content. The paper's framing was also inverted: MLX is now stated as the reason the backend exists (the more efficient Apple-GPU path), with PyTorch-Metal's block-size sensitivity as the supporting detail, not the headline. A follow-up audit caught two more issues, also fixed here: the multi-model MPS claims inAGENTS.mdanddocs/guides/validation.mdwere the same confounded class (measured atblock_size=512, never re-swept at 8192) and were left unqualified in the first pass; and the further-tuned "13.5 ms/iteration" figure needed a memory caveat everywhere it appears, since that setting puts the whole 30504-frame sample in one block and is not a size-independent win (paper.mdalso had a30/30.5rounding collision with the unrelated native-Fortran figure two lines above, now fixed).Corrected claims
AGENTS.md:65-76before: "PyTorch-MPS never wins (162-255 ms/it, at or worse than CPU)" and "Multi-model MLX (#81) also wins (~5x over torch-CPU; MPS still loses)", both unqualified.AGENTS.md:65-76after: single-model figures qualified withblock_size=512and the #216 sweep (431 to 30.5 ms/it at the 8192 default, still behind CPU's 21.7; 13.5 ms/it beating CPU's 15.8 only at a memory-limited single-block extreme); the multi-model claim now states it was measured at the inherited 512 and has not been re-swept at 8192.docs/guides/backends.md:40-54before: same "PyTorch-MPS does not win (162-255 ms/iteration, at or worse than CPU)" without a block-size qualifier.docs/guides/backends.md:40-54after: statesblock_size=512as the condition, adds the #216 sweep numbers (including the 8192-default CPU/MPS pair and the single-block memory caveat), and cross-links the new validation-guide subsection.docs/guides/validation.md:323-408before: "PyTorch-MPS is not a win... so use MLX" and "MPS still losing" (multi-model), both following a table already labeledblock_size=512but not carrying that qualifier into the conclusion; no dedicated sweep section existed.docs/guides/validation.md:323-408after: both conclusions now stateblock_size=512explicitly and cite #216; a new "Block-size sensitivity" subsection carries the full sweep table (measurement conditions, all four block sizes, the LL-invariance check, and the single-block memory caveat) with provenance to issue #216; the multi-model conclusion notes that configuration is untested at 8192.paper.md:83before: "MLX exists because PyTorch's Metal backend is slower than the CPU on Apple hardware" cited to "pamica issue 216".paper.md:83after: "MLX exists because it is the more efficient path on Apple GPUs: PyTorch's Metal backend trails MLX across the entire block-size sweep, and atpamica's shipped defaults trails even the CPU it runs beside" -- no issue citation, links the documentation instead.paper.md:122-128before: "255 ms for PyTorch-Metal, which never beats the CPU it runs beside", corrected in the first pass to cite "pamica issue 216" with a30/30.5rounding collision against the native-Fortran figure.paper.md:122-128after: statesblock_size=512, gives the 8192-default pair (30.5 vs CPU's 21.7) and the single-block pair (13.5 vs CPU's 15.8) with the memory caveat, lands on "MLX stays the fastest Apple backend throughout the sweep", and points to the documentation link already used two lines later -- no issue citation anywhere in the file.Evidence
All replacement numbers are from #216's block_size sweep table (Apple M4 Pro, bundled 32-channel sample, float32,
n_mix=3,pdftype=0, seed 42, warm) and its own log-likelihood-unchanged confirmation (-3.43856 to six significant digits across all four block sizes), not new measurements. No numbers were invented; the multi-model 70-channel table and the single-model 70-channel EEG numbers indocs/guides/validation.md/paper.mdwere left as originally measured, now labeledblock_size=512and stated as unswept at the current default rather than rescoped without data.Out of scope (left for #216's remaining work)
Test plan
uv run pytest -m "not slow" -n auto-- 410 passed, 24 skipped, 1 xfaileduv run ruff check .anduv run ruff format --check .-- cleanuv run ty check-- cleantypos-- cleanpaper.pdfrebuilt by CI on push (Draft PDF workflow) after eachpaper.mdchange