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

Add gen reg tests #689

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
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
24 changes: 19 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Continuous integration
on:
push:
branches:
- main
- main
paths-ignore:
- '**.md'
- 'CITATION.cff'
Expand All @@ -12,7 +12,7 @@ on:
- 'docs/**'
pull_request:
branches:
- main
- main
paths-ignore:
- '**.md'
- 'CITATION.cff'
Expand All @@ -29,8 +29,9 @@ on:
type: string

env:
REVISION_REFERENCE: v2.8.2
REVISION_REFERENCE: v2.14.0
#9d31b2ec4df6d8228f370ff20c8267ec6ba39383 earliest compatible v2.7.0 + pretrained_hf param
GEN_REVISION_REFERENCE: 7b8dd2cbaf9cca13ca5b1defa6a321a145eb166c

jobs:
Tests:
Expand Down Expand Up @@ -79,17 +80,30 @@ jobs:
--splitting-algorithm least_duration \
--splits ${{ matrix.job_num }} \
--group ${{ matrix.job }} \
-m regression_test \
-m "regression_test" \
tests \
| head -n -2 | grep -Po 'test_inference_with_data\[\K[^]]*(?=-False]|-True])' \
> models_gh_runner.txt
python -m pytest \
--quiet --co \
--splitting-algorithm least_duration \
--splits ${{ matrix.job_num }} \
--group ${{ matrix.job }} \
-m "generative_regression_test" \
tests \
| head -n -2 | grep -Po 'test_generative_with_data\[\K[^]]*' \
> generative_models_gh_runner.txt
if [ -n "${{ inputs.manual_revision_reference }}" ]; then
REVISION_REFERENCE=${{ inputs.manual_revision_reference }}
fi
python tests/util_test.py \
--save_model_list models_gh_runner.txt \
--model_list models_gh_runner.txt \
--git_revision $REVISION_REFERENCE
python tests/util_test.py \
--save_model_list generative_models_gh_runner.txt \
--generative_model_list generative_models_gh_runner.txt \
--git_revision $GEN_REVISION_REFERENCE
- name: Unit tests
run: |
source .env/bin/activate
Expand All @@ -113,7 +127,7 @@ jobs:
--store-durations \
--durations-path durations_2 \
--clean-durations \
-m "regression_test" \
-m "regression_test and generative_regression_test" \
tests
jq -s -S 'add' durations_* > .test_durations
- name: Collect pytest durations
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[pytest]
markers =
regression_test
generative_regression_test
2 changes: 1 addition & 1 deletion src/open_clip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .coca_model import CoCa
from .constants import OPENAI_DATASET_MEAN, OPENAI_DATASET_STD
from .factory import create_model, create_model_and_transforms, create_model_from_pretrained, get_tokenizer, create_loss
from .factory import list_models, add_model_config, get_model_config, load_checkpoint
from .factory import list_models, list_generative_models, add_model_config, get_model_config, load_checkpoint
from .loss import ClipLoss, DistillClipLoss, CoCaLoss
from .model import CLIP, CustomTextCLIP, CLIPTextCfg, CLIPVisionCfg, \
convert_weights_to_lp, convert_weights_to_fp16, trace_model, get_cast_dtype, get_input_dtype, \
Expand Down
Loading
Loading