Skip to content

Commit ba0ec6c

Browse files
Merge branch 'instructlab:main' into add-longbench
2 parents 00b7c89 + e57265b commit ba0ec6c

File tree

10 files changed

+116
-23
lines changed

10 files changed

+116
-23
lines changed

.github/workflows/e2e-nvidia-l4-x1.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,38 @@ jobs:
112112
working-directory: ./instructlab
113113
run: |
114114
export CUDA_HOME="/usr/local/cuda"
115-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
115+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
116116
export PATH="$PATH:$CUDA_HOME/bin"
117117
python3.11 -m venv --upgrade-deps venv
118118
. venv/bin/activate
119119
nvidia-smi
120120
python3.11 -m pip cache remove llama_cpp_python
121121
122-
CMAKE_ARGS="-DLLAMA_CUDA=on" python3.11 -m pip install -v .
122+
pip_install="python3.11 -m pip install -v -c constraints-dev.txt"
123123
124-
# https://github.com/instructlab/instructlab/issues/1821
125-
# install with Torch and build dependencies installed
126-
python3.11 -m pip install -v packaging wheel setuptools-scm
127-
python3.11 -m pip install -v .[cuda] -r requirements-vllm-cuda.txt
124+
pip_install="python3.11 -m pip install -v -c constraints-dev.txt"
125+
126+
# pre-install some build dependencies
127+
$pip_install packaging wheel setuptools-scm
128+
129+
# flash-attn has a bug in the setup.py that causes pip to attempt installing it
130+
# before torch is installed. This is a bug because their setup.py depends on
131+
# importing the module, so it should have been listed in build_requires. Alas!
132+
#
133+
# See: https://github.com/Dao-AILab/flash-attention/pull/958
134+
# Also: https://github.com/instructlab/instructlab/issues/1821
135+
#
136+
# first, pre-install flash-attn build dependencies
137+
$pip_install torch packaging setuptools wheel psutil ninja
138+
139+
# now build flash-attn using the pre-installed build dependencies; this will
140+
# guarantee that the build version of torch will match the runtime version of
141+
# torch; otherwise, all kinds of problems may occur, like missing symbols when
142+
# accessing C extensions and such
143+
$pip_install flash-attn --no-build-isolation
144+
145+
CMAKE_ARGS="-DGGML_CUDA=on" $pip_install .
146+
$pip_install .[cuda] -r requirements-vllm-cuda.txt
128147
129148
- name: Update instructlab-eval library
130149
working-directory: ./eval

.github/workflows/e2e-nvidia-l40s-x4.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,36 @@ jobs:
143143
working-directory: ./instructlab
144144
run: |
145145
export CUDA_HOME="/usr/local/cuda"
146-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
146+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
147147
export PATH="$PATH:$CUDA_HOME/bin"
148148
python3.11 -m venv --upgrade-deps venv
149149
. venv/bin/activate
150150
nvidia-smi
151151
python3.11 -m pip cache remove llama_cpp_python
152152
153-
CMAKE_ARGS="-DLLAMA_CUDA=on" python3.11 -m pip install .
154-
155-
# https://github.com/instructlab/instructlab/issues/1821
156-
# install with Torch and build dependencies installed
157-
python3.11 -m pip install packaging wheel setuptools-scm
158-
python3.11 -m pip install .[cuda] -r requirements-vllm-cuda.txt
153+
pip_install="python3.11 -m pip install -v -c constraints-dev.txt"
154+
155+
# pre-install some build dependencies
156+
$pip_install packaging wheel setuptools-scm
157+
158+
# flash-attn has a bug in the setup.py that causes pip to attempt installing it
159+
# before torch is installed. This is a bug because their setup.py depends on
160+
# importing the module, so it should have been listed in build_requires. Alas!
161+
#
162+
# See: https://github.com/Dao-AILab/flash-attention/pull/958
163+
# Also: https://github.com/instructlab/instructlab/issues/1821
164+
#
165+
# first, pre-install flash-attn build dependencies
166+
$pip_install torch packaging setuptools wheel psutil ninja
167+
168+
# now build flash-attn using the pre-installed build dependencies; this will
169+
# guarantee that the build version of torch will match the runtime version of
170+
# torch; otherwise, all kinds of problems may occur, like missing symbols when
171+
# accessing C extensions and such
172+
$pip_install flash-attn --no-build-isolation
173+
174+
CMAKE_ARGS="-DGGML_CUDA=on" $pip_install .
175+
$pip_install .[cuda] -r requirements-vllm-cuda.txt
159176
160177
- name: Update instructlab-eval library
161178
working-directory: ./eval

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
uses: ./.github/actions/free-disk-space
7373

7474
- name: Setup Python 3.11
75-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
75+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
7676
with:
7777
python-version: 3.11
7878
cache: pip

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
python:
48-
- "3.10"
4948
- "3.11"
5049
platform:
5150
- "ubuntu-latest"
@@ -79,7 +78,7 @@ jobs:
7978
brew install expect coreutils bash
8079
8180
- name: Setup Python ${{ matrix.python }}
82-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
81+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
8382
with:
8483
python-version: ${{ matrix.python }}
8584
cache: pip

.markdownlint-cli2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config:
77
code-block-style: false
88
no-duplicate-header: false
99
single-trailing-newline: false
10+
descriptive-link-text: false
1011
globs:
1112
- "**/*.md"
1213
ignores:

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ persistent=yes
9090

9191
# Minimum Python version to use for version dependent checks. Will default to
9292
# the version used to run pylint.
93-
py-version=3.10
93+
py-version=3.11
9494

9595
# Discover python modules and packages in the file system subtree.
9696
recursive=no

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ A teacher model is used to generate new multiple choice questions based on the k
9090

9191
## Development
9292

93-
> **⚠️ Note:** Must use Python version 3.10 or later.
93+
> **⚠️ Note:** Must use Python version 3.11 or later.
9494
9595
### Set up your dev environment
9696

9797
The following tools are required:
9898

9999
- [`git`](https://git-scm.com)
100-
- [`python`](https://www.python.org) (v3.10 or v3.11)
100+
- [`python`](https://www.python.org) (v3.11)
101101
- [`pip`](https://pypi.org/project/pip/) (v23.0+)
102102
- [`bash`](https://www.gnu.org/software/bash/) (v5+, for functional tests)
103103

docs/ci.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CI for InstructLab Eval
2+
3+
Before running any testing locally, ensure you have run `pip install -r requirements-dev.txt` in your environment.
4+
5+
## Unit tests
6+
7+
Unit tests are designed to test specific Eval components or features in isolation. Generally, new code should be adding or modifying unit tests.
8+
9+
All unit tests currently live in the `tests/` directory and are run with [pytest](https://docs.pytest.org/) via [tox](https://tox.wiki/).
10+
11+
To run the unit tests, you can run `tox -e unit` or `tox -e unitcov` if you want to generate coverage metrics as well.
12+
13+
In CI, the tests are run with Python 3.10 - 3.11 on Ubuntu and MacOS runners - you can see the details [here](https://github.com/instructlab/eval/blob/main/.github/workflows/test.yml)
14+
15+
## Functional tests
16+
17+
Functional tests are designed to test Eval components or features in tandem, but not necessarily as part of a complex workflow. New code may or may not need a functional test but should strive to implement one if possible.
18+
19+
The functional test script is Shell-based and can be found at `scripts/functional-tests.sh`.
20+
21+
To run the functional tests, you can run `tox -e functional`.
22+
23+
In CI, the tests are run with Python 3.10 - 3.11 on Ubuntu and MacOS runners - you can see the details [here](https://github.com/instructlab/eval/blob/main/.github/workflows/test.yml)
24+
25+
## End-to-end (E2E) tests
26+
27+
InstructLab Eval has several end-to-end jobs that run to ensure compatibility with the [InstructLab Core](https://github.com/instructlab/instructlab) project.
28+
You can see details about the types of jobs being run in the matrix below.
29+
30+
For more details about the E2E scripts themselves, see [the InstructLab Core documentation](https://github.com/instructlab/instructlab/blob/main/docs/maintainers/ci.md#end-to-end-e2e-tests).
31+
32+
### Current E2E Jobs
33+
34+
| Name | T-Shirt Size | Runner Host | Instance Type | OS | GPU Type | Script | Flags | Runs when? | Slack/Discord reporting? |
35+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
36+
| [`e2e-nvidia-l4-x1.yml`](https://github.com/instructlab/sdg/blob/main/.github/workflows/e2e-nvidia-l4-x1.yml) | Medium | AWS |[`g6.8xlarge`](https://aws.amazon.com/ec2/instance-types/g5/) | CentOS Stream 9 | 1 x NVIDIA L4 w/ 24 GB VRAM | `e2e-ci.sh` | `m` | Pull Requests, Push to `main` or `release-*` branch | No |
37+
| [`e2e-nvidia-l40s-x4.yml`](https://github.com/instructlab/sdg/blob/main/.github/workflows/e2e-nvidia-l40s-x4.yml) | Large | AWS |[`g6e.12xlarge`](https://aws.amazon.com/ec2/instance-types/g6e/) | CentOS Stream 9 | 4 x NVIDIA L40S w/ 48 GB VRAM (192 GB) | `e2e-ci.sh` | `l` | Manually by Maintainers, Automatically against `main` branch at 4PM UTC | Yes |
38+
39+
### Discord/Slack reporting
40+
41+
Some E2E jobs send their results to the channel `#e2e-ci-results` via the `Son of Jeeves` bot in both Discord and Slack. You can see which jobs currently have reporting via the "Current E2E Jobs" table above.
42+
43+
In Slack, this has been implemented via [the official Slack GitHub Action](https://github.com/slackapi/slack-github-action?tab=readme-ov-file#technique-2-slack-app).
44+
In Discord, we use [actions/actions-status-discord](https://github.com/sarisia/actions-status-discord) and the built-in channel webhooks feature.
45+
46+
### Triggering an E2E job via GitHub Web UI
47+
48+
For the E2E jobs that can be launched manually, they take an input field that
49+
specifies the PR number or git branch to run them against. If you run them
50+
against a PR, they will automatically post a comment to the PR when the tests
51+
begin and end so it's easier for those involved in the PR to follow the results.
52+
53+
1. Visit the [Actions tab](https://github.com/instructlab/eval/actions).
54+
2. Click on one of the E2E workflows on the left side of the page.
55+
3. Click on the `Run workflow` button on the right side of the page.
56+
4. Enter a branch name or a PR number in the input field.
57+
5. Click the green `Run workflow` button.
58+
59+
> [!NOTE]
60+
> Only users with "Write" permissions to the repo can run CI jobs manually

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors = [
1212
description = "Evaluation"
1313
readme = "README.md"
1414
license = {text = "Apache-2.0"}
15-
requires-python = ">=3.9"
15+
requires-python = ">=3.11"
1616
classifiers = [
1717
"Development Status :: 3 - Alpha",
1818
"Environment :: Console",
@@ -22,8 +22,6 @@ classifiers = [
2222
"Operating System :: POSIX :: Linux",
2323
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2424
"Programming Language :: Python :: 3",
25-
"Programming Language :: Python :: 3.9",
26-
"Programming Language :: Python :: 3.10",
2725
"Programming Language :: Python :: 3.11",
2826
"Programming Language :: Python :: 3.12",
2927
"Programming Language :: Python :: Implementation :: CPython",

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,3 @@ passenv =
103103
[gh]
104104
python =
105105
3.11 = py311-{unitcov, functional}
106-
3.10 = py310-{unitcov, functional}

0 commit comments

Comments
 (0)