-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate future package and drop Python2 support #2082
Deprecate future package and drop Python2 support #2082
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2082 +/- ##
==========================================
- Coverage 53.38% 53.36% -0.02%
==========================================
Files 71 71
Lines 3224 3225 +1
Branches 56 56
==========================================
Hits 1721 1721
- Misses 1503 1504 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
b52fc6a
to
c277b98
Compare
@namannandan please also add test log for gpu. |
@@ -127,8 +127,6 @@ public void setEnvelope(String envelope) { | |||
public enum RuntimeType { | |||
@SerializedName("python") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@namannandan Could you please clarify if python here and in subsequent files in java means python3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we drop support for Python 2, would it make sense to consolidate the python runtimes into one and rely on the configuration to figure out the right executable?
serve/frontend/server/src/main/java/org/pytorch/serve/util/messages/EnvironmentUtils.java
Line 63 in 2d1bd26
pythonRuntime = configManager.getPythonExecutable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agunapal here, python
refers to the system default python binary and would not guarantee that it is aliased to a python3
binary. That would depend on how the environment in which Torchserve is running has been set up. In spite of this, I think there may be use-cases where this could be helpful. Please see my comment below and let me know your thoughts.
@mreso yes, that makes sense to me.
Although, I was wondering if a use-case with the following environment would benefit from having support for both python
and python3
runtime options:
python
-> points to the system default python version (say python 3.8)python3
-> points to a more recent release of python3 (say python 3.11)
This could give choice between the different python 3.x releases without having to change what python
points to. Let me know your thoughts on if this is useful. If not, I can go ahead and remove the reference to python3
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@namannandan yeah, I see your point, though it would look like a hacked together solution and not like a feature to me. Making runtimes configurable and extendable would probably be my preference but there is probably little gain for users out of the non-negligible effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the remaining question if we should consolidate runtimes LGTM
@@ -127,8 +127,6 @@ public void setEnvelope(String envelope) { | |||
public enum RuntimeType { | |||
@SerializedName("python") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we drop support for Python 2, would it make sense to consolidate the python runtimes into one and rely on the configuration to figure out the right executable?
serve/frontend/server/src/main/java/org/pytorch/serve/util/messages/EnvironmentUtils.java
Line 63 in 2d1bd26
pythonRuntime = configManager.getPythonExecutable(); |
@@ -58,7 +58,7 @@ torch-model-archiver --model-name densenet161 --version 1.0 --model-file example | |||
$ torch-model-archiver -h | |||
usage: torch-model-archiver [-h] --model-name MODEL_NAME --version MODEL_VERSION_NUMBER | |||
--model-file MODEL_FILE_PATH --serialized-file MODEL_SERIALIZED_PATH | |||
--handler HANDLER [--runtime {python,python2,python3}] | |||
--handler HANDLER [--runtime {python,python3}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a period of time we could just map python3 to python with a deprecation warning and instruction to select executable through config.
Updated summary to include test logs for GPU. |
Will go ahead and merge this PR since it addresses the major concern about removing the |
Description
Remove dependence on the
future
package and references toPython2
in order to resolve security vulnerabilities.Unregister
resnet-18
model after testing load from snapshot in sanity test to avoid subsequent sanity runs from failing.Fixes #(2063)
Type of change
Feature/Issue validation/testing
CPU: cpu_sanity_log.txt
GPU: gpu_sanity_log.txt
CPU: cpu_regression_log.txt
GPU: gpu_regression_log.txt
CPU: cpu_benchmark_log.txt
GPU: gpu_benchmark_log.txt
Build and install torchserve conda binaries resulting in the following conda environment:
CPU: cpu_conda_bin_sanity_log.txt
GPU: gpu_conda_bin_sanity_log.txt
The conda packages were verified by running the
test_torchserve
,test_modelarchiver
,test_workflow_archiver
,test_sanity
andtest_workflow_sanity
methods in the torchserve_sanity scriptChecklist: