Repository navigation
MNT Test for thread safety contract: inference methods shouldn't modify the estimator - #34729
Conversation
…ternal_state_unchanged_by_inference() stay stable. Note these stats are deprecated, and also updated in a thread-safe manner.
|
Update: I've hopefully fixed the failing tests. One was just noise from KDTree/BallTree stats, which are actually thread-safe (and deprecated). The other appears to be a real bug: somehow |
cakedev0
left a comment
There was a problem hiding this comment.
Here is a partial review with the help of AI.
Some things can be fixed/improved, but nothing critical.
AI add a few more legit-looking items I haven't checked yet, so I haven't included them yet in this review.
|
OK, done. |
Came here from the upstream issue, scipy/scipy#26600, and the upstream's position is scipy/scipy#26600 (comment). The BSpline code has been doing these internal copies "forever", thus changing it is not straightforward for backwards compat, and I'm not immediately convinced that it's a BSpline bug, FWIW. |
todo: move [sklearn#35216](scikit-learn/scikit-learn#35216) from Now to Waiting, the test was already there, approved by lesteve with auto-merge add: Trees: get [sklearn#34554](scikit-learn/scikit-learn#34554) merged (recursion PDP on categorical features; approved) add: Threads: review [sklearn#34729](scikit-learn/scikit-learn#34729) (inference methods don't modify the estimator; ev-br on the SplineTransformer mutation) todo: lucyleeow approved [sklearn#35215](scikit-learn/scikit-learn#35215) Co-Authored-By: Claude Opus 5.5 <[email protected]>
done: HGB: get [sklearn#35216](scikit-learn/scikit-learn#35216) merged (binning crash on all-missing features, fixes [sklearn#35164](scikit-learn/scikit-learn#35164)), merged before I removed it done: Trees: get [sklearn#34554](scikit-learn/scikit-learn#34554) merged (recursion PDP on categorical features) drop: Threads: answer lesteve on [sklearn#35105](scikit-learn/scikit-learn#35105) (RFC deprecate `pre_dispatch`) drop: Maintenance: follow up on [sklearn#35209](scikit-learn/scikit-learn#35209) (newton-cg test failing on the macOS x86_64 wheels) drop: Benchmarks: review [benchmarks#142](probabl-ai/scikit-learn-benchmarks#142) (cuML benchmark config) drop: Threads: review [sklearn#34729](scikit-learn/scikit-learn#34729) (inference methods don't modify the estimator) drop: Linear: [sklearn#34793](scikit-learn/scikit-learn#34793) (Ridge centering trick for cholesky), benchmarks in [benchmarks#115](probabl-ai/scikit-learn-benchmarks#115) and [benchmarks#31](probabl-ai/scikit-learn-benchmarks#31) drop: Upstream: sklearnex reports [sklearnex#3402](uxlfoundation/scikit-learn-intelex#3402), [sklearnex#3377](uxlfoundation/scikit-learn-intelex#3377), [sklearnex#3220](uxlfoundation/scikit-learn-intelex#3220) drop: Upstream: [data-apis/array-api#976](data-apis/array-api#976) (why `stable=True` is the default for `xp.sort`) drop: Upstream: dpnp reports [IntelPython/dpnp#3149](IntelPython/dpnp#3149) and [IntelPython/dpnp#3148](IntelPython/dpnp#3148) drop: Threads: [sklearn#34736](scikit-learn/scikit-learn#34736) (oversubscription in `pairwise_distances`), out of the reported findings item drop: KMeans: benchmarks [benchmarks#154](probabl-ai/scikit-learn-benchmarks#154), [benchmarks#160](probabl-ai/scikit-learn-benchmarks#160), [OpenBLAS#6105](OpenMathLib/OpenBLAS#6105) and [sklearn#17334](scikit-learn/scikit-learn#17334), out of the [sklearn#35193](scikit-learn/scikit-learn#35193) item todo: move [joblib#1899](joblib/joblib#1899), [sklearn#35261](scikit-learn/scikit-learn#35261) and [sklearn#35053](scikit-learn/scikit-learn#35053) from Reviews to Now, [sklearn#35181](scikit-learn/scikit-learn#35181) to the top of Waiting (by hand in 03835dd) Co-Authored-By: Claude Opus 5.5 <[email protected]>
ogrisel
left a comment
There was a problem hiding this comment.
Pending review comments of a partial review I started but never finished.
Co-authored-by: Olivier Grisel <[email protected]>
|
@itamarst the new test fails but other than that, LGTM. |
|
And some merge conflicts, looks like. I'll take a look, thank you. |
|
I fixed the test and merged forward. Since this adds what is technically a public API (a new estimator check), should it be FEAT instead of MNT? |
## Summary Fixes the 10 failures in the nightly-dependency wheel tests. - Keeps the upstream inference-state check active by recording opaque GPU objects by identity in its per-attribute diagnostics. The whole-estimator comparison and production serialization stay unchanged. scikit-learn/scikit-learn#34729 - Routes extra `LogisticRegression.fit` keywords to scikit-learn for callback metadata routing and validation. Fits that only use the existing arguments stay eligible for GPU execution. - Tests metadata consumption through the public API for both `MetadataRequest` and `MetadataRouter`, while retaining the exact request checks on older versions. scikit-learn/scikit-learn#34137 ## Validation Rebuilt cuML locally and ran `test_core.py` and `test_estimator_proxy.py` on an RTX PRO 6000: 392 passed on scikit-learn `1.10.dev0`, and 388 passed on `1.9.1`. Closes #8976
Prerequisite for #34596
One can imagine being more thorough (what if some code does
self.x = list(x), asPipelinedoes?) but it's a start.I went ahead and fixed the relatively small number of failures.