-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoRA and DoRA PEFT support for Fine-Tuning TimesFM #104
Merged
rajatsen91
merged 24 commits into
google-research:master
from
tanmayshishodia:feature/lora
Aug 6, 2024
Merged
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
71d9802
add parameter efficient finetuning pipeline
tanmayshishodia ee7462b
Merge branch 'master' into feature/lora
tanmayshishodia b6ebd80
revert test env name
tanmayshishodia 77b004b
Merge branch 'feature/lora' of github.com:tanmayshishodia/timesfm int…
tanmayshishodia 461c2cd
update checkpoint dir name
tanmayshishodia c34896b
update adapter init file docstring
tanmayshishodia c8aaf31
gitgnore all pycache dirs
tanmayshishodia 845661d
update usage tutorial
tanmayshishodia e3fb45c
gitignore jax egg info
tanmayshishodia 2174a8c
add src init file for poetry package
tanmayshishodia 39665af
change import style
tanmayshishodia a59979d
add example dora.sh file
tanmayshishodia 5ae8c7d
update lora/dora intermediate var names
tanmayshishodia d4d4afd
add pytest framework
tanmayshishodia 5901805
add bash scripts for running diff FT strategies
tanmayshishodia a908448
add docstrings in adapter utils
tanmayshishodia 18da73a
remove helper and fix early stopping logic
tanmayshishodia 807ddfd
add poetry packages
tanmayshishodia f15daba
Merge branch 'master' into feature/lora
tanmayshishodia d72ff83
keep only a single bash script
tanmayshishodia 6517590
update poetry lock
tanmayshishodia 0ccc10f
update pytest poetry
tanmayshishodia e5be6bd
add new line EOF
tanmayshishodia 55f71de
Create PEFT README.md
tanmayshishodia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.venv/ | ||
dist/ | ||
**__pycache__/** */ | ||
__pycache__/ | ||
checkpoints/ | ||
wandb/ | ||
datasets/ | ||
results/ | ||
timesfm_jax.egg-info/ |
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 |
---|---|---|
|
@@ -16,3 +16,6 @@ dependencies: | |
- jax[cuda12]==0.4.26 | ||
- einshape | ||
- scikit-learn | ||
- typer | ||
- wandb | ||
- pytest |
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 |
---|---|---|
|
@@ -16,3 +16,6 @@ dependencies: | |
- jax[cpu]==0.4.26 | ||
- einshape | ||
- scikit-learn | ||
- typer | ||
- wandb | ||
- pytest |
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,26 @@ | ||
#!/bin/bash | ||
|
||
export TF_CPP_MIN_LOG_LEVEL=2 XLA_PYTHON_CLIENT_PREALLOCATE=false | ||
|
||
python3 finetune.py \ | ||
--model-name="google/timesfm-1.0-200m" \ | ||
--backend="gpu" \ | ||
--horizon-len=128 \ | ||
--context-len=512 \ | ||
--freq="15min" \ | ||
--data-path="../datasets/ETT-small/ETTm1.csv" \ | ||
--num-epochs=100 \ | ||
--learning-rate=1e-3 \ | ||
--adam-epsilon=1e-7 \ | ||
--adam-clip-threshold=1e2 \ | ||
--early-stop-patience=10 \ | ||
--datetime-col="date" \ | ||
--boundaries=34560 46080 57600 \ | ||
--use-lora \ | ||
--lora-rank=1 \ | ||
--lora-target-modules="all" \ | ||
--use-dora \ | ||
--cos-initial-decay-value=1e-4 \ | ||
--cos-decay-steps=40000 \ | ||
--cos-final-decay-value=1e-5 \ | ||
--ema-decay=0.9999 |
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,22 @@ | ||
#!/bin/bash | ||
|
||
export TF_CPP_MIN_LOG_LEVEL=2 XLA_PYTHON_CLIENT_PREALLOCATE=false | ||
|
||
python3 finetune.py \ | ||
--model-name="google/timesfm-1.0-200m" \ | ||
--backend="gpu" \ | ||
--horizon-len=128 \ | ||
--context-len=512 \ | ||
--freq="15min" \ | ||
--data-path="../datasets/ETT-small/ETTm1.csv" \ | ||
--num-epochs=1 \ | ||
--learning-rate=1e-3 \ | ||
--adam-epsilon=1e-7 \ | ||
--adam-clip-threshold=1e2 \ | ||
--early-stop-patience=10 \ | ||
--datetime-col="date" \ | ||
--boundaries=34560 46080 57600 \ | ||
--cos-initial-decay-value=1e-4 \ | ||
--cos-decay-steps=40000 \ | ||
--cos-final-decay-value=1e-5 \ | ||
--ema-decay=0.9999 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like different .sh scripts are not needed, one script with command line options is good enough. or we can not check in these scripts and have it as example usage in the header comment of finetune.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will keep only one of them.
Running
python3 finetune.py --help
gives the following o/p, which is self-explanatory. Perhaps I can add it in README?