-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config and updates for Llama 3.1 (#118)
* update requirements * updates for llama 3.1 * add local config * use quantized model for local * remove gradient_checkpointing * Update llm-lora-finetuning/requirements.txt * revert to main base model * add hf login for evaluate step as well * update README * switch from info to tip * use github syntax * add links
- Loading branch information
Showing
6 changed files
with
189 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Apache Software License 2.0 | ||
# | ||
# Copyright (c) ZenML GmbH 2024. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
model: | ||
name: llm-peft-llama-3-1 | ||
description: "Fine-tune `llama-3.1`." | ||
tags: | ||
- llm | ||
- peft | ||
- llama-3.1 | ||
version: 300_steps | ||
|
||
settings: | ||
docker: | ||
parent_image: pytorch/pytorch:2.2.2-cuda11.8-cudnn8-runtime | ||
requirements: requirements.txt | ||
python_package_installer: uv | ||
python_package_installer_args: | ||
system: null | ||
apt_packages: | ||
- git | ||
environment: | ||
PJRT_DEVICE: CUDA | ||
USE_TORCH_XLA: "false" | ||
MKL_SERVICE_FORCE_INTEL: "1" | ||
|
||
parameters: | ||
# uses a 4-bit quantised version of llama-3.1 for local experimentation | ||
base_model_id: meta-llama/Meta-Llama-3.1-8B | ||
use_fast: False | ||
load_in_4bit: True | ||
system_prompt: | | ||
Given a target sentence construct the underlying meaning representation of the input sentence as a single function with attributes and attribute values. | ||
This function should describe the target string accurately and the function must be one of the following ['inform', 'request', 'give_opinion', 'confirm', 'verify_attribute', 'suggest', 'request_explanation', 'recommend', 'request_attribute']. | ||
The attributes must be one of the following: ['name', 'exp_release_date', 'release_year', 'developer', 'esrb', 'rating', 'genres', 'player_perspective', 'has_multiplayer', 'platforms', 'available_on_steam', 'has_linux_release', 'has_mac_release', 'specifier'] | ||
steps: | ||
prepare_data: | ||
parameters: | ||
dataset_name: gem/viggo | ||
|
||
finetune: | ||
parameters: | ||
max_steps: 300 | ||
eval_steps: 30 | ||
bf16: True | ||
|
||
promote: | ||
parameters: | ||
metric: rouge2 | ||
target_stage: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Apache Software License 2.0 | ||
# | ||
# Copyright (c) ZenML GmbH 2024. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
model: | ||
name: llm-peft-llama-3-1 | ||
description: "Fine-tune `llama-3.1`." | ||
tags: | ||
- llm | ||
- peft | ||
- llama-3.1 | ||
version: 300_steps | ||
|
||
settings: | ||
docker: | ||
parent_image: pytorch/pytorch:2.2.2-cuda11.8-cudnn8-runtime | ||
requirements: requirements.txt | ||
python_package_installer: uv | ||
python_package_installer_args: | ||
system: null | ||
apt_packages: | ||
- git | ||
environment: | ||
PJRT_DEVICE: CUDA | ||
USE_TORCH_XLA: "false" | ||
MKL_SERVICE_FORCE_INTEL: "1" | ||
|
||
parameters: | ||
base_model_id: meta-llama/Meta-Llama-3.1-8B | ||
use_fast: False | ||
load_in_4bit: True | ||
system_prompt: | | ||
Given a target sentence construct the underlying meaning representation of the input sentence as a single function with attributes and attribute values. | ||
This function should describe the target string accurately and the function must be one of the following ['inform', 'request', 'give_opinion', 'confirm', 'verify_attribute', 'suggest', 'request_explanation', 'recommend', 'request_attribute']. | ||
The attributes must be one of the following: ['name', 'exp_release_date', 'release_year', 'developer', 'esrb', 'rating', 'genres', 'player_perspective', 'has_multiplayer', 'platforms', 'available_on_steam', 'has_linux_release', 'has_mac_release', 'specifier'] | ||
steps: | ||
prepare_data: | ||
parameters: | ||
dataset_name: gem/viggo | ||
|
||
finetune: | ||
step_operator: gcp_a100 | ||
retry: | ||
max_retries: 3 | ||
delay: 10 | ||
backoff: 2 | ||
parameters: | ||
max_steps: 300 | ||
eval_steps: 30 | ||
bf16: True | ||
|
||
evaluate_finetuned: | ||
step_operator: gcp_a100 | ||
retry: | ||
max_retries: 3 | ||
delay: 10 | ||
backoff: 2 | ||
|
||
evaluate_base: | ||
step_operator: gcp_a100 | ||
retry: | ||
max_retries: 3 | ||
delay: 10 | ||
backoff: 2 | ||
|
||
promote: | ||
parameters: | ||
metric: rouge2 | ||
target_stage: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters