-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update templates after v0.5.8
llmforge
release (#391)
# What does this PR do? Updates workspace templates after v0.5.8 release of `llmforge` . Product release has happened already so this PR can be safely merged. Some important changes in this version: - `checkpoint_every_n_epochs` is deprecated in favour of `checkpoint_and_evaluation_frequency` - `max_num_checkpoints` is deprecated. - `awsv2` -> `aws` in `RemoteStoragePath`. This is because of awsv2 cli deprecation. Since RemoteStoragePath is a bleeding edge feature, this is hard deprecation. - `TorchCompileConfig` is here. Also, we added liger support in the previous release - 0.5.7 but that was not added until now. This PR also adds liger to our configs. --------- Signed-off-by: SumanthRH <sumanthrh@anyscale.com> Co-authored-by: Eric Tang <erictang000@gmail.com>
- Loading branch information
1 parent
ecd3341
commit b631ed8
Showing
10 changed files
with
162 additions
and
27 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "dspy-llmforge-fine-tuning-job" | ||
entrypoint: "llmforge anyscale finetune configs/training/lora/llama-3-8b.yaml" | ||
working_dir: "." | ||
image_uri: "localhost:5555/anyscale/llm-forge:0.5.7" | ||
image_uri: "localhost:5555/anyscale/llm-forge:0.5.8" |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: e2e-llm-workflows | ||
entrypoint: llmforge anyscale finetune configs/training/lora/llama-3-8b.yaml | ||
image_uri: localhost:5555/anyscale/llm-forge:0.5.7 | ||
image_uri: localhost:5555/anyscale/llm-forge:0.5.8 | ||
requirements: [] | ||
max_retries: 1 | ||
excludes: ["assets"] |
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
77 changes: 77 additions & 0 deletions
77
...-tune-llm_v2/training_configs/custom/meta-llama/Meta-Llama-3-8B/lora/4xA10-512-liger.yaml
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,77 @@ | ||
# Change this to the model you want to fine-tune | ||
model_id: meta-llama/Meta-Llama-3-8B-Instruct | ||
|
||
# Change this to the path to your training data | ||
train_path: s3://air-example-data/gsm8k/train.jsonl | ||
|
||
# Change this to the path to your validation data. This is optional | ||
valid_path: s3://air-example-data/gsm8k/test.jsonl | ||
|
||
# Change this to the context length you want to use. Examples with longer | ||
# context length will be truncated. | ||
context_length: 512 | ||
|
||
# Change this to total number of GPUs that you want to use | ||
num_devices: 4 | ||
|
||
# Change this to the number of epochs that you want to train for | ||
num_epochs: 3 | ||
|
||
# Change this to the batch size that you want to use | ||
train_batch_size_per_device: 2 | ||
eval_batch_size_per_device: 4 | ||
gradient_accumulation_steps: 2 | ||
|
||
|
||
# Change this to the learning rate that you want to use | ||
learning_rate: 1e-4 | ||
|
||
# This will pad batches to the longest sequence. Use "max_length" when profiling to profile the worst case. | ||
padding: "longest" | ||
|
||
# By default, we will keep the best checkpoint. You can change this to keep more checkpoints. | ||
num_checkpoints_to_keep: 1 | ||
|
||
# Deepspeed configuration, you can provide your own deepspeed setup | ||
deepspeed: | ||
config_path: deepspeed_configs/zero_2.json | ||
|
||
logger: | ||
provider: wandb | ||
|
||
# Accelerator type, we value of 0.001 is not important, as long as it is | ||
# beteween 0 and 1. This ensures that accelerator type is used per trainer | ||
# worker. | ||
worker_resources: | ||
anyscale/accelerator_shape:4xA10G: 0.001 | ||
|
||
# Liger kernel configuration | ||
liger_kernel: | ||
enabled: True | ||
# You can further customize the individual liger kernel configurations here. By default, | ||
# all the `kwargs` are `True` when liger is enabled. | ||
# kwargs: | ||
# rms_norm: True | ||
# rope: True | ||
# swiglu: True | ||
# cross_entropy: True | ||
# fused_linear_cross_entropy: True | ||
|
||
# Lora configuration | ||
lora_config: | ||
r: 8 | ||
lora_alpha: 16 | ||
lora_dropout: 0.05 | ||
target_modules: | ||
- q_proj | ||
- v_proj | ||
- k_proj | ||
- o_proj | ||
- gate_proj | ||
- up_proj | ||
- down_proj | ||
- embed_tokens | ||
- lm_head | ||
task_type: "CAUSAL_LM" | ||
bias: "none" | ||
modules_to_save: [] |
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
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,23 @@ | ||
from pathlib import Path | ||
|
||
import nbformat | ||
|
||
|
||
def clear_execution_numbers(nb_path): | ||
with open(nb_path, "r", encoding="utf-8") as f: | ||
nb = nbformat.read(f, as_version=4) | ||
for cell in nb["cells"]: | ||
if cell["cell_type"] == "code": | ||
cell["execution_count"] = None | ||
for output in cell["outputs"]: | ||
if "execution_count" in output: | ||
output["execution_count"] = None | ||
with open(nb_path, "w", encoding="utf-8") as f: | ||
nbformat.write(nb, f) | ||
|
||
|
||
if __name__ == "__main__": | ||
ROOT_DIR = Path(__file__).parent.parent | ||
notebook_fps = list(ROOT_DIR.glob("**/*.ipynb")) | ||
for fp in notebook_fps: | ||
clear_execution_numbers(fp) |