Repository navigation
feat: optional CuPy GPU backend, float32 support and a treasure-grade polish pass - #8
Merged
Merged
Conversation
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.
What's in this PR
Optional CuPy GPU backend (the headline feature)
numpy_keras.set_backend("cupy")/NUMPY_KERAS_BACKEND=cupy; default behavior stays bit-identical pure NumPy, missing CuPy degrades gracefullyfit/predict/evaluatertol=1e-12)predict+ contracted softmax backwardfloat32 compute dtype
Sequential(..., dtype="float32")with dtype enforced at the choke points (cupy scalar promotion silently produced float64 — fixed and tested)Fixes and infrastructure
autograd/subpackage repaired (Flatten dispatch, predict, best-weights restore, import crash without autograd) + 7 testsxavier_*canonical spelling (old names aliased),EarlyStopping(monitor="loss"),predictreturn-type documentedVerification
pytest tests/: 318 passed (186 original untouched + backend 12, GPU parity 44, float32 9, autograd 7, Cython 58 after in-place build)check_snippets.py: 14/14