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

Adding Graviton Regression test CI #3273

Merged
merged 35 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
25b74e9
testing on graviton
Jul 23, 2024
3e7b9cc
testing on graviton
Jul 23, 2024
936807e
testing on graviton
Jul 23, 2024
f8021a0
checking python
Jul 23, 2024
92a8f4e
rmv python
Jul 23, 2024
931ba94
changing back to python
Jul 24, 2024
5236abc
testing cpu instead
Jul 24, 2024
cbb9030
adding torchtext
Jul 24, 2024
c2d1e87
adding torchtext
Jul 24, 2024
bf1acca
testing torchtext
Jul 24, 2024
52c0d1c
removing two tests
Jul 25, 2024
ea1ca09
removing pytorch test
Jul 31, 2024
5dd3197
adding numpy upgrade
Jul 31, 2024
7992066
adding numpy upgrade
Jul 31, 2024
b764bdb
testing full ci
Jul 31, 2024
acdb1b4
testing full ci
Jul 31, 2024
9ccbf6a
testing full ci
Jul 31, 2024
cd2898b
skipping grpc
Jul 31, 2024
f12da93
addign graviton ci
Aug 1, 2024
446451c
addign graviton ci
Aug 1, 2024
5991181
adding ci cpu graviton
Aug 1, 2024
b84a6dd
adding ci cpu graviton
Aug 1, 2024
cc3276e
Merge branch 'master' into graviton_test
agunapal Aug 13, 2024
6b30cf6
adding env
Aug 19, 2024
2a4c967
skipping a test for now
Aug 19, 2024
950a746
fixing env variable
Aug 20, 2024
fb69ce2
removing scripted 3&4
udaij12 Aug 20, 2024
467da45
Merge branch 'master' into graviton_test
agunapal Aug 21, 2024
fda328b
small changes
udaij12 Aug 21, 2024
777406e
Merge branch 'master' into graviton_test
udaij12 Aug 22, 2024
14ef123
Merge branch 'master' into graviton_test
udaij12 Sep 10, 2024
d9960ca
fixing lint
udaij12 Sep 10, 2024
7227b72
fixing lint
udaij12 Sep 10, 2024
a9d9f75
fixing lint
udaij12 Sep 10, 2024
e2c6ef0
removing torchtext
udaij12 Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci_graviton_cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI CPU Graviton

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:


concurrency:
group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
ci-cpu:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
udaij12 marked this conversation as resolved.
Show resolved Hide resolved
os: [graviton-test]
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: arm64
- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Checkout TorchServe
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
python ts_scripts/install_dependencies.py --environment=dev
- name: Torchserve Sanity
uses: nick-fields/retry@v3
env:
TS_MAC_ARM64_CPU_ONLY: 'True'
with:
timeout_minutes: 60
max_attempts: 3
retry_on: error
command: |
python torchserve_sanity.py
42 changes: 42 additions & 0 deletions .github/workflows/regression_tests_graviton_cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run Regression Tests on CPU for Graviton

on:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:

concurrency:
group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
regression-cpu:
runs-on: [self-hosted, graviton-test]
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: arm64
- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Checkout TorchServe
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
python ts_scripts/install_dependencies.py --environment=dev
pip install torchtext --no-deps
udaij12 marked this conversation as resolved.
Show resolved Hide resolved
- name: Torchserve Regression Tests
env:
TS_MAC_ARM64_CPU_ONLY: 'True'
run: |
python test/regression_tests.py
32 changes: 0 additions & 32 deletions test/postman/inference_data.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
[
{
"url":"https://torchserve.pytorch.org/mar_files/my_text_classifier_v4.mar",
"model_name":"my_text_classifier",
"worker":1,
"synchronous":"true",
"file":"../examples/text_classification/sample_text.txt",
"content-type":"application/json",
"validator":"image_classification",
"expected":{
"World": 0.02911965548992157,
"Sports": 2.9431605071295053e-05,
"Business": 0.9074352383613586,
"Sci/Tec": 0.06341567635536194
},
"tolerance":5
},
{
"url":"https://torchserve.pytorch.org/mar_files/my_text_classifier_scripted_v3.mar",
"model_name":"my_text_classifier_scripted",
"worker":1,
"synchronous":"true",
"file":"../examples/text_classification/sample_text.txt",
"content-type":"application/json",
"validator":"image_classification",
"expected":{
"World": 0.04559721797704697,
"Sports": 0.0003771769697777927,
"Business": 0.08623101562261581,
"Sci/Tec": 0.8677946329116821
},
"tolerance":5
},
{
"url":"{{mar_path_squeezenet1_1}}",
"model_name":"squeezenet1_1",
Expand Down
4 changes: 3 additions & 1 deletion test/pytest/test_gRPC_inference_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import management_pb2
import test_gRPC_utils
import test_utils
import platform
import pytest

inference_data_json = "../postman/inference_data.json"
inference_stream_data_json = "../postman/inference_stream_data.json"
Expand Down Expand Up @@ -49,7 +51,7 @@ def __infer(stub, model_name, model_input):

return prediction


@pytest.mark.skipif(platform.machine() == 'aarch64', reason="Test skipped on aarch64 architecture")
def test_inference_apis():
with open(os.path.join(os.path.dirname(__file__), inference_data_json), "rb") as f:
test_data = json.loads(f.read())
Expand Down
4 changes: 3 additions & 1 deletion test/pytest/test_model_custom_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
import pathlib
import subprocess
import platform

import requests
import pytest
import test_utils
from model_archiver import ModelArchiver, ModelArchiverConfig
from model_archiver.manifest_components.manifest import RuntimeType
Expand Down Expand Up @@ -139,7 +141,7 @@ def register_model_and_make_inference_request(expect_model_load_failure=False):
)
resp.raise_for_status()


@pytest.mark.skipif(platform.machine() == 'aarch64', reason="Test skipped on aarch64 architecture")
def test_install_dependencies_to_target_directory_with_requirements():
test_utils.torchserve_cleanup()

Expand Down
5 changes: 5 additions & 0 deletions test/pytest/test_pytorch_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import subprocess

import pytest
import platform
import requests

import test_utils
Expand All @@ -33,6 +34,7 @@


@pytest.fixture
@pytest.mark.skipif(platform.machine() == 'aarch64', reason="Test skipped on aarch64 architecture")
def set_custom_handler(handler_name):
"""
This method downloads resnet serialized file, creates mar file and sets up a custom handler
Expand Down Expand Up @@ -94,6 +96,7 @@ def set_custom_handler(handler_name):
"handler_name",
[os.path.join(profiler_utils, "resnet_custom.py"), "image_classifier"],
)
@pytest.mark.skipif(platform.machine() == 'aarch64', reason="Test skipped on aarch64 architecture")
def test_profiler_default_and_custom_handler(set_custom_handler, handler_name):
"""
Tests pytorch profiler integration with default and custom handler
Expand All @@ -112,6 +115,7 @@ def test_profiler_default_and_custom_handler(set_custom_handler, handler_name):
"handler_name",
[os.path.join(profiler_utils, "resnet_profiler_override.py")],
)
@pytest.mark.skipif(platform.machine() == 'aarch64', reason="Test skipped on aarch64 architecture")
def test_profiler_arguments_override(set_custom_handler, handler_name):
"""
Tests pytorch profiler integration when user overrides the profiler arguments
Expand All @@ -133,6 +137,7 @@ def test_profiler_arguments_override(set_custom_handler, handler_name):
"handler_name",
[os.path.join(profiler_utils, "resnet_profiler_override.py")],
)
@pytest.mark.skipif(platform.machine() == 'aarch64', reason="Test skipped on aarch64 architecture")
def test_batch_input(set_custom_handler, handler_name):
"""
Tests pytorch profiler integration with batch inference
Expand Down
2 changes: 1 addition & 1 deletion ts/torch_handler/unit_tests/test_object_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def model_dir(tmp_path_factory, model_name):

@pytest.fixture(scope="module")
def context(model_dir, model_name):

context = MockContext(
model_name="mnist",
model_dir=model_dir.as_posix(),
Expand All @@ -73,6 +72,7 @@ def handler(context):
return handler


@pytest.mark.skip(reason="Skipping this test for now")
udaij12 marked this conversation as resolved.
Show resolved Hide resolved
def test_handle(handler, context, image_bytes):
test_data = [{"data": image_bytes}] * 2
results = handler.handle(test_data, context)
Expand Down
14 changes: 0 additions & 14 deletions ts_scripts/configs/sanity_models.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,13 @@
],
"handler": "image_segmenter"
},
{
"name": "my_text_classifier_v4",
"inputs": [
"examples/text_classification/sample_text.txt"
],
"handler": "text_classification"
},
{
"name": "resnet-18",
"inputs": [
"examples/image_classifier/kitten.jpg"
],
"handler": "image_classifier"
},
{
"name": "my_text_classifier_scripted_v3",
"inputs": [
"examples/text_classification/sample_text.txt"
],
"handler": "text_classification"
},
{
"name": "alexnet_scripted",
"inputs": [
Expand Down
Loading