Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +307 -0
- amd-olmo-1b-sft.Q4_0.gguf +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
amd-olmo-1b-sft.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- allenai/dolma
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
---
|
7 |
+
# AMD-OLMo
|
8 |
+
|
9 |
+
AMD-OLMo are a series of 1B language models trained from scratch by AMD on AMD Instinct™ MI250 GPUs. The training code used is based on [OLMo](https://github.com/allenai/OLMo).
|
10 |
+
We release the pre-trained model, supervised fine-tuned model, and DPO aligned model as follows:
|
11 |
+
|
12 |
+
- [AMD-OLMo-1B](https://huggingface.co/amd/AMD-OLMo-1B): Pre-trained on a subset of [Dolma v1.7](https://huggingface.co/datasets/allenai/dolma) that consists of 1.3 trillion tokens.
|
13 |
+
- [AMD-OLMo-1B-SFT](https://huggingface.co/amd/AMD-OLMo-1B-SFT): Supervised fine-tuned (SFT) on [Tulu V2](https://huggingface.co/datasets/allenai/tulu-v2-sft-mixture) dataset (1st phase) and then [OpenHermes-2.5](https://huggingface.co/datasets/teknium/OpenHermes-2.5), [WebInstructSub](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub), and [Code-Feedback](https://huggingface.co/datasets/m-a-p/Code-Feedback) datasets (2nd phase).
|
14 |
+
- [AMD-OLMo-1B-SFT-DPO](https://huggingface.co/amd/AMD-OLMo-1B-SFT-DPO): Aligned with human preferences using Direct Preference Optimization (DPO) on [UltraFeedback](https://huggingface.co/datasets/argilla/ultrafeedback-binarized-preferences-cleaned) dataset.
|
15 |
+
|
16 |
+
Description:
|
17 |
+
|
18 |
+
- **Hardware**: Each compute node consists of 4 AMD Instinct™ MI250 GPUs. We use 16 nodes for pretraining AMD-OLMo-1B
|
19 |
+
|
20 |
+
- **Training throughput**: 12,200 tokens/sec/gpu
|
21 |
+
|
22 |
+
- **Model architecture**: AMD-OLMo-1B is based on the model architecture and training set up of fully open source 1 billion version of [OLMo-1B](https://github.com/allenai/OLMo) with the details below:
|
23 |
+
|
24 |
+
| Parameter size | Number of layers | Number of heads | Hidden size | Context length | Vocabulary Size |
|
25 |
+
|-----------------:|:------------------:|:-----------------:|:-------------:|:----------------:|:----------------:|
|
26 |
+
| 1.2B | 16 | 16 | 2048 | 2048 | 50,280 |
|
27 |
+
|
28 |
+
- **Hyper-parameters**:
|
29 |
+
|Stage | LR schedule | Peak LR | Warmup steps |Epochs| Batch size (tokens) |
|
30 |
+
|------------:|:--------------:|:---------:|:--------------:|:------:|:---------------------:|
|
31 |
+
|Pretraining | Cosine | 4.0e-4 | 2000 | 1 | 4M |
|
32 |
+
|SFT Phase 1 | Linear | 2.0e-5 | 200 | 3 | 262K |
|
33 |
+
|SFT Phase 2 | Linear | 2.0e-5 | 200 | 3 | 1024K |
|
34 |
+
|DPO | Cosine | 4.0e-6 | 47 | 1 | 64K |
|
35 |
+
|
36 |
+
For more details, please refer to our [blog](https://www.amd.com/en/developer/resources/technical-articles/introducing-the-first-amd-1b-language-model.html).
|
37 |
+
|
38 |
+
## Usage
|
39 |
+
|
40 |
+
### PyTorch on AMD GPUs
|
41 |
+
For running pytorch on AMD GPUs you can use the following rocm docker as in [docker hub](https://hub.docker.com/r/rocm/pytorch)
|
42 |
+
|
43 |
+
```bash
|
44 |
+
docker pull rocm/pytorch:latest
|
45 |
+
# Inside docker
|
46 |
+
pip install transformers
|
47 |
+
```
|
48 |
+
|
49 |
+
### Use Example
|
50 |
+
|
51 |
+
```python
|
52 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
53 |
+
|
54 |
+
model = AutoModelForCausalLM.from_pretrained("amd/AMD-OLMo-1B-SFT").to("cuda") # remove .to("cuda") to load on cpu
|
55 |
+
tokenizer = AutoTokenizer.from_pretrained("amd/AMD-OLMo-1B-SFT")
|
56 |
+
|
57 |
+
prompt = "What is large language model?"
|
58 |
+
bos = tokenizer.eos_token
|
59 |
+
template = bos + "<|user|>\n{prompt}\n<|assistant|>\n"
|
60 |
+
|
61 |
+
input_text = template.format(prompt=prompt)
|
62 |
+
inputs = tokenizer([input_text], return_tensors='pt', return_token_type_ids=False).to("cuda")
|
63 |
+
outputs = model.generate(**inputs, max_new_tokens=1000, do_sample=True, top_k=50, top_p=0.95)
|
64 |
+
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)[0])
|
65 |
+
```
|
66 |
+
|
67 |
+
|
68 |
+
## Main Results
|
69 |
+
|
70 |
+
### Pretraining Results
|
71 |
+
|
72 |
+
| **Standard Benchmarks** | [TinyLLaMA-v1.1](https://huggingface.co/TinyLlama/TinyLlama_v1.1) (1.1B) | [MobiLLaMA-1B](https://huggingface.co/MBZUAI/MobiLlama-1B) (1.2B) | [OLMo-1B](https://huggingface.co/allenai/OLMo-1B-hf) (1.2B) | [OpenELM-1_1B](https://huggingface.co/apple/OpenELM-1_1B) (1.1B) | [OLMo-1B-0724-hf](https://huggingface.co/allenai/OLMo-1B-0724-hf) (1.2B) | [AMD-OLMo-1B](https://huggingface.co/amd/AMD-OLMo-1B) (1.2B) |
|
73 |
+
|---------------------:|:-----------------:|:-----------:|:-----------:|:---------------:|:---------------:|:-----------:|
|
74 |
+
| **arc_easy** | 55.47 | 56.65 | 57.28 | 55.43 | 56.65 | **63.64** |
|
75 |
+
| **arc_challenge** | 32.68 | 32.00 | 31.06 | 32.34 | 32.34 | **33.70** |
|
76 |
+
| **hellaswag** | 61.47 | 61.80 | 62.92 | 64.81 | **66.12** | 63.61 |
|
77 |
+
| **piqa** | 73.56 | 75.30 | 75.14 | **75.57** | 75.08 | **75.57** |
|
78 |
+
| **boolq** | 55.99 | 60.83 | 61.74 | 63.58 | **66.18** | 60.58 |
|
79 |
+
| **sciq** | 89.30 | 88.20 | 87.00 | 90.60 | 92.70 | **93.20** |
|
80 |
+
| **winogrande** | 59.43 | 59.27 | 59.98 | **61.72** | **61.72** | 61.64 |
|
81 |
+
| **openbookqa** | **36.80** | 35.40 | 36.20 | 36.20 | 35.60 | 35.80 |
|
82 |
+
| **mmlu (0-shot)** | 25.02 | 24.81 | 24.23 | 25.26 | **25.45** | 24.88 |
|
83 |
+
| **gsm8k (8-shot)** | 1.82 | 0.00 | 2.50 | 2.81 | **8.95** | 2.88 |
|
84 |
+
| **bbh (3-shot)** | **25.63** | 0.00 | **25.63** | 16.77 | 21.67 | 20.95 |
|
85 |
+
| **Average** | 47.02 | 44.93 | 47.61 | 47.73 | **49.31** | 48.77 |
|
86 |
+
|
87 |
+
|
88 |
+
### Instruction Tuning Results
|
89 |
+
|
90 |
+
| **Standard Benchmarks**|[TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) (1.1B)|[MobiLlama-1B-Chat](https://huggingface.co/MBZUAI/MobiLlama-1B-Chat) (1.2B)|[OpenELM-1_1B-Instruct](https://huggingface.co/apple/OpenELM-1_1B-Instruct) (1.1B)|[AMD-OLMo-1B-SFT](https://huggingface.co/amd/AMD-OLMo-1B-SFT) (1.2B)|[AMD-OLMo-1B-SFT-DPO](https://huggingface.co/amd/AMD-OLMo-1B-SFT-DPO) (1.2B)|
|
91 |
+
|------------------:|:---------:|:---------:|:---------:|:---------:|:---------:|
|
92 |
+
| **arc_easy** | 54.42 | 57.41 | 52.44 | 63.68 | **64.31** |
|
93 |
+
| **arc_challenge** | 32.85 | 34.56 | **37.80** | 37.12 | 37.37 |
|
94 |
+
| **hellaswag** | 60.40 | 62.51 | **71.29** | 61.63 | 61.91 |
|
95 |
+
| **piqa** | 74.48 | **75.73** | 75.03 | 74.43 | 74.16 |
|
96 |
+
| **boolq** | 61.04 | 55.66 | **70.28** | 68.53 | 70.24 |
|
97 |
+
| **sciq** | 88.40 | 87.10 | 89.50 | 91.20 | **92.10** |
|
98 |
+
| **winogrande** | 60.54 | 60.77 | **62.19** | 60.22 | 60.62 |
|
99 |
+
| **openbookqa** | 37.20 | 36.80 | 39.20 | 37.40 | **40.20** |
|
100 |
+
| **mmlu** | 24.61 | 25.25 | 25.54 | 29.97 | **30.52** |
|
101 |
+
| **gsm8k (8-shot)**| 2.81 | 0.23 | 1.82 | **18.20** | 15.77 |
|
102 |
+
| **bbh (3-shot)** | **26.83** | 0.00 | 13.40 | 25.17 | 25.45 |
|
103 |
+
| **Average** | 47.60 | 45.09 | 48.95 | 51.60 | **52.06** |
|
104 |
+
|
105 |
+
|**Chat Benchmarks**|[TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) (1.1B)|[MobiLlama-1B-Chat](https://huggingface.co/MBZUAI/MobiLlama-1B-Chat) (1.2B)|[OpenELM-1_1B-Instruct](https://huggingface.co/apple/OpenELM-1_1B-Instruct) (1.1B)|[AMD-OLMo-1B-SFT](https://huggingface.co/amd/AMD-OLMo-1B-SFT) (1.2B)|[AMD-OLMo-1B-SFT-DPO](https://huggingface.co/amd/AMD-OLMo-1B-SFT-DPO) (1.2B)|
|
106 |
+
|------------------:|:---------:|:---------:|:---------:|:---------:|:---------:|
|
107 |
+
| **AlpacaEval 1 (Win Rate)** | 50.81 | 34.90 | 37.72 | 50.12 | **54.22** |
|
108 |
+
| **AlpacaEval 2 (LC Win Rate)**| 1.54 | 1.59 | 0.49 | **3.88** | 2.37 |
|
109 |
+
| **MTBench** | 3.38 | 2.89 | - | **4.35** | 4.10 |
|
110 |
+
|
111 |
+
|**Responsible AI Benchmarks**|[TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) (1.1B)|[MobiLlama-1B-Chat](https://huggingface.co/MBZUAI/MobiLlama-1B-Chat) (1.2B)|[OpenELM-1_1B-Instruct](https://huggingface.co/apple/OpenELM-1_1B-Instruct) (1.1B)|[AMD-OLMo-1B-SFT](https://huggingface.co/amd/AMD-OLMo-1B-SFT) (1.2B)|[AMD-OLMo-1B-SFT-DPO](https://huggingface.co/amd/AMD-OLMo-1B-SFT-DPO) (1.2B)|
|
112 |
+
|------------------:|:---------:|:---------:|:---------:|:---------:|:---------:|
|
113 |
+
| **ToxiGen** | 41.70 | **37.23** | 42.34 | 39.04 | 39.68 |
|
114 |
+
| **crows_pairs** | 60.35 | 58.50 | 59.93 | 60.29 | **61.00** |
|
115 |
+
| **TruthfulQA-mc2**| 37.92 | 38.46 | **45.84** | 37.45 | 40.06 |
|
116 |
+
|
117 |
+
*In generating tokens for chat benchmark evaluations, we use `max_length=2048` for AlpacaEval and `max_new_tokens=2048` for MTBench.
|
118 |
+
|
119 |
+
*All numbers in above tables were obtained from our evaluations.
|
120 |
+
|
121 |
+
|
122 |
+
## Evaluation
|
123 |
+
We use the following open source evaluation frameworks for evaluating our models:
|
124 |
+
- [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness): For evaluating on commonsense reasoning, multi-task understanding & responsible AI benchmarks
|
125 |
+
- [AlpacaEval](https://github.com/tatsu-lab/alpaca_eval): For evaluating instruction-following capabilities of chat models.
|
126 |
+
- [MT-Bench](https://github.com/lm-sys/FastChat/tree/main/fastchat/llm_judge): For evaluating multi-turn capabilities of chat models.
|
127 |
+
|
128 |
+
### Setup
|
129 |
+
```bash
|
130 |
+
# lm-eval-harness
|
131 |
+
git clone https://github.com/EleutherAI/lm-evaluation-harness
|
132 |
+
cd lm-evaluation-harness
|
133 |
+
pip install -e .
|
134 |
+
|
135 |
+
# AlpacaEval
|
136 |
+
pip install git+https://github.com/tatsu-lab/alpaca_eval
|
137 |
+
cd alpaca_eval
|
138 |
+
pip install -e .
|
139 |
+
|
140 |
+
# MT-Bench
|
141 |
+
git clone https://github.com/lm-sys/FastChat.git
|
142 |
+
cd FastChat
|
143 |
+
pip install -e ".[model_worker,llm_judge]"
|
144 |
+
```
|
145 |
+
|
146 |
+
### Run evaluation
|
147 |
+
```bash
|
148 |
+
# lm-eval-harness
|
149 |
+
HF_MODEL=amd/AMD-OLMo-1B-SFT-DPO
|
150 |
+
accelerate launch -m lm_eval --model hf \
|
151 |
+
--model_args pretrained=$HF_MODEL,trust_remote_code=True \
|
152 |
+
--tasks arc_easy,arc_challenge,hellaswag,piqa,boolq,sciq,winogrande,openbookqa,mmlu,gsm8k_cot,bbh_cot_fewshot,toxigen,truthfulqa,crows_pairs \
|
153 |
+
--device cuda \
|
154 |
+
--batch_size 32 \
|
155 |
+
--output_path ./lm-eval-results/$HF_MODEL
|
156 |
+
```
|
157 |
+
|
158 |
+
## Training
|
159 |
+
|
160 |
+
### Setup
|
161 |
+
```bash
|
162 |
+
WORK_DIR="<path_to_your_working_directory>"
|
163 |
+
cd $WORK_DIR
|
164 |
+
# Clone OLMo codebase:
|
165 |
+
git clone https://github.com/allenai/OLMo.git --branch v0.3.0
|
166 |
+
cd OLMo
|
167 |
+
# Clone AMD-OLMo that contains files to reproduce our model training
|
168 |
+
git clone https://huggingface.co/amd/AMD-OLMo
|
169 |
+
|
170 |
+
docker pull rocm/pytorch:latest
|
171 |
+
docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --shm-size 8G -v $WORK_DIR/OLMo:/OLMo -w /OLMo rocm/pytorch:latest
|
172 |
+
|
173 |
+
# Remove Line 17 as the docker already has ROCm PyTorch installed
|
174 |
+
sed -i '17d' pyproject.toml
|
175 |
+
pip install -e .[all]
|
176 |
+
```
|
177 |
+
|
178 |
+
### Download and prepare pretraining datasets
|
179 |
+
```bash
|
180 |
+
# Download
|
181 |
+
DATA_DIR=./datasets/dolma
|
182 |
+
mkdir -p $DATA_DIR
|
183 |
+
|
184 |
+
PARALLEL_DOWNLOADS="<number_of_parallel_downloads>"
|
185 |
+
cat "AMD-OLMo/dolma_v1_7_subset.txt" | xargs -n 1 -P $PARALLEL_DOWNLOADS wget -q -P $DATA_DIR
|
186 |
+
|
187 |
+
# Prepare
|
188 |
+
NUM_WORKERS="<number_of_workers>"
|
189 |
+
python scripts/prepare_memmap_dataset.py $DATA_DIR/*.json.gz -o $DATA_DIR/memmap_dataset --workers $NUM_WORKERS
|
190 |
+
```
|
191 |
+
|
192 |
+
### Download and prepare SFT datasets
|
193 |
+
```bash
|
194 |
+
# 1st phase SFT dataset
|
195 |
+
python AMD-OLMo/prepare_sft_data.py --output_dir ./datasets/tulu --tokenizer tokenizers/allenai_eleuther-ai-gpt-neox-20b-pii-special.json --dataset tulu
|
196 |
+
|
197 |
+
# 2nd phase SFT dataset
|
198 |
+
python AMD-OLMo/prepare_sft_data.py --output_dir ./datasets/OpenHermes_WebInstructSub_CodeFeedBack --tokenizer tokenizers/allenai_eleuther-ai-gpt-neox-20b-pii-special.json --dataset 2nd-phase
|
199 |
+
```
|
200 |
+
|
201 |
+
### Run Training
|
202 |
+
Pretrainig config: [AMD-OLMo-1B.yaml](AMD-OLMo-1B.yaml)
|
203 |
+
|
204 |
+
SFT config: [AMD-OLMo-1B-SFT-1st-phase.yaml](AMD-OLMo-1B-SFT-1st-phase.yaml) and [AMD-OLMo-1B-SFT-2nd-phase.yaml](AMD-OLMo-1B-SFT-2nd-phase.yaml)
|
205 |
+
```bash
|
206 |
+
# Single node
|
207 |
+
HSA_FORCE_FINE_GRAIN_PCIE=1 OMP_NUM_THREADS=128 NCCL_DEBUG=INFO torchrun --nproc_per_node=8 ./scripts/train.py AMD-OLMo/AMD-OLMo-1B.yaml
|
208 |
+
|
209 |
+
# Multiple nodes
|
210 |
+
HSA_FORCE_FINE_GRAIN_PCIE=1 OMP_NUM_THREADS=128 NCCL_DEBUG=INFO torchrun --nnodes=$nnodes --node-rank=$node_rank --master_addr=$master_addr --master_port=$master_port --nproc_per_node=8 ./scripts/train.py AMD-OLMo/AMD-OLMo-1B.yaml
|
211 |
+
```
|
212 |
+
|
213 |
+
### Run DPO Training
|
214 |
+
|
215 |
+
DPO recipe: [AMD-OLMo-1B-dpo.yaml](AMD-OLMo-1B-dpo.yaml).
|
216 |
+
```bash
|
217 |
+
# install trl library
|
218 |
+
git clone https://github.com/huggingface/trl.git -b v0.8.6
|
219 |
+
|
220 |
+
# replace dpo_trainer.py
|
221 |
+
cp AMD-OLMo/dpo_trainer.py trl/trl/trainer
|
222 |
+
|
223 |
+
pip install -e ./trl
|
224 |
+
|
225 |
+
# install alignment-handbook
|
226 |
+
git clone https://github.com/huggingface/alignment-handbook.git hf-align
|
227 |
+
# 70769f9 is the main branch on 2024-04-11.
|
228 |
+
cd hf-align && git checkout 70769f9 && cd ..
|
229 |
+
|
230 |
+
pip install -e ./hf-align
|
231 |
+
|
232 |
+
# Copy AMD OLMo DPO recipe to hf-align/recipes.
|
233 |
+
cp AMD-OLMo/AMD-OLMo-1B-dpo.yaml hf-align/recipes/
|
234 |
+
|
235 |
+
# Prepare the converted AMD-OLMo SFT Huggingface model to ckpt_dir.
|
236 |
+
ckpt_dir=amd/AMD-OLMo-1B-SFT
|
237 |
+
local_tokenizer_dir=${ckpt_dir}
|
238 |
+
|
239 |
+
# Set output checkpoint dir.
|
240 |
+
dpo_ckpt_dir=<your_output_checkpoint_dir>
|
241 |
+
|
242 |
+
accelerate launch --config_file hf-align/recipes/accelerate_configs/deepspeed_zero3.yaml \
|
243 |
+
hf-align/scripts/run_dpo.py hf-align/recipes/AMD-OLMo-1B-dpo.yaml \
|
244 |
+
--trust_remote_code=true \
|
245 |
+
--model_name_or_path=${ckpt_dir} \
|
246 |
+
--tokenizer_name_or_path=${local_tokenizer_dir} \
|
247 |
+
--output_dir=${dpo_ckpt_dir} \
|
248 |
+
--num_train_epochs=1 \
|
249 |
+
--learning_rate=4e-6 \
|
250 |
+
--beta=0.3 \
|
251 |
+
--loss_type=sigmoid
|
252 |
+
```
|
253 |
+
|
254 |
+
## Bias, Risks, and Limitations
|
255 |
+
|
256 |
+
- The models are being released for research purposes only and are not intended for use cases that require high levels of factuality, safety critical situations, health or medical applications, generating false information, facilitating toxic conversations.
|
257 |
+
- Model checkpoints are made accessible without any safety guarantees. It is crucial for users to conduct comprehensive evaluations and implement safety filtering mechanisms as per their respective use cases.
|
258 |
+
- It may be possible to prompt the model to generate content that may be factually inaccurate, harmful, violent, toxic, biased, or otherwise objectionable. Such content may also get generated by prompts that did not intend to produce output as such. Users are thus requested to be aware of this and exercise caution and responsible thinking when using the model.
|
259 |
+
- Multi-lingual abilities of the models have not been tested and thus may misunderstand and generate erroneous responses across different languages.
|
260 |
+
|
261 |
+
## Appendix
|
262 |
+
### Evaluation Metrics
|
263 |
+
| **Benchmark** | Metric |
|
264 |
+
|---------------------:|:-----------------:|
|
265 |
+
| **arc_easy** | Normalized Accuracy |
|
266 |
+
| **arc_challenge** | Normalized Accuracy |
|
267 |
+
| **hellaswag** | Normalized Accuracy |
|
268 |
+
| **piqa** | Accuracy |
|
269 |
+
| **boolq** | Accuracy |
|
270 |
+
| **sciq** | Accuracy |
|
271 |
+
| **winogrande** | Accuracy |
|
272 |
+
| **openbookqa** | Normalized Accuracy |
|
273 |
+
| **mmlu** | Accuracy |
|
274 |
+
| **gsm8k (8-shot)** | Exact Match (Flexible Extract) |
|
275 |
+
| **bbh (3-shot)** | Exact Match |
|
276 |
+
| **ToxiGen** | Accuracy |
|
277 |
+
| **crows_pairs** | PCT Stereotype |
|
278 |
+
| **TruthfulQA-mc2** | Accuracy |
|
279 |
+
| **AlpacaEval 1 (Win Rate)** | Win Rate (chatgpt_fn) |
|
280 |
+
| **AlpacaEval 2 (LC Win Rate)** | Length Control Win Rate (weighted_alpaca_eval_gpt4_turbo) |
|
281 |
+
| **MTBench** | Average score for single-answer grading (2 turns) |
|
282 |
+
|
283 |
+
Feel free to cite our AMD-OLMo models:
|
284 |
+
```bash
|
285 |
+
@misc{AMD-OLMo,
|
286 |
+
title = {AMD-OLMo: A series of 1B language models trained from scratch by AMD on AMD Instinct™ MI250 GPUs.},
|
287 |
+
url = {https://huggingface.co/amd/AMD-OLMo},
|
288 |
+
author = {Jiang Liu, Jialian Wu, Prakamya Mishra, Zicheng Liu, Sudhanshu Ranjan, Pratik Prabhanjan Brahma, Yusheng Su, Gowtham Ramesh, Peng Sun, Zhe Li, Dong Li, Lu Tian, Emad Barsoum},
|
289 |
+
month = {October},
|
290 |
+
year = {2024}
|
291 |
+
}
|
292 |
+
```
|
293 |
+
|
294 |
+
#### License
|
295 |
+
Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
296 |
+
|
297 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
298 |
+
you may not use this file except in compliance with the License.
|
299 |
+
You may obtain a copy of the License at
|
300 |
+
|
301 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
302 |
+
|
303 |
+
Unless required by applicable law or agreed to in writing, software
|
304 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
305 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
306 |
+
See the License for the specific language governing permissions and
|
307 |
+
limitations under the License.
|
amd-olmo-1b-sft.Q4_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:98a681684fb2fc0037adf9112be937f7b8070b33f65c860039d9dbe6998271c7
|
3 |
+
size 690266464
|