diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4df74d20f..e22ee76fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,7 +78,6 @@ The following tools are required: Installation: ``` -pip install -r requirements.txt pip install -U datasets pip install -e . ``` diff --git a/README.md b/README.md index ac7693fbe..ca62fa1e3 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,15 @@ This repo provides basic tuning scripts with support for specific models. The re ## Installation ``` -pip install -r requirements.txt -pip install -U datasets pip install -e . ``` -> Note: If you wish to use [FlashAttention](https://github.com/Dao-AILab/flash-attention), then you need to install these requirements: `pip install -r flashattn_requirements`. [FlashAttention](https://github.com/Dao-AILab/flash-attention) requires the [CUDA Toolit](https://developer.nvidia.com/cuda-toolkit) to be pre-installed. +> Note: After installing, if you wish to use [FlashAttention](https://github.com/Dao-AILab/flash-attention), then you need to install these requirements: +''' +pip install -e ".[dev]" +pip install -e ".[flash-attn]" +``` +[FlashAttention](https://github.com/Dao-AILab/flash-attention) requires the [CUDA Toolit](https://developer.nvidia.com/cuda-toolkit) to be pre-installed. ## Data format The data format expectation is a single column text. The trainer is configured to expect a response template as a string. For example, if one wants to prepare the `alpaca` format data to feed into this trainer, it is quite easy and can be done with the following code. diff --git a/build/Dockerfile b/build/Dockerfile index fbad2ff4f..191152555 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -96,18 +96,14 @@ RUN dnf install -y python3.11 git && \ RUN mkdir /app WORKDIR /tmp -RUN python -m pip install packaging && \ - python -m pip install --upgrade pip && \ - python -m pip install torch && \ - python -m pip install wheel +RUN python -m pip install --upgrade pip # TODO Move to installing wheel once we have proper releases setup instead of cloning the repo RUN git clone https://github.com/foundation-model-stack/fms-hf-tuning.git && \ cd fms-hf-tuning && \ - python -m pip install -r requirements.txt && \ - python -m pip install -r flashattn_requirements.txt && \ - python -m pip install -U datasets && \ - python -m pip install /tmp/fms-hf-tuning + python -m pip install ".[dev]" && \ + python -m pip install ".[flash-attn]" && \ + python -m pip install -U datasets RUN mkdir -p /licenses COPY LICENSE /licenses/ @@ -129,4 +125,4 @@ RUN useradd -u $USER_UID tuning -m -g 0 --system && \ WORKDIR /app USER ${USER} -CMD [ "tail", "-f", "/dev/null" ] \ No newline at end of file +CMD [ "tail", "-f", "/dev/null" ] diff --git a/flashattn_requirements.txt b/flashattn_requirements.txt deleted file mode 100644 index a38086016..000000000 --- a/flashattn_requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -wheel -flash-attn diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..4babec5d1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = [ + "setuptools>=61", + "setuptools-scm>=8.0"] + +[project] +name = "fms-hf-tuning" +version = "0.0.1" +description = "FMS HF Tuning" +authors = [ + {name = "Sukriti Sharma", email = "sukriti.sharma4@ibm.com"}, + {name = "Anh Uong", email = "anh.uong@ibm.com"}, +] +license = {text = "Apache-2.0"} +readme = "README.md" +requires-python = "~=3.9" +keywords = ['fms-hf-tuning', 'python', 'tuning'] +classifiers=[ + "License :: OSI Approved :: Apache Software License" +] + +dynamic = ["dependencies"] + +[project.optional-dependencies] +dev = ["wheel", "packaging", "ninja"] +flash-attn = ["flash-attn"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[project.urls] +Homepage = "https://github.com/foundation-model-stack/fms-hf-tuning" +Repository = "https://github.com/foundation-model-stack/fms-hf-tuning" +Issues = "https://github.com/foundation-model-stack/fms-hf-tuning/issues" diff --git a/requirements.txt b/requirements.txt index 0c7204395..2e3895770 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,12 @@ numpy accelerate>=0.20.3 -packaging -transformers>=4.34.1 +transformers torch aim==3.18.1 sentencepiece tokenizers>=0.13.3 tqdm trl -ninja peft>=0.8.0 datasets>=2.15.0 fire - diff --git a/setup.py b/setup.py index 97167fe76..0d42e68fe 100644 --- a/setup.py +++ b/setup.py @@ -15,4 +15,4 @@ # Third Party from setuptools import find_packages, setup -setup(name="tuning", version="0.0.1", packages=find_packages()) +setup(name="fms-hf-tuning", version="0.0.1", packages=find_packages())