Skip to content

Commit

Permalink
Merge branch 'alekseymalakhov11-update-docs-and-poetry' of github.com…
Browse files Browse the repository at this point in the history
…:turbo-llm/turbo-alignment into alekseymalakhov11-update-docs-and-poetry
  • Loading branch information
Малахов Алексей Павлович committed Sep 30, 2024
2 parents 59eea61 + ba76ded commit c4716c7
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 137 deletions.
22 changes: 19 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@ message: >-
metadata from this file.
type: software
authors:
- given-names: Surnachev
family-names: Nikita
- given-names: Alexander
family-names: Zamiralov
- given-names: Alexey
family-names: Gorbatovski
- given-names: Alexey
family-names: Malakhov
- given-names: Boris
family-names: Shaposhnikov
- given-names: Daniil
family-names: Taranets
- given-names: Elisey
family-names: Rykov
- given-names: Nikita
family-names: Surnachev
- given-names: Sergey
family-names: Kochetkov
- given-names: Yana
family-names: Shishkina
repository-code: 'https://github.com/turbo-llm/turbo-alignment'
abstract: "Turbo-Alignment is a library designed to streamline the fine-tuning and alignment of large language models, leveraging advanced techniques to enhance efficiency and scalability."
keywords:
Expand All @@ -16,4 +32,4 @@ keywords:
- ppo
- rlhf
license: Apache-2.0
version: 0.0.3
version: 0.0.3
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,32 +130,27 @@ python -m turbo_alignment train_kto --experiment_settings_path configs/exp/train
<a name="-multimodal-train"></a>
## Multimodal train
⌛️ in progress..
<!-- ## Multimodal Tasks
To start multimodal training, you should:
- **Prepare the multimodal dataset**. See examples [here](docs/dataset_example.md#-multimodel-dataset).
- **Preprocess the data (OPTIONAL)**. If you plan to run many experiments on the same dataset, you should preprocess it. The preprocessing stage includes reading `pixel_values` from images, encoding them with the specified encoder, and saving them in safetensors format. Later, during training, the pipeline will skip the stage of reading and encoding images and only extract prepared encodings from the safetensors files.
- **Suitable config**: [llava.json](tests/fixtures/configs/train/multimodal/llama_llava_base_clip.json),[c_abs.json](tests/fixtures/configs/train/multimodal/llama_c_abs_clip_pickle.json) -->


<a name="-rag-train"></a>
## RAG (Retrieval-Augmented Generation)

<a name="-sft-rag-train"></a>
### SFT-RAG
- **📚 Dataset type**: prepare your dataset in `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **📝 Configs Example**: [sft_with_retrieval_utility](configs/exp/train/sft/llama/sft_with_retrieval_utility.json)
- **🖥️ CLI launch command**: ```bash
- **🖥️ CLI launch command**:
```bash
python -m turbo_alignment train_sft --experiment_settings_path configs/exp/train/sft/llama/sft_with_retrieval_utility.json
```
<a name="-e2e-rag-train"></a>
### End2End-RAG
- **📚 Dataset type**: prepare your dataset in `ChatDataset`, examples available [here](docs/dataset_example.md#-chat-dataset) format.
- **📝 Configs Example**: [end2end_rag](configs/exp/train/rag/end2end_rag.json)
- **🖥️ CLI launch command**: ```bash
- **🖥️ CLI launch command**:
```bash
python -m turbo_alignment train_rag --experiment_settings_path configs/exp/train/rag/end2end_rag.json
```


<a name="-inference"></a>
# Inference
<a name="-chat-inference"></a>
Expand Down Expand Up @@ -307,14 +302,15 @@ This project is licensed, see the [LICENSE](https://github.com/turbo-llm/turbo-a


## Citation
Author names are listed in alphabetical order.

```bibtex
@misc{surnachev2024turbo-alignment,
author = {Nikita Surnachev},
author = {Alexander Zamiralov and Alexey Gorbatovski and Alexey Malakhov and Boris Shaposhnikov and Daniil Taranets and Elisey Rykov and Nikita Surnachev and Sergey Kochetkov and Yana Shishkina},
title = {turbo-alignment},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/turbo-llm/turbo-alignment}}
}
```
```
226 changes: 113 additions & 113 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ peft = "0.8.2"
typer ="^0.9.0"
wandb ="^0.15.3"
scipy = "^1.1.0"
torch = "2.3.0"
torch = "2.3.1"
numpy = "^1.21"
tomlkit ="^0.11.8"
platformdirs ="^3.5.3"
Expand Down Expand Up @@ -50,9 +50,9 @@ albumentations = "^1.3.1"
opencv-python = "^4.10.0.84"

faiss-gpu = { version = "^1.7.2", optional = true }
vllm = {version = "0.5.1", optional = true}
deepspeed = { version = "0.12", optional = true }
accelerate = { version = "0.29.0", optional = true }
vllm = {version = "0.5.3", optional = true}


[tool.poetry.dev-dependencies]
Expand Down
4 changes: 1 addition & 3 deletions turbo_alignment/common/tf/loaders/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
from peft import PeftModel, get_peft_model, prepare_model_for_int8_training
from transformers import PreTrainedModel, PreTrainedTokenizerBase

from turbo_alignment.common.tf.liger_kernels.monkey_patch_liger import (
apply_liger_kernel_to_gemma2,
)
from turbo_alignment.common.tf.loaders.model.registry import (
PeftConfigRegistry,
TransformersAutoModelRegistry,
)
from turbo_alignment.modeling.liger_kernels import apply_liger_kernel_to_gemma2
from turbo_alignment.settings.model import (
ModelForPeftSettings,
PreTrainedAdaptersModelSettings,
Expand Down
1 change: 1 addition & 0 deletions turbo_alignment/modeling/liger_kernels/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from monkey_patch_liger import *
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import triton
import triton.language as tl

from turbo_alignment.common.tf.liger_kernels.utils import (
from turbo_alignment.modeling.liger_kernels.utils import (
calculate_settings,
compare_version,
ensure_contiguous,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from transformers import PretrainedConfig, PreTrainedModel

from turbo_alignment.common.logging import get_project_logger
from turbo_alignment.common.tf.liger_kernels.cross_entropy import LigerCrossEntropyLoss
from turbo_alignment.common.tf.liger_kernels.geglu import LigerGEGLUMLP
from turbo_alignment.common.tf.liger_kernels.rope import liger_rotary_pos_emb
from turbo_alignment.modeling.liger_kernels.cross_entropy import LigerCrossEntropyLoss
from turbo_alignment.modeling.liger_kernels.geglu import LigerGEGLUMLP
from turbo_alignment.modeling.liger_kernels.rope import liger_rotary_pos_emb

logger = get_project_logger()

Expand Down

0 comments on commit c4716c7

Please sign in to comment.