[SPARK-53453][PYTHON][ML] Unblock 'torch<2.6.0'#52197
[SPARK-53453][PYTHON][ML] Unblock 'torch<2.6.0'#52197zhengruifeng wants to merge 6 commits intoapache:masterfrom
Conversation
| RUN python3.11 -m pip install --ignore-installed blinker>=1.6.2 # mlflow needs this | ||
| RUN python3.11 -m pip install $BASIC_PIP_PKGS unittest-xml-reporting $CONNECT_PIP_PKGS && \ | ||
| python3.11 -m pip install 'torch<2.6.0' torchvision --index-url https://download.pytorch.org/whl/cpu && \ | ||
| python3.11 -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && \ |
There was a problem hiding this comment.
Do other Dockerfiles need to be handled in separate pr?
LuciferYang
left a comment
There was a problem hiding this comment.
The changes are fine with me.
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Nice. Thank you, @zhengruifeng and all.
Merged to master for Apache Spark 4.1.0.
| import torch | ||
|
|
||
| lor_torch_model = torch.load(path) | ||
| lor_torch_model = torch.load(path, weights_only=False) |
There was a problem hiding this comment.
do we need to have the weights_only=False . From there page "Loading un-trusted checkpoint with weights_only=False MUST never be done." https://github.com/pytorch/pytorch/security
There was a problem hiding this comment.
The default value of weights_only is False in <2.6.0. And the default value was changed to True since 2.6.0.
This PR keeps the behavior.
Ideally, we should use weights_only=True, it will needs some investigation. Thanks for pointing it out.
| # test saved torch model can be loaded by pytorch solely | ||
| lor_torch_model = torch.load( | ||
| os.path.join(local_model_path, "LogisticRegressionModel.torch") | ||
| os.path.join(local_model_path, "LogisticRegressionModel.torch"), |
There was a problem hiding this comment.
dito but this is for a tests so I think its ok.
### What changes were proposed in this pull request? Update `dev/requirements` ### Why are the changes needed? follow up of #52197 ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? ci ### Was this patch authored or co-authored using generative AI tooling? no Closes #52244 from zhengruifeng/dev_torch. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
### What changes were proposed in this pull request? Unblock 'torch<2.6.0' ### Why are the changes needed? to test with latest torch ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? CI ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#52197 from zhengruifeng/torch_280. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
### What changes were proposed in this pull request? Update `dev/requirements` ### Why are the changes needed? follow up of apache#52197 ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? ci ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#52244 from zhengruifeng/dev_torch. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
What changes were proposed in this pull request?
Unblock 'torch<2.6.0'
Why are the changes needed?
to test with latest torch
Does this PR introduce any user-facing change?
No
How was this patch tested?
CI
Was this patch authored or co-authored using generative AI tooling?
No