From 8e10a29955c37923ab13363968990ff03fda2722 Mon Sep 17 00:00:00 2001 From: yizhuoz004 Date: Wed, 14 Aug 2024 20:03:35 -0700 Subject: [PATCH] Add tripy L0 CI yml Signed-off-by: yizhuoz004 --- .github/workflows/tripy-l0.yml | 49 +++++++++++++++++++++++ tripy/tripy/frontend/trace/ops/storage.py | 1 - 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tripy-l0.yml diff --git a/.github/workflows/tripy-l0.yml b/.github/workflows/tripy-l0.yml new file mode 100644 index 000000000..ee7513634 --- /dev/null +++ b/.github/workflows/tripy-l0.yml @@ -0,0 +1,49 @@ +name: Tripy CI + +on: + pull_request: + branches: + - main + paths: ['tripy/**'] + +env: + DEFAULT_IMAGE: ghcr.io/nvidia/tensorrt-incubator/tripy + NEW_TEST_IMAGE: test-image:latest + + +jobs: + tripy-l0: + runs-on: tripy-self-hosted + + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + new_container: + - 'tripy/Dockerfile' + - 'tripy/pyproject.toml' + + - if: steps.filter.outputs.new_container == 'true' + run: echo "l0_image=${{ env.NEW_TEST_IMAGE }}" >> "$GITHUB_ENV" + - if: steps.filter.outputs.new_container != 'true' + run: echo "l0_image=${{ env.DEFAULT_IMAGE }}" >> "$GITHUB_ENV" + - run: echo "Tests will run in $l0_image" + + - name: build-new-container + if: steps.filter.outputs.new_container == 'true' + uses: docker/build-push-action@v6 + with: + context: tripy/ + tags: ${{ env.NEW_TEST_IMAGE }} + push: false + + - name: run-test + uses: addnab/docker-run-action@v3 + with: + image: ${{ env.l0_image }} + options: --gpus all -v ${{ github.workspace }}:/tripy + run: | + cd tripy + pytest -v -m "l0 or not l1" diff --git a/tripy/tripy/frontend/trace/ops/storage.py b/tripy/tripy/frontend/trace/ops/storage.py index d8aa0748e..abe23871a 100644 --- a/tripy/tripy/frontend/trace/ops/storage.py +++ b/tripy/tripy/frontend/trace/ops/storage.py @@ -59,7 +59,6 @@ def infer_rank(self): self.outputs[0].rank = len(self.shape) def infer_devices(self): - # This is different from self.device # Constants are always on device when executed by mlir self.outputs[0].device = tripy.common.device("gpu")