Question bank — Contributing to open-source ML
Related deep skills: Code Review Best Practices, Testing ML Systems, Version Control with Git, Software Engineering for ML, ML Research Paper Implementation.
Related deep skills: Testing ML Systems, Software Engineering for ML.
Two trade-offs, visualised first
Before the cards, look at the two pictures the hardest questions are really about.

Figure 1 draws (just defined above) as four vertical switch-bars along the x-axis, one per factor (, , , ); the y-axis is the switch value or . Inspect the red bar: three switches are green () but the "tested" switch is red (), and the title shows . The lesson to read off the picture: excellence in three columns cannot rescue a single failed column, because we multiply rather than add.

Figure 2 plots the checkpointing trade-off against the checkpoint interval on the x-axis. Inspect the blue curve (left y-axis, memory units): saved memory falls as grows. Inspect the red curve (right y-axis, compute units): the compute cost rises toward as shrinks toward ; the dashed yellow line marks the normal "store everything" memory level . Why does the total work reach ? The forward pass runs once ( work). Normally the backward pass reuses stored activations, so no recompute is needed — the backward pass's own gradient arithmetic is the same whether or not we checkpoint, so it is not the thing that changes and is not counted twice here. The only extra cost checkpointing adds is re-running the forward computation of the discarded layers to rebuild their activations — a second forward-style pass of . Adding that recompute to the original forward pass gives : that is the origin of "roughly doubles the time."
True or false — justify
Bigger, more sophisticated contributions are always more valuable than tiny ones.
You should start coding on the main branch of your fork so your work stays visible.
main should mirror upstream so you can sync and start clean features; committing straight to it entangles unrelated work and makes rebasing painful.A pull request that passes all existing tests is ready to merge.
If your code is correct, clear documentation is optional.
Forking a repository automatically gives you permission to merge into the original project.
Gradient checkpointing makes training faster.
Claiming an issue before coding is just polite etiquette with no practical benefit.
Once a PR gets review comments, revisions mean you did something wrong.
Spot the error
"I'll benchmark my feature on my laptop CPU and report the speedup." — what's wrong?
A contributor has two 1-D tensors, a of shape (3,) and b of shape (3,), and writes dot = (a * b).sum(dim=1). Why does this break?
dim=0. The code sums over dim=1, a batch axis that doesn't exist, so it raises an "IndexError/expected 2D" symptom. Fix: either unsqueeze(0) to reshape each to (1, 3) and keep dim=1, or sum over dim=0 for genuinely 1-D inputs (see Testing ML Systems).Someone divides by the norm as dot / (norm1 * norm2) with no eps. Where does this fail?
eps (e.g. .clamp(min=1e-8)) keeps it finite. The scale is chosen well below any real vector norm yet safely above float32's smallest normal value (), so for normal inputs the clamp never fires and the result is undistorted; it only rescues the degenerate zero case."My PR is huge — 40 files changed — because I also reformatted the whole module." What's the mistake?
A test reads assert not result.isnan(). Why is this a weak test?
"I picked TensorFlow's C++ backend as my first project because it's the most impressive." Diagnose.
A PR description says only "fixes bug." What's missing?
Why questions
Why is the PR quality formula a product rather than a sum?
Why do maintainers value tests even more than the fix itself?
Why does documentation-fixing "force you to understand internals" despite needing little code?
max_features='sqrt' trades predictive power for decorrelation) — you can't fake understanding when writing an explanation.Why prefer a project you already use for your first contribution?
Why is doubling compute an acceptable price for gradient checkpointing on large models?
Why link the original issue in your PR description?
Edge cases
What happens if you submit a PR for an issue nobody claimed but two people were quietly working on?
Your fix works, but the project supports a Python version where your syntax is invalid. What now?
You benchmark checkpointing with (checkpoint_every) equal to the number of layers . What's the degenerate result?
Cosine similarity of a vector with itself — what should the code return, and does the eps clamp distort it?
eps (), the clamp never activates and the answer is undistorted; eps only guards the zero-vector corner.The good-first-issue you picked turns out to require redesigning a core API. Should you push through?
Two reviewers give contradictory change requests on your PR. What's the right move?
Recall One-line self-test
The four PR factors, in order ::: Correct, Clear, Tested, Justified — multiplied, so any zero sinks it. Checkpointing trades ___ for ___ ::: Compute for memory (recompute activations instead of storing them). The symbols in ::: layers, checkpoint interval, batch size, hidden dimension.