Skip to content

Commit d1d3955

Browse files
docs: document how to build a dev environment with poetry and tox
Signed-off-by: Vassilis Vassiliadis <vassilis.vassiliadis@ibm.com>
1 parent 02bf84c commit d1d3955

3 files changed

Lines changed: 23 additions & 40 deletions

File tree

CONTRIBUTING.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,31 @@ The following tools are required:
8282
- [git](https://git-scm.com)
8383
- [python](https://www.python.org) (v3.8+)
8484
- [pip](https://pypi.org/project/pip/) (v23.0+)
85+
- [poetry](https://python-poetry.org/docs/#installation) (v1.8.3+)
86+
- Poetry should always be installed in a dedicated virtual environment to isolate it from the rest of your system. It should in no case be installed in the environment of the project that is to be managed by Poetry. This ensures that Poetry’s own dependencies will not be accidentally upgraded or uninstalled.
87+
- [tox](https://tox.wiki/en/4.15.1/installation.html) (v4.15.1+)
88+
- Just like `poetry` install `tox` in an isolated virtual environment
8589

8690
Installation:
87-
```
88-
pip install -U datasets
89-
pip install -e .
91+
92+
```bash
93+
: Install poetry and tox in an isolated virtual environment
94+
python3 -m venv isolated
95+
./isolated/bin/pip install -U pip setuptools
96+
./isolated/bin/pip install poetry tox
97+
98+
: Ensure you can access poetry and tox without activating the
99+
: the isolated virtual environment
100+
export PATH=$PATH:`pwd`/isolated/bin
101+
102+
: Create your development virtual environment
103+
python3 -m venv venv
104+
. venv/bin/activate
105+
106+
: Install a dev version (similar to pip -e ".[dev]") of fms-hf-tuning
107+
poetry install --with dev
90108
```
109+
91110
<details>
92111
<summary>Linting</summary>
93112

README.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ This repo provides basic tuning scripts with support for specific models. The re
77

88
## Installation
99

10-
11-
### Most recent versions of python dependencies
12-
13-
If you want to use the most recent versions of python dependencies then use `pip`.
14-
1510
```
1611
pip install -e .
1712
```
@@ -34,37 +29,6 @@ pip install -e ".[fms-accel]"
3429
```
3530
`fms-acceleration` is a collection of plugins that packages that accelerate fine-tuning / training of large models, as part of the `fms-hf-tuning` suite. For more details on see [this section below](#fms-acceleration).
3631

37-
38-
### Using versions of python dependencies that are known to be compatible with fms-hf-tuning
39-
40-
This repository uses [`poetry`](https://python-poetry.org/) for reproducible builds. You can use poetry to create the same virtual environment that we use for our CI/CD tests like so:
41-
42-
```
43-
python -m venv venv
44-
. ./venv/bin/activate
45-
pip install poetry
46-
47-
poetry install
48-
```
49-
50-
> Note: After installing, if you wish to use [FlashAttention](https://github.com/Dao-AILab/flash-attention), then you need to install these requirements:
51-
52-
```
53-
poetry install --with dev,flash-attn
54-
```
55-
56-
If you wish to use [aim](https://github.com/aimhubio/aim), then you need to install it:
57-
```
58-
poetry install --with aim
59-
```
60-
61-
If you wish to use [fms-acceleration](https://github.com/foundation-model-stack/fms-acceleration), you need to install it.
62-
```
63-
poetry install --with fms-accel
64-
```
65-
`fms-acceleration` is a collection of plugins that packages that accelerate fine-tuning / training of large models, as part of the `fms-hf-tuning` suite. For more details on see [this section below](#fms-acceleration).
66-
67-
6832
## Data format
6933
We support two data formats:
7034

build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building fms-hf-tuning as an Image
22

3-
The Dockerfile provides a way of running fms-hf-tuning SFT Trainer. It installs the dependencies needed and adds two additional scripts that helps to parse arguments to pass to SFT Trainer. The accelerate_launch.py script is run by default when running the image to trigger SFT trainer for single or multi GPU by parsing arguments and running `accelerate launch launch_training.py`.
3+
The Dockerfile provides a way of running fms-hf-tuning SFT Trainer. It installs the dependencies needed and adds two additional scripts that helps to parse arguments to pass to SFT Trainer. The `accelerate_launch.py` script is run by default when running the image to trigger SFT trainer for single or multi GPU by parsing arguments and running `accelerate launch launch_training.py`.
44

55
## Configuration
66

0 commit comments

Comments
 (0)