Repository navigation
Problems: say that np.linalg computes in float64, and which problems use SciPy (#73) - #76
Merged
Merged
Conversation
…use SciPy (#73) np.linalg computes in float64 even for float32 arrays, so NumPy's float32 P7 cells have been float32 products with float64 solves. For P7's small matrices np.linalg still costs less per call than SciPy's float32 solve, so P7 keeps it, and the published rows stand as what NumPy gives in float32; this records what they measure. P5's dense sweep, one large solve, uses SciPy's float32 LU, which is faster there. The README's NumPy row and a new note say so, and kalman.py's NumPy version says so in a comment. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMZbJB4j8pmPEYyJ8SG
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.
For #73.
np.linalgcomputes in float64 even for float32 arrays, then rounds its answer back to float32, so P7's NumPy float32 cells have been float32 products with float64 solves and log-determinants. This PR keeps P7's code as it is and says what those cells measure. It also says which problems use SciPy instead. Matt chose this over switching P7 to SciPy and re-running, on 2026-11-20.Why P7 keeps
np.linalgFor P7's small matrices, NumPy's own solver costs less per call than SciPy's float32 one, even with float64 inside. On qe-mini1's M6:
np.linalg.solvescipy.linalg.solve, float32So a careful NumPy author writing P7 would keep
np.linalg. NumPy's float32 P7 rows onmain, the 138 listed on #73, stand as what NumPy gives in float32, and none is re-run. P5's dense sweep is the opposite case: one large solve, where SciPy's float32 solve took 0.073 s for 4,000 states against NumPy's 0.137 s, which is why #71 made it usescipy.linalg.solve.What changes
problems/README.md:numpybackend's row now says NumPy's column uses SciPy where SciPy has the faster tool.np.linalgcomputes in float64, which problems use which library and why, with the figures above, and that SciPy's BLAS may be a separate build from NumPy's. That last point is the one the organiser's reviewer raised on Problems: P5, the stationary distribution of a savings policy (#47) #71.problems/kalman.py: a comment on the NumPy version saying its float32 solves are float64, and why it keepsnp.linalg.No results and no code paths change. A correction to the Kalman finding's sentence that names NumPy as the M6's fastest float32 stack at 100 states goes to QuantEcon/project-benchmarks-jax separately.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMZbJB4j8pmPEYyJ8SG