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

ci: Add GitHub action for core build and python testing in pull requests #416

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build And Test

on:
pull_request:
branches:
- main
types: [synchronize, opened, reopened, ready_for_review]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Essentially to skip running action when PR is a draft



jobs:
test:
runs-on: ubuntu-latest
container:
image: nvcr.io/nvidia/tritonserver:24.10-py3
volumes:
- ${{ github.workspace }}:/core

steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
apt update
apt install -y --no-install-recommends clang-format-15 cmake libb64-dev rapidjson-dev libre2-dev
wget -O /tmp/boost.tar.gz https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.gz && (cd /tmp && tar xzf boost.tar.gz) && mv /tmp/boost_1_80_0/boost /usr/include/boost
pip install build pytest

- name: Build
run: |
mkdir -p /core/build
cd /core/build
cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install -DTRITON_CORE_HEADERS_ONLY=OFF ..
export TRITON_PYBIND="_c/triton_bindings.cpython-310-x86_64-linux-gnu.so"
make -j8

- name: Run tests with pytest
run: |
cd /core
python3 -m pip install --force-reinstall build/python/generic/wheel/dist/tritonserver-*.whl
pytest python/test -v
6 changes: 1 addition & 5 deletions python/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,7 @@ def test_stop(self):
{
"backend": "python",
"parameters": {"decoupled": {"string_value": "False"}},
# Keep instance count low for fast startup/cleanup.
# Alternatively can use KIND_CPU here, but keeping gpus/count explicit.
"instance_group": [
{"kind": "KIND_GPU", "gpus": [0], "count": 1}
],
"instance_group": [{"kind": "KIND_CPU"}],
}
)
},
Expand Down
2 changes: 1 addition & 1 deletion src/test/input_byte_size_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ TEST_F(InputByteSizeTest, InputByteSizeLarge)
"setting request release callback");

// Define input shape and data
size_t element_cnt = (1LL << 31) / sizeof(float);
int64_t element_cnt = (1LL << 31) / sizeof(float);
std::vector<int64_t> shape{1, element_cnt};
std::vector<float> input_data(element_cnt, 1);
const auto input0_byte_size = sizeof(input_data[0]) * input_data.size();
Expand Down