mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-20 01:49:51 +00:00
Merge branch 'cc/benchmarks' of github.com:langchain-ai/langchain into cc/benchmarks
This commit is contained in:
commit
87847dd912
15
.github/workflows/check_diffs.yml
vendored
15
.github/workflows/check_diffs.yml
vendored
@ -42,7 +42,6 @@ jobs:
|
|||||||
dependencies: ${{ steps.set-matrix.outputs.dependencies }}
|
dependencies: ${{ steps.set-matrix.outputs.dependencies }}
|
||||||
test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}
|
test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}
|
||||||
test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}
|
test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}
|
||||||
codspeed: ${{ steps.set-matrix.outputs.codspeed }}
|
|
||||||
lint:
|
lint:
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
name: cd ${{ matrix.job-configs.working-directory }}
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
@ -154,20 +153,6 @@ jobs:
|
|||||||
# and `set -e` above will cause the step to fail.
|
# and `set -e` above will cause the step to fail.
|
||||||
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|
||||||
|
|
||||||
codspeed:
|
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
|
||||||
needs: [ build ]
|
|
||||||
if: ${{ needs.build.outputs.codspeed != '[]' }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
job-configs: ${{ fromJson(needs.build.outputs.codspeed) }}
|
|
||||||
fail-fast: false
|
|
||||||
uses: ./.github/workflows/codspeed.yml
|
|
||||||
with:
|
|
||||||
working-directory: ${{ matrix.job-configs.working-directory }}
|
|
||||||
python-version: ${{ matrix.job-configs.python-version }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
ci_success:
|
ci_success:
|
||||||
name: "CI Success"
|
name: "CI Success"
|
||||||
needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]
|
needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]
|
||||||
|
79
.github/workflows/codspeed.yml
vendored
79
.github/workflows/codspeed.yml
vendored
@ -1,56 +1,79 @@
|
|||||||
name: CodSpeed
|
name: CodSpeed
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
push:
|
||||||
inputs:
|
branches:
|
||||||
working-directory:
|
- master
|
||||||
required: true
|
pull_request:
|
||||||
type: string
|
paths:
|
||||||
description: "From which folder this pipeline executes"
|
- 'libs/core/**'
|
||||||
python-version:
|
- 'libs/partners/**'
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
description: "Python version to use"
|
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
|
||||||
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
||||||
|
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
|
||||||
|
AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME }}
|
||||||
|
DEEPSEEK_API_KEY: foo
|
||||||
|
FIREWORKS_API_KEY: foo
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codspeed:
|
prepare_matrix:
|
||||||
name: Run benchmarks
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'run-codspeed-benchmarks') || github.event_name == 'workflow_dispatch'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: "3.12"
|
||||||
|
- id: files
|
||||||
|
uses: Ana06/get-changed-files@v2.3.0
|
||||||
|
- id: set-matrix
|
||||||
|
run: |
|
||||||
|
uv venv
|
||||||
|
uv pip install packaging requests
|
||||||
|
uv run .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
|
||||||
|
outputs:
|
||||||
|
codspeed: ${{ steps.set-matrix.outputs.codspeed }}
|
||||||
|
codspeed:
|
||||||
|
name: Run benchmarks
|
||||||
|
needs: [ prepare_matrix ]
|
||||||
|
if: ${{ needs.prepare_matrix.outputs.codspeed != '[]' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
job-configs: ${{ fromJson(needs.prepare_matrix.outputs.codspeed) }}
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# We have to use 3.12 as 3.13 is not yet supported
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
|
|
||||||
- name: install deps
|
- name: Install dependencies
|
||||||
run: uv sync --group test
|
run: uv sync --group test
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ matrix.job-configs.python-version }}
|
||||||
|
|
||||||
- name: Run benchmarks
|
- name: Run benchmarks
|
||||||
uses: CodSpeedHQ/action@v3
|
uses: CodSpeedHQ/action@v3
|
||||||
env:
|
|
||||||
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
|
|
||||||
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
||||||
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
|
|
||||||
AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME }}
|
|
||||||
DEEPSEEK_API_KEY: foo
|
|
||||||
FIREWORKS_API_KEY: foo
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODSPEED_TOKEN }}
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
cd ${{ inputs.working-directory }}
|
cd ${{ matrix.job-configs.working-directory }}
|
||||||
if [ "${{ inputs.working-directory }}" = "libs/core" ]; then
|
if [ "${{ matrix.job-configs.working-directory }}" = "libs/core" ]; then
|
||||||
uv run --no-sync pytest ./tests/benchmarks --codspeed
|
uv run --no-sync pytest ./tests/benchmarks --codspeed
|
||||||
else
|
else
|
||||||
uv run --no-sync pytest ./tests/ --codspeed
|
uv run --no-sync pytest ./tests/ --codspeed
|
||||||
fi
|
fi
|
||||||
mode: walltime
|
mode: ${{ matrix.job-configs.working-directory == 'libs/core' && 'walltime' || 'instrumentation' }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user