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

[tests] add transformers & diffusers integration tests #962

Merged
merged 5 commits into from
Sep 26, 2023
Merged
Changes from 3 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
94 changes: 94 additions & 0 deletions .github/workflows/integrations_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: integration tests

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to test on'
required: true
pytorch_nightly:
description: 'Whether to test integration tests (diffusers + transformers)'
required: false
default: false
Copy link
Member

Choose a reason for hiding this comment

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

This parameter is not being used, is it? Also, description and parameter name don't fit each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, I have simply removed it here


jobs:
run_transformers_integration_tests_main:
runs-on: ubuntu-latest
Copy link

Choose a reason for hiding this comment

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

is this powerful enough to run those peft tests?

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "setup.py"
- name: print environment variables
run: |
echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
echo "env.CI_SHA = ${{ env.CI_SHA }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
cd .. && git clone https://github.com/huggingface/transformers.git && cd transformers/ && git log
python -m pip install ".[dev]"
Copy link

Choose a reason for hiding this comment

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

it would be great to print the transformers version (commit sha) here - it will make your life easier :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it together with printing env variables

Copy link
Member

Choose a reason for hiding this comment

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

I think Yih-Dar meant the SHA of the transformers branch, not of PEFT. It is contained in the git log but I'm not sure that it's the best way to print the hash. It's an interactive command with user input, not sure how GH actions handle those. How about git rev-parse HEAD?


- name: Test transformers integration
run: |
RUN_SLOW=1 pytest tests/peft_integration/test_peft_integration.py
run_transformers_integration_tests_release:
Copy link
Member

Choose a reason for hiding this comment

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

How is it controlled that this uses the release, not the latest main? I couldn't find that in the config.

Also, there is a lot of duplication with the previous task, depending on how they differ, it might be better to turn this into a test matrix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How is it controlled that this uses the release, not the latest main? I couldn't find that in the config.

for run_transformers_integration_tests_release I skip the install from main part of the workflow

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see, thx. So that should be pretty easy to integrate into a test matrix, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so yes, let me give it a try

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "setup.py"
- name: print environment variables
run: |
echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
echo "env.CI_SHA = ${{ env.CI_SHA }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
cd .. && git clone https://github.com/huggingface/transformers.git && cd transformers/ && git log

- name: Test transformers integration
run: |
RUN_SLOW=1 pytest tests/peft_integration/test_peft_integration.py
run_diffusers_integration_tests_main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "setup.py"
- name: print environment variables
run: |
echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
echo "env.CI_SHA = ${{ env.CI_SHA }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
cd .. && git clone https://github.com/huggingface/diffusers.git && cd diffusers/ && git log
python -m pip install ".[dev]"

- name: Test diffusers integration
run: |
pytest tests/lora/test_lora_layers_peft.py