Skip to content
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

Add torchserve #28650

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
47 changes: 47 additions & 0 deletions recipes/torch-model-archiver/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{% set torchserve_version = "0.12.0" %}
# see https://github.com/pytorch/serve/blob/master/model-archiver/model_archiver/version.txt
{% set model_archiver_version = "0.12.0" %}

package:
name: torchserve-model-archiver
version: {{ model_archiver_version }}

source:
url: https://github.com/pytorch/serve/archive/v{{ torchserve_version }}.tar.gz
sha256: d5eb31a540b6a1dea4ead5c8b122d8b7d40b06fe2fc257ba67ed5b071852be0b

build:
noarch: python
script: {{ PYTHON }} -m pip install model-archiver/ -vv
number: 0
entry_points:
- torch-model-archiver = model_archiver.model_packaging:generate_model_archive

requirements:
host:
- python {{ python_min }}
- pip
- setuptools
run:
- python >={{ python_min }}
- enum-compat

test:
commands:
- torch-model-archiver --help
requires:
- python {{ python_min }}

about:
home: https://github.com/pytorch/serve/blob/master/model-archiver/README.md
summary: Creates archives of trained neural net models that can be consumed by TorchServe for inference.
description: |
A key feature of TorchServe is the ability to package all model artifacts into a single model archive file. It is a separate command line interface (CLI), torch-model-archiver, that can take model checkpoints or model definition file with state_dict, and package them into a .mar file. This file can then be redistributed and served by anyone using TorchServe. It takes in the following model artifacts: a model checkpoint file in case of torchscript or a model definition file and a state_dict file in case of eager mode, and other optional assets that may be required to serve the model. The CLI creates a .mar file that TorchServe's server CLI uses to serve the models.
license: Apache-2.0
license_file: LICENSE
doc_url: https://pytorch.org/serve/
dev_url: https://github.com/pytorch/serve

extra:
recipe-maintainers:
- tdsmith
46 changes: 46 additions & 0 deletions recipes/torch-workflow-archiver/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% set torchserve_version = "0.12.0" %}
# see https://github.com/pytorch/serve/blob/master/workflow-archiver/workflow_archiver/version.txt
{% set workflow_archiver_version = "0.2.15" %}

package:
name: torchserve-workflow-archiver
version: {{ workflow_archiver_version }}

source:
url: https://github.com/pytorch/serve/archive/v{{ torchserve_version }}.tar.gz
sha256: d5eb31a540b6a1dea4ead5c8b122d8b7d40b06fe2fc257ba67ed5b071852be0b

build:
noarch: python
script: {{ PYTHON }} -m pip install workflow-archiver/ -vv
number: 0
entry_points:
- torch-workflow-archiver=workflow_archiver.workflow_packaging:generate_workflow_archive

requirements:
host:
- python {{ python_min }}
- pip
- setuptools
run:
- python >={{ python_min }}

test:
commands:
- torch-workflow-archiver --help
requires:
- python {{ python_min }}

about:
home: https://github.com/pytorch/serve/tree/master/workflow-archiver
summary: Creates archives of workflows designed using trained neural net models that can be consumed by TorchServe inference.
description: |
A key feature of TorchServe is the ability to package workflow specification (.yaml) and other workflow dependency files into a single workflow archive file (.war). This file can then be redistributed and served by anyone using TorchServe.
license: Apache-2.0
license_file: LICENSE
doc_url: https://pytorch.org/serve/
dev_url: https://github.com/pytorch/serve

extra:
recipe-maintainers:
- tdsmith
53 changes: 53 additions & 0 deletions recipes/torchserve/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% set version = "0.12.0" %}

package:
name: torchserve
version: {{ version }}

source:
url: https://github.com/pytorch/serve/archive/v{{ version }}.tar.gz
sha256: d5eb31a540b6a1dea4ead5c8b122d8b7d40b06fe2fc257ba67ed5b071852be0b

build:
noarch: python
script: {{ PYTHON }} -m pip install . -vv
number: 0
entry_points:
- torchserve = ts.model_server:start

requirements:
build:
- gradle
# openjdk should be compatible with the gradle version selected in
# https://github.com/pytorch/serve/blob/master/frontend/gradle/wrapper/gradle-wrapper.properties
# see https://docs.gradle.org/current/userguide/compatibility.html
- openjdk <20
host:
- python {{ python_min }}
- pip
- setuptools
- openjdk
run:
- python >={{ python_min }}
- pillow
- psutil

test:
commands:
- torchserve -v
requires:
- python {{ python_min }}

about:
home: https://pytorch.org/serve/
summary: 'Performant, flexible and easy to use tool for serving PyTorch models in production.'
description: |
TorchServe is a performant, flexible and easy to use tool for serving PyTorch models in production.
license: Apache-2.0
license_file: LICENSE
doc_url: https://pytorch.org/serve/
dev_url: https://github.com/pytorch/serve

extra:
recipe-maintainers:
- tdsmith
Loading