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

[sharktank] Extend to test with Python 3.12 #693

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 15 additions & 6 deletions .github/workflows/ci-sharktank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ jobs:
name: "Unit Tests and Type Checking"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename to just "Unit Tests" or "Test" so more of the matrix shows up in the UI

image

Could also qualify "torch {{ matrix.torch-version }}"

Here's a mock-up to show where the text gets cut off:
image

Copy link
Member Author

Choose a reason for hiding this comment

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

I renamed to "Unit Tests" for now but we probably want to harmonize this more across different workflows in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Nice. Definitely better now. Could still include "torch" next to the torch version but it might be obvious enough to some people.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed to "Unit Tests :: ${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.torch-version }}" as for Windows it was (windows-2022, 3.11, 2.3.0) and now have the same order for all jobs. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, the ordering helps too. I think having two versions right next to each other can be confusing unless you are very familiar with Python and PyTorch versions. I personally have to unpack 3.11, 2.4.1 and think for a second, compared to 3.11, torch 2.4.1. We don't have many characters to spare in the UI though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Save another character but we should aim to harmonize the naming in a follow up.

strategy:
matrix:
version: [3.11]
os: [ubuntu-24.04, windows-2022]
python-version: ["3.11", "3.12"]
torch-version: ["2.3.0+cpu", "2.4.1+cpu", "2.5.1+cpu"]
os: [ubuntu-24.04]
include:
- os: windows-2022
python-version: "3.11"
torch-version: "2.3.0+cpu"
exclude:
- python-version: "3.12"
# `torch.compile` requires torch>=2.4.0 for Python 3.12+
torch-version: "2.3.0+cpu"
fail-fast: false
runs-on: ${{matrix.os}}
defaults:
Expand All @@ -42,7 +51,7 @@ jobs:
id: setup_python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{matrix.version}}
python-version: ${{matrix.python-version}}

- name: Cache Pip Packages
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
Expand All @@ -57,7 +66,7 @@ jobs:
# Note: We install in three steps in order to satisfy requirements
# from non default locations first. Installing the PyTorch CPU
# wheels saves multiple minutes and a lot of bandwidth on runner setup.
pip install --no-compile -r pytorch-cpu-requirements.txt
pip install --no-compile --pre --index-url https://download.pytorch.org/whl/test/cpu torch==${{matrix.torch-version}}
pip install --no-compile -r requirements.txt -r sharktank/requirements-tests.txt -e sharktank/

# Install nightly IREE packages.
Expand All @@ -77,7 +86,7 @@ jobs:
name: "Data-dependent Tests"
strategy:
matrix:
version: [3.11]
python-version: [3.11]
runs-on: [llama-mi300x-3]
fail-fast: false
runs-on: ${{matrix.runs-on}}
Expand All @@ -94,7 +103,7 @@ jobs:
id: setup_python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{matrix.version}}
python-version: ${{matrix.python-version}}

- name: Create Python venv
run: python -m venv ${VENV_DIR}
Expand Down
4 changes: 4 additions & 0 deletions sharktank/tests/layers/paged_llama_attention_block_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ def forward(self, h, seq_block_ids, cache_state):
torch.__version__ >= (2, 4),
reason="https://github.com/nod-ai/shark-ai/issues/684",
)
@pytest.mark.skipif(
torch.__version__ >= (2, 5),
reason="https://github.com/nod-ai/shark-ai/issues/684, error slows down CI",
)
def testExportNondecomposed(self):
dtype = torch.float32

Expand Down
Loading