From 1898c8cf7df60f59d73b961947fd0a0f08dece5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Wed, 25 Sep 2024 21:45:57 +0545 Subject: [PATCH] benchmark imagenet --- .github/workflows/benchmarks.yaml | 50 ++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/benchmarks.yaml b/.github/workflows/benchmarks.yaml index ba7fb2601b..1a7141b7c7 100644 --- a/.github/workflows/benchmarks.yaml +++ b/.github/workflows/benchmarks.yaml @@ -12,33 +12,47 @@ env: jobs: bench: name: run benchmarks - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/setup-python@v5 with: python-version: "3.12" + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: astral-sh/setup-uv@v3 with: enable-cache: true cache-dependency-glob: pyproject.toml - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.sha }} - fetch-depth: 0 + - if: runner.os == 'macos' + run: | + brew install gtime + echo "time=gtime" >> "$GITHUB_ENV" - - run: uv pip install '.[tests]' --system - - name: run benchmarks on base branch - run: pytest --benchmark-autosave dvc/testing/benchmarks/ -k 'test_init or test_help' + - if: runner.os != 'macos' + run: echo "time=time" >> "$GITHUB_ENV" - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - clean: false - - run: uv pip install '.[tests]' --system - - name: run benchmarks for PR - run: > - pytest --benchmark-compare --benchmark-compare-fail=min:5% - --benchmark-group-by name - dvc/testing/benchmarks/ -k 'test_init or test_help' + - run: uv pip install '.[dev]' --system + - run: curl -O https://image-net.org/data/bboxes_annotations.tar.gz + - run: tar zxvf bboxes_annotations.tar.gz + - run: rm bboxes_annotations.tar.gz + - run: | + for file in ./*.tar.gz; do + tar zxvf $file + done + shell: bash + - run: rm ./*.tar.gz + shell: bash + - run: '"$(which ${time})" -v dvc add Annotation/' + shell: bash + - run: cat ./*.dvc + shell: bash + - run: '"$(which ${time})" -v dvc add Annotation/' + shell: bash