Javad Taghia commited on
Commit
dbb959c
·
1 Parent(s): dba87af

cput ok for compare

Browse files
Files changed (24) hide show
  1. .gitignore +3 -0
  2. README.md +11 -7
  3. archive/outputs-sandy-glade-39/tinyllama-lora/README.md +207 -0
  4. archive/outputs-sandy-glade-39/tinyllama-lora/adapter_config.json +43 -0
  5. archive/outputs-sandy-glade-39/tinyllama-lora/adapter_model.safetensors +3 -0
  6. archive/outputs-sandy-glade-39/tinyllama-lora/chat_template.jinja +15 -0
  7. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/README.md +207 -0
  8. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/adapter_config.json +43 -0
  9. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/adapter_model.safetensors +3 -0
  10. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/chat_template.jinja +15 -0
  11. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/optimizer.pt +3 -0
  12. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/rng_state.pth +3 -0
  13. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/scheduler.pt +3 -0
  14. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/special_tokens_map.json +24 -0
  15. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/tokenizer.model +3 -0
  16. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/tokenizer_config.json +44 -0
  17. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/trainer_state.json +76 -0
  18. archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/training_args.bin +3 -0
  19. archive/outputs-sandy-glade-39/tinyllama-lora/special_tokens_map.json +24 -0
  20. archive/outputs-sandy-glade-39/tinyllama-lora/tokenizer.model +3 -0
  21. archive/outputs-sandy-glade-39/tinyllama-lora/tokenizer_config.json +44 -0
  22. archive/outputs-sandy-glade-39/tinyllama-lora/training_args.bin +3 -0
  23. evaluation/compare_lora.py +14 -2
  24. evaluation/simple_inference.py +3 -1
.gitignore CHANGED
@@ -16,3 +16,6 @@ wandb/
16
 
17
  # Training outputs and adapters
18
  outputs/
 
 
 
 
16
 
17
  # Training outputs and adapters
18
  outputs/
19
+
20
+ # archives and logs
21
+ archives/
README.md CHANGED
@@ -98,9 +98,15 @@ Key flags:
98
  - `outputs/` is tracked via Git LFS (`.gitattributes`), so weights can be committed and pushed to the Hub. Run `git lfs install` once, then `git add outputs/...` before committing.
99
 
100
  ## Evaluation (inference/compare)
101
- - Quick smoke test with the saved adapter (edit `lora_dir` inside if you used a different path):
102
  ```bash
103
- python evaluation/simple_inference.py
 
 
 
 
 
 
104
  ```
105
  - Compare base vs. LoRA outputs side-by-side:
106
  ```bash
@@ -109,6 +115,7 @@ python evaluation/compare_lora.py \
109
  --lora_dir outputs/tinyllama-lora \
110
  --prompt "Explain LoRA in one sentence."
111
  ```
 
112
  ```bash
113
  python evaluation/compare_lora.py \
114
  --base_model TinyLlama/TinyLlama-1.1B-Chat-v1.0 \
@@ -116,10 +123,8 @@ python evaluation/compare_lora.py \
116
  --prompt "Explain LoRA in one sentence." \
117
  --device cpu \
118
  --torch_dtype float32
119
-
120
- ```
121
-
122
- Optional flags: `--max_new_tokens`, `--temperature`, `--top_p`, `--torch_dtype`.
123
 
124
  ## Troubleshooting
125
  - OOM? Reduce `max_seq_length`, increase `gradient_accumulation_steps`, or switch to a smaller dataset (e.g., use a tiny instruction set like `mlabonne/guanaco-llama2-1k`, or subset your dataset with `--dataset_name your/dataset --max_train_samples 500` in code/script).
@@ -179,4 +184,3 @@ python train_tulu.py \
179
  --input_field input \
180
  --output_field output
181
 
182
-
 
98
  - `outputs/` is tracked via Git LFS (`.gitattributes`), so weights can be committed and pushed to the Hub. Run `git lfs install` once, then `git add outputs/...` before committing.
99
 
100
  ## Evaluation (inference/compare)
101
+ - Quick smoke test with the saved adapter (edit `lora_dir` or pass flags):
102
  ```bash
103
+ python evaluation/simple_inference.py \
104
+ --lora_dir outputs/tinyllama-lora \
105
+ --device auto \
106
+ --torch_dtype auto \
107
+ --max_new_tokens 128 \
108
+ --temperature 0.7 \
109
+ --top_p 0.9
110
  ```
111
  - Compare base vs. LoRA outputs side-by-side:
112
  ```bash
 
115
  --lora_dir outputs/tinyllama-lora \
116
  --prompt "Explain LoRA in one sentence."
117
  ```
118
+ For CPU or constrained machines, force CPU + fp32 (and add `--offload_dir offload` if using `device_map=auto`):
119
  ```bash
120
  python evaluation/compare_lora.py \
121
  --base_model TinyLlama/TinyLlama-1.1B-Chat-v1.0 \
 
123
  --prompt "Explain LoRA in one sentence." \
124
  --device cpu \
125
  --torch_dtype float32
126
+ ```
127
+ Optional flags: `--max_new_tokens`, `--temperature`, `--top_p`, `--torch_dtype`, `--device`, `--offload_dir`.
 
 
128
 
129
  ## Troubleshooting
130
  - OOM? Reduce `max_seq_length`, increase `gradient_accumulation_steps`, or switch to a smaller dataset (e.g., use a tiny instruction set like `mlabonne/guanaco-llama2-1k`, or subset your dataset with `--dataset_name your/dataset --max_train_samples 500` in code/script).
 
184
  --input_field input \
185
  --output_field output
186
 
 
archive/outputs-sandy-glade-39/tinyllama-lora/README.md ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:TinyLlama/TinyLlama-1.1B-Chat-v1.0
7
+ - lora
8
+ - transformers
9
+ ---
10
+
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+
16
+
17
+ ## Model Details
18
+
19
+ ### Model Description
20
+
21
+ <!-- Provide a longer summary of what this model is. -->
22
+
23
+
24
+
25
+ - **Developed by:** [More Information Needed]
26
+ - **Funded by [optional]:** [More Information Needed]
27
+ - **Shared by [optional]:** [More Information Needed]
28
+ - **Model type:** [More Information Needed]
29
+ - **Language(s) (NLP):** [More Information Needed]
30
+ - **License:** [More Information Needed]
31
+ - **Finetuned from model [optional]:** [More Information Needed]
32
+
33
+ ### Model Sources [optional]
34
+
35
+ <!-- Provide the basic links for the model. -->
36
+
37
+ - **Repository:** [More Information Needed]
38
+ - **Paper [optional]:** [More Information Needed]
39
+ - **Demo [optional]:** [More Information Needed]
40
+
41
+ ## Uses
42
+
43
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
44
+
45
+ ### Direct Use
46
+
47
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Downstream Use [optional]
52
+
53
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
54
+
55
+ [More Information Needed]
56
+
57
+ ### Out-of-Scope Use
58
+
59
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ## Bias, Risks, and Limitations
64
+
65
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
66
+
67
+ [More Information Needed]
68
+
69
+ ### Recommendations
70
+
71
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
72
+
73
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
74
+
75
+ ## How to Get Started with the Model
76
+
77
+ Use the code below to get started with the model.
78
+
79
+ [More Information Needed]
80
+
81
+ ## Training Details
82
+
83
+ ### Training Data
84
+
85
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
86
+
87
+ [More Information Needed]
88
+
89
+ ### Training Procedure
90
+
91
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
92
+
93
+ #### Preprocessing [optional]
94
+
95
+ [More Information Needed]
96
+
97
+
98
+ #### Training Hyperparameters
99
+
100
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
101
+
102
+ #### Speeds, Sizes, Times [optional]
103
+
104
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
105
+
106
+ [More Information Needed]
107
+
108
+ ## Evaluation
109
+
110
+ <!-- This section describes the evaluation protocols and provides the results. -->
111
+
112
+ ### Testing Data, Factors & Metrics
113
+
114
+ #### Testing Data
115
+
116
+ <!-- This should link to a Dataset Card if possible. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Factors
121
+
122
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
123
+
124
+ [More Information Needed]
125
+
126
+ #### Metrics
127
+
128
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
129
+
130
+ [More Information Needed]
131
+
132
+ ### Results
133
+
134
+ [More Information Needed]
135
+
136
+ #### Summary
137
+
138
+
139
+
140
+ ## Model Examination [optional]
141
+
142
+ <!-- Relevant interpretability work for the model goes here -->
143
+
144
+ [More Information Needed]
145
+
146
+ ## Environmental Impact
147
+
148
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
149
+
150
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
151
+
152
+ - **Hardware Type:** [More Information Needed]
153
+ - **Hours used:** [More Information Needed]
154
+ - **Cloud Provider:** [More Information Needed]
155
+ - **Compute Region:** [More Information Needed]
156
+ - **Carbon Emitted:** [More Information Needed]
157
+
158
+ ## Technical Specifications [optional]
159
+
160
+ ### Model Architecture and Objective
161
+
162
+ [More Information Needed]
163
+
164
+ ### Compute Infrastructure
165
+
166
+ [More Information Needed]
167
+
168
+ #### Hardware
169
+
170
+ [More Information Needed]
171
+
172
+ #### Software
173
+
174
+ [More Information Needed]
175
+
176
+ ## Citation [optional]
177
+
178
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
179
+
180
+ **BibTeX:**
181
+
182
+ [More Information Needed]
183
+
184
+ **APA:**
185
+
186
+ [More Information Needed]
187
+
188
+ ## Glossary [optional]
189
+
190
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
191
+
192
+ [More Information Needed]
193
+
194
+ ## More Information [optional]
195
+
196
+ [More Information Needed]
197
+
198
+ ## Model Card Authors [optional]
199
+
200
+ [More Information Needed]
201
+
202
+ ## Model Card Contact
203
+
204
+ [More Information Needed]
205
+ ### Framework versions
206
+
207
+ - PEFT 0.18.0
archive/outputs-sandy-glade-39/tinyllama-lora/adapter_config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": null,
25
+ "peft_type": "LORA",
26
+ "peft_version": "0.18.0",
27
+ "qalora_group_size": 16,
28
+ "r": 64,
29
+ "rank_pattern": {},
30
+ "revision": null,
31
+ "target_modules": [
32
+ "q_proj",
33
+ "k_proj",
34
+ "v_proj",
35
+ "o_proj"
36
+ ],
37
+ "target_parameters": null,
38
+ "task_type": "CAUSAL_LM",
39
+ "trainable_token_indices": null,
40
+ "use_dora": false,
41
+ "use_qalora": false,
42
+ "use_rslora": false
43
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31da89b90c5bf37df558866b948363e36921755fd0f57445ddad686da61b518c
3
+ size 72113224
archive/outputs-sandy-glade-39/tinyllama-lora/chat_template.jinja ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% for message in messages %}
2
+ {% if message['role'] == 'user' %}
3
+ {{ '<|user|>
4
+ ' + message['content'] + eos_token }}
5
+ {% elif message['role'] == 'system' %}
6
+ {{ '<|system|>
7
+ ' + message['content'] + eos_token }}
8
+ {% elif message['role'] == 'assistant' %}
9
+ {{ '<|assistant|>
10
+ ' + message['content'] + eos_token }}
11
+ {% endif %}
12
+ {% if loop.last and add_generation_prompt %}
13
+ {{ '<|assistant|>' }}
14
+ {% endif %}
15
+ {% endfor %}
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/README.md ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:TinyLlama/TinyLlama-1.1B-Chat-v1.0
7
+ - lora
8
+ - transformers
9
+ ---
10
+
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+
16
+
17
+ ## Model Details
18
+
19
+ ### Model Description
20
+
21
+ <!-- Provide a longer summary of what this model is. -->
22
+
23
+
24
+
25
+ - **Developed by:** [More Information Needed]
26
+ - **Funded by [optional]:** [More Information Needed]
27
+ - **Shared by [optional]:** [More Information Needed]
28
+ - **Model type:** [More Information Needed]
29
+ - **Language(s) (NLP):** [More Information Needed]
30
+ - **License:** [More Information Needed]
31
+ - **Finetuned from model [optional]:** [More Information Needed]
32
+
33
+ ### Model Sources [optional]
34
+
35
+ <!-- Provide the basic links for the model. -->
36
+
37
+ - **Repository:** [More Information Needed]
38
+ - **Paper [optional]:** [More Information Needed]
39
+ - **Demo [optional]:** [More Information Needed]
40
+
41
+ ## Uses
42
+
43
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
44
+
45
+ ### Direct Use
46
+
47
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Downstream Use [optional]
52
+
53
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
54
+
55
+ [More Information Needed]
56
+
57
+ ### Out-of-Scope Use
58
+
59
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ## Bias, Risks, and Limitations
64
+
65
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
66
+
67
+ [More Information Needed]
68
+
69
+ ### Recommendations
70
+
71
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
72
+
73
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
74
+
75
+ ## How to Get Started with the Model
76
+
77
+ Use the code below to get started with the model.
78
+
79
+ [More Information Needed]
80
+
81
+ ## Training Details
82
+
83
+ ### Training Data
84
+
85
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
86
+
87
+ [More Information Needed]
88
+
89
+ ### Training Procedure
90
+
91
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
92
+
93
+ #### Preprocessing [optional]
94
+
95
+ [More Information Needed]
96
+
97
+
98
+ #### Training Hyperparameters
99
+
100
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
101
+
102
+ #### Speeds, Sizes, Times [optional]
103
+
104
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
105
+
106
+ [More Information Needed]
107
+
108
+ ## Evaluation
109
+
110
+ <!-- This section describes the evaluation protocols and provides the results. -->
111
+
112
+ ### Testing Data, Factors & Metrics
113
+
114
+ #### Testing Data
115
+
116
+ <!-- This should link to a Dataset Card if possible. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Factors
121
+
122
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
123
+
124
+ [More Information Needed]
125
+
126
+ #### Metrics
127
+
128
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
129
+
130
+ [More Information Needed]
131
+
132
+ ### Results
133
+
134
+ [More Information Needed]
135
+
136
+ #### Summary
137
+
138
+
139
+
140
+ ## Model Examination [optional]
141
+
142
+ <!-- Relevant interpretability work for the model goes here -->
143
+
144
+ [More Information Needed]
145
+
146
+ ## Environmental Impact
147
+
148
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
149
+
150
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
151
+
152
+ - **Hardware Type:** [More Information Needed]
153
+ - **Hours used:** [More Information Needed]
154
+ - **Cloud Provider:** [More Information Needed]
155
+ - **Compute Region:** [More Information Needed]
156
+ - **Carbon Emitted:** [More Information Needed]
157
+
158
+ ## Technical Specifications [optional]
159
+
160
+ ### Model Architecture and Objective
161
+
162
+ [More Information Needed]
163
+
164
+ ### Compute Infrastructure
165
+
166
+ [More Information Needed]
167
+
168
+ #### Hardware
169
+
170
+ [More Information Needed]
171
+
172
+ #### Software
173
+
174
+ [More Information Needed]
175
+
176
+ ## Citation [optional]
177
+
178
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
179
+
180
+ **BibTeX:**
181
+
182
+ [More Information Needed]
183
+
184
+ **APA:**
185
+
186
+ [More Information Needed]
187
+
188
+ ## Glossary [optional]
189
+
190
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
191
+
192
+ [More Information Needed]
193
+
194
+ ## More Information [optional]
195
+
196
+ [More Information Needed]
197
+
198
+ ## Model Card Authors [optional]
199
+
200
+ [More Information Needed]
201
+
202
+ ## Model Card Contact
203
+
204
+ [More Information Needed]
205
+ ### Framework versions
206
+
207
+ - PEFT 0.18.0
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/adapter_config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": null,
25
+ "peft_type": "LORA",
26
+ "peft_version": "0.18.0",
27
+ "qalora_group_size": 16,
28
+ "r": 64,
29
+ "rank_pattern": {},
30
+ "revision": null,
31
+ "target_modules": [
32
+ "q_proj",
33
+ "k_proj",
34
+ "v_proj",
35
+ "o_proj"
36
+ ],
37
+ "target_parameters": null,
38
+ "task_type": "CAUSAL_LM",
39
+ "trainable_token_indices": null,
40
+ "use_dora": false,
41
+ "use_qalora": false,
42
+ "use_rslora": false
43
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31da89b90c5bf37df558866b948363e36921755fd0f57445ddad686da61b518c
3
+ size 72113224
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/chat_template.jinja ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% for message in messages %}
2
+ {% if message['role'] == 'user' %}
3
+ {{ '<|user|>
4
+ ' + message['content'] + eos_token }}
5
+ {% elif message['role'] == 'system' %}
6
+ {{ '<|system|>
7
+ ' + message['content'] + eos_token }}
8
+ {% elif message['role'] == 'assistant' %}
9
+ {{ '<|assistant|>
10
+ ' + message['content'] + eos_token }}
11
+ {% endif %}
12
+ {% if loop.last and add_generation_prompt %}
13
+ {{ '<|assistant|>' }}
14
+ {% endif %}
15
+ {% endfor %}
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50f6b39102a3af920ba02801a1c407ef580f9cffd06024522c69a4feca92ff0d
3
+ size 144322618
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5493dbf5bba5741d2b25397f552fc797bb1a5ef8ab1d9d23986917e7fa66c606
3
+ size 13990
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f4d113c6e95c4022178c76328771e94349608fc9f80f5eeae8b4b66f207294b
3
+ size 1064
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "</s>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/tokenizer_config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": true,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "bos_token": "<s>",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "extra_special_tokens": {},
35
+ "legacy": false,
36
+ "model_max_length": 2048,
37
+ "pad_token": "</s>",
38
+ "padding_side": "right",
39
+ "sp_model_kwargs": {},
40
+ "spaces_between_special_tokens": false,
41
+ "tokenizer_class": "LlamaTokenizer",
42
+ "unk_token": "<unk>",
43
+ "use_default_system_prompt": false
44
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/trainer_state.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 1.0,
6
+ "eval_steps": 500,
7
+ "global_step": 63,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.16,
14
+ "grad_norm": 0.15055584907531738,
15
+ "learning_rate": 0.00017704918032786885,
16
+ "loss": 1.4055,
17
+ "step": 10
18
+ },
19
+ {
20
+ "epoch": 0.32,
21
+ "grad_norm": 0.11845632642507553,
22
+ "learning_rate": 0.00014426229508196722,
23
+ "loss": 1.3037,
24
+ "step": 20
25
+ },
26
+ {
27
+ "epoch": 0.48,
28
+ "grad_norm": 0.14062458276748657,
29
+ "learning_rate": 0.00011147540983606557,
30
+ "loss": 1.226,
31
+ "step": 30
32
+ },
33
+ {
34
+ "epoch": 0.64,
35
+ "grad_norm": 0.09463928639888763,
36
+ "learning_rate": 7.868852459016394e-05,
37
+ "loss": 1.18,
38
+ "step": 40
39
+ },
40
+ {
41
+ "epoch": 0.8,
42
+ "grad_norm": 0.10201391577720642,
43
+ "learning_rate": 4.59016393442623e-05,
44
+ "loss": 1.1939,
45
+ "step": 50
46
+ },
47
+ {
48
+ "epoch": 0.96,
49
+ "grad_norm": 0.09585852175951004,
50
+ "learning_rate": 1.3114754098360657e-05,
51
+ "loss": 1.1497,
52
+ "step": 60
53
+ }
54
+ ],
55
+ "logging_steps": 10,
56
+ "max_steps": 63,
57
+ "num_input_tokens_seen": 0,
58
+ "num_train_epochs": 1,
59
+ "save_steps": 200,
60
+ "stateful_callbacks": {
61
+ "TrainerControl": {
62
+ "args": {
63
+ "should_epoch_stop": false,
64
+ "should_evaluate": false,
65
+ "should_log": false,
66
+ "should_save": true,
67
+ "should_training_stop": true
68
+ },
69
+ "attributes": {}
70
+ }
71
+ },
72
+ "total_flos": 3233386856448000.0,
73
+ "train_batch_size": 2,
74
+ "trial_name": null,
75
+ "trial_params": null
76
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/checkpoint-63/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9eb07f36f9ad0505c1bbe233de6b5d438bfd4e41bafbb6cf5bd00c368046727
3
+ size 5368
archive/outputs-sandy-glade-39/tinyllama-lora/special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "</s>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
archive/outputs-sandy-glade-39/tinyllama-lora/tokenizer_config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": true,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "bos_token": "<s>",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "extra_special_tokens": {},
35
+ "legacy": false,
36
+ "model_max_length": 2048,
37
+ "pad_token": "</s>",
38
+ "padding_side": "right",
39
+ "sp_model_kwargs": {},
40
+ "spaces_between_special_tokens": false,
41
+ "tokenizer_class": "LlamaTokenizer",
42
+ "unk_token": "<unk>",
43
+ "use_default_system_prompt": false
44
+ }
archive/outputs-sandy-glade-39/tinyllama-lora/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9eb07f36f9ad0505c1bbe233de6b5d438bfd4e41bafbb6cf5bd00c368046727
3
+ size 5368
evaluation/compare_lora.py CHANGED
@@ -26,6 +26,11 @@ def parse_args():
26
  choices=["auto", "cpu", "cuda", "mps"],
27
  help="Force device map; on CPU use this to keep everything on host.",
28
  )
 
 
 
 
 
29
  return p.parse_args()
30
 
31
 
@@ -36,7 +41,7 @@ def resolve_dtype(name: str) -> Optional[torch.dtype]:
36
 
37
 
38
  def resolve_device_map(device: str):
39
- return {"": "cpu"} if device == "cpu" else "auto"
40
 
41
 
42
  def generate(model, tokenizer, prompt: str, max_new_tokens: int, temperature: float, top_p: float) -> str:
@@ -54,7 +59,8 @@ def generate(model, tokenizer, prompt: str, max_new_tokens: int, temperature: fl
54
 
55
  def main():
56
  args = parse_args()
57
- torch_dtype = resolve_dtype(args.torch_dtype) or (torch.float32 if args.device == "cpu" else None)
 
58
  device_map = resolve_device_map(args.device) if args.device != "auto" else "auto"
59
 
60
  tokenizer = AutoTokenizer.from_pretrained(args.lora_dir, use_fast=False)
@@ -63,13 +69,19 @@ def main():
63
  args.base_model,
64
  device_map=device_map,
65
  torch_dtype=torch_dtype,
 
66
  )
67
  lora_wrapped = AutoModelForCausalLM.from_pretrained(
68
  args.base_model,
69
  device_map=device_map,
70
  torch_dtype=torch_dtype,
 
71
  )
72
  lora_wrapped = PeftModel.from_pretrained(lora_wrapped, args.lora_dir)
 
 
 
 
73
 
74
  base_out = generate(
75
  base_model,
 
26
  choices=["auto", "cpu", "cuda", "mps"],
27
  help="Force device map; on CPU use this to keep everything on host.",
28
  )
29
+ p.add_argument(
30
+ "--offload_dir",
31
+ default=None,
32
+ help="Optional offload directory when using device_map='auto' on constrained devices.",
33
+ )
34
  return p.parse_args()
35
 
36
 
 
41
 
42
 
43
  def resolve_device_map(device: str):
44
+ return None if device == "cpu" else "auto"
45
 
46
 
47
  def generate(model, tokenizer, prompt: str, max_new_tokens: int, temperature: float, top_p: float) -> str:
 
59
 
60
  def main():
61
  args = parse_args()
62
+ force_cpu = args.device == "cpu"
63
+ torch_dtype = torch.float32 if force_cpu else resolve_dtype(args.torch_dtype)
64
  device_map = resolve_device_map(args.device) if args.device != "auto" else "auto"
65
 
66
  tokenizer = AutoTokenizer.from_pretrained(args.lora_dir, use_fast=False)
 
69
  args.base_model,
70
  device_map=device_map,
71
  torch_dtype=torch_dtype,
72
+ offload_folder=args.offload_dir,
73
  )
74
  lora_wrapped = AutoModelForCausalLM.from_pretrained(
75
  args.base_model,
76
  device_map=device_map,
77
  torch_dtype=torch_dtype,
78
+ offload_folder=args.offload_dir,
79
  )
80
  lora_wrapped = PeftModel.from_pretrained(lora_wrapped, args.lora_dir)
81
+ if force_cpu:
82
+ # Avoid Accelerate dispatch/offload; keep everything on CPU.
83
+ base_model.to("cpu")
84
+ lora_wrapped.to("cpu")
85
 
86
  base_out = generate(
87
  base_model,
evaluation/simple_inference.py CHANGED
@@ -14,7 +14,7 @@ def resolve_dtype(name: str, device: str) -> Optional[torch.dtype]:
14
 
15
 
16
  def resolve_device_map(device: str):
17
- return {"": "cpu"} if device == "cpu" else "auto"
18
 
19
 
20
  def parse_args():
@@ -26,6 +26,7 @@ def parse_args():
26
  p.add_argument("--top_p", type=float, default=0.9)
27
  p.add_argument("--device", default="auto", choices=["auto", "cpu", "cuda", "mps"])
28
  p.add_argument("--torch_dtype", default="auto", choices=["auto", "float16", "bfloat16", "float32"])
 
29
  return p.parse_args()
30
 
31
 
@@ -41,6 +42,7 @@ def main():
41
  base_model,
42
  device_map=device_map,
43
  torch_dtype=torch_dtype,
 
44
  )
45
  model = PeftModel.from_pretrained(model, args.lora_dir)
46
 
 
14
 
15
 
16
  def resolve_device_map(device: str):
17
+ return None if device == "cpu" else "auto"
18
 
19
 
20
  def parse_args():
 
26
  p.add_argument("--top_p", type=float, default=0.9)
27
  p.add_argument("--device", default="auto", choices=["auto", "cpu", "cuda", "mps"])
28
  p.add_argument("--torch_dtype", default="auto", choices=["auto", "float16", "bfloat16", "float32"])
29
+ p.add_argument("--offload_dir", default=None, help="Optional offload directory when using device_map='auto'.")
30
  return p.parse_args()
31
 
32
 
 
42
  base_model,
43
  device_map=device_map,
44
  torch_dtype=torch_dtype,
45
+ offload_folder=args.offload_dir,
46
  )
47
  model = PeftModel.from_pretrained(model, args.lora_dir)
48