Skip to content

fix(docs): make matmul README FLOP table use one (decimal) n convention (Fixes #102)#230

Merged
zeokin merged 1 commit into
zeokin:mainfrom
luciferlive112116:fix/matmul-readme-flop-table-decimal-n
Jul 14, 2026
Merged

fix(docs): make matmul README FLOP table use one (decimal) n convention (Fixes #102)#230
zeokin merged 1 commit into
zeokin:mainfrom
luciferlive112116:fix/matmul-readme-flop-table-decimal-n

Conversation

@luciferlive112116

Copy link
Copy Markdown
Contributor

Fixes #102.

PR kind

  • fix
  • feat

Summary

matmul/README.md's "it doesn't fit" table mixes two n conventions within a
single table. The memory columns use decimal n (128k → 128000, so one fp32
matrix is 128000² × 4 = 65 GB, and A+B+C = 196 GB), but the compute (2n³)
column used binary n for the first three rows and decimal n for the
last:

n documented 2n³ from should be (decimal n)
1k 2.1 GFLOP 2·1024³ (binary) 2.0 GFLOP (2·1000³)
16k 8.8 TFLOP 2·16384³ (binary) 8.2 TFLOP (2·16000³)
32k 70 TFLOP 2·32768³ (binary) 66 TFLOP (2·32000³)
128k 4.2 PFLOP 2·128000³ (decimal — already correct) 4.2 PFLOP

A binary n overstates 2n³ by (1024/1000)³ = 1.074 (~7%), so the first three
rows were ~7% high and inconsistent with the decimal n the same table's memory
columns use.

Fix

  • matmul/README.md — recompute the 1k/16k/32k compute cells from the same
    decimal n the memory columns use: 2.1 → 2.0, 8.8 → 8.2, 70 → 66
    (128k already 4.2 PFLOP). Numbers-only; +3/−3.
  • tests/test_matmul_flop_table_units.py (new) — CPU-only arithmetic test that
    derives the compute column from 2·(decimal n)³ (and a witness that the old
    binary-n figures were the inconsistent, larger ones) so the table cannot
    drift back to a mixed convention.

Validation

$ python -m pytest tests/test_matmul_flop_table_units.py -q
  3 passed

$ python -m pytest tests/ strategy/tests/ eval/tests/ -q      # CI-equivalent (no torch → GPU tests skip)
  288 passed, 24 skipped

No protected paths (eval/, docs/, .github/, dashboard/) touched — this
edits matmul/README.md (package doc, open zone).

Result

Documentation-consistency fix; no code path changed, so no accuracy / latency /
VRAM delta.

metric value
accuracy unchanged (docs + arithmetic test only)
time complexity unchanged
latency N/A
VRAM usage N/A

The 'it doesn't fit' table's memory columns use decimal n (128k -> 128000, so
one fp32 matrix is 128000**2*4 = 65 GB), but the compute (2n**3) column mixed
conventions: 1k/16k/32k used binary n (1024/16384/32768 -> 2.1/8.8/70) while the
128k row already used decimal n (-> 4.2 PFLOP). Binary n overstates 2n**3 by
~7% ((1024/1000)**3 = 1.074), so the column was internally inconsistent.

Recompute the first three rows from the same decimal n the memory column uses:
2.1->2.0 GFLOP, 8.8->8.2 TFLOP, 70->66 TFLOP (128k already 4.2 PFLOP). Add a
CPU-only arithmetic test pinning the compute column to 2*(decimal n)**3 so it
cannot drift back to the mixed-convention figures.

Fixes zeokin#102.
@github-actions github-actions Bot added area:matmul Exact engine and tile schedules (matmul/) area:tests Correctness gates and test suites (tests/) area:docs README, CONTRIBUTING, BENCHMARKS and other docs status:needs-review Awaiting maintainer review type:bug Something is incorrect or broken status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only labels Jul 13, 2026

@zeokin zeokin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unifies the matmul README FLOP table to a single decimal-n convention; arithmetic test.

@zeokin zeokin merged commit ecdfb73 into zeokin:main Jul 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs README, CONTRIBUTING, BENCHMARKS and other docs area:matmul Exact engine and tile schedules (matmul/) area:tests Correctness gates and test suites (tests/) status:needs-review Awaiting maintainer review status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only type:bug Something is incorrect or broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] matmul README FLOP table mixes decimal and binary n, overstating 2n³ by ~7%

2 participants