Repository navigation
docs: engineering notes - #54
Merged
Merged
Conversation
…er scripts/article/) The long engineering-notes write-up with its 9 SVG figures under docs/images/lessons/ (absolute raw.githubusercontent.com URLs, so they render on GitHub and in the docs build). The two figure scripts move to scripts/article/ with REPO computed from the file and an --out option; they regenerate figures 4-9 byte for byte, and test_article_figures.py checks that on every run. mkdocs nav and llms.txt link the page. One development-machine sentence is removed (no hardware details beyond Tesla T4).
This was referenced Oct 26, 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.
docs: engineering notes
Adds
docs/lessons.md, titled "Engineering notes: making FlashSpec faster": the long engineering-notes version of theFlashSpec write-up (11 lessons, 3,302 words, 9 figures). The draft's article-style title ("Making speculative decoding actually
faster: lessons from FlashSpec") is replaced, so the page reads as documentation, not a second copy of the post. The refined public article is separate and is not in this
repo. Do not merge until reviewed.
Files
docs/lessons.md: the draft, unchanged except:https://raw.githubusercontent.com/Mattral/FlashSpec/main/docs/images/lessons/…).raw.githubusercontent.com serves SVG as
image/svg+xml(checked), so they render on GitHub and in the docs build (builtlocally:
site/lessons/index.htmlhas all 9);scripts/article/instead of "this folder", and says figures 2–3 have no generator;development-machine detail beyond "Tesla T4". The rest of that sentence ("Every GPU number comes from a Colab notebook…") is
kept.
docs/images/lessons/fig1…fig9.svg: copied unchanged.scripts/article/make_phase6_figures.py(figures 5–8) andscripts/article/make_030_figures.py(figures 4 and 9):REPO = Path(__file__).resolve().parents[2]replaces the hard-coded home path;docs/images/lessons/by default (--out DIRto override);figures()returns name → SVG text;lrenamed. Drawing code and output are unchanged./tmpinto an empty directory, both scripts reproducefig4–fig9byte-identical to the committed SVGs;tests/unit/test_article_figures.pynow checks this on every CI run, and it fails if a single number in an SVG is edited(tried, then restored);
mkdocs.ymlgets "Engineering notes: lessons.md" in the nav;llms.txtgets an entry under Docs.Number audit
Every number in
lessons.mdand in the SVGs without a generator, against the source it cites. "ok" means the article's roundedvalue equals the source value at the article's precision.
tinyllama_gpu_flashspec_ucb_cb02ca1.jsonspeedup_vs_ar_mean8d036d7speedup_vs_*_compiled_median3c43e083c43e08[8, 4, 1, 4, 1, …]8d036d7forward_cost, MT-Bench T=0.7 cellconfig.json8d036d7HumanEval greedystep_profilescripts/phase6_analysis.pystep_ms_alone3e38251code edits, greedyfdd3be98d036d7,3c43e08HumanEval greedygeneration_config.jsongreedy_token_match_compiled3e38251outputs3e382513e38251arm report, analysiscounterfactual_over_measuredreward_over_tpsprompt_oracles_ENGINE_N = 10_000,SamplingConfig(gamma=4)tests/integration/test_output_distribution.pyOne mismatch, left as written for you to decide: "parameter ratio (0.33)" in lesson 2. The real ratio is 0.32. Suggested
wording, if you want it: "…its cost ratio (0.90) tracks the layer ratio (0.86), not the parameter ratio (0.32)."
Gate
Local, on this branch:
make lint(ruff incl.scripts/article, format, import-linter),mypy --strict flashspec: cleanpytest tests/unit tests/integration -m "not gpu": 561 passed, 5 skipped (coverage 88.92%), includingtest_article_figures.pymkdocs build: the Engineering notes page renders with all 9 images; 30 warnings, the same griffe docstring warnings asmain