-
Notifications
You must be signed in to change notification settings - Fork 71
Make the gamesense project run on CPU #184
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
27469df
fix syntax
wjayesh d274f6c
make the project run on CPU
wjayesh dac219d
fix logging logic
wjayesh d66ba58
update readme and add config file
wjayesh e9480dc
Merge branch 'main' into bugfix/fixgame
strickvl 4b665f6
update readme to reflect what the project does
wjayesh 5af607d
Update README.md
strickvl ea66dc5
Apply suggestions from code review
wjayesh fd010f8
neptune optional readme
wjayesh d9f875c
Merge branch 'main' into bugfix/fixgame
wjayesh 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 hidden or 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 hidden or 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,85 @@ | ||
| # 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-phi-3.5-mini-instruct-cpu | ||
| description: "Fine-tune Phi-3.5-mini-instruct on CPU." | ||
| tags: | ||
| - llm | ||
| - peft | ||
| - phi-3.5 | ||
| - cpu | ||
| version: 100_steps | ||
|
|
||
| settings: | ||
| docker: | ||
| parent_image: pytorch/pytorch:2.2.2-runtime | ||
| requirements: requirements.txt | ||
| python_package_installer: uv | ||
| python_package_installer_args: | ||
| system: null | ||
| apt_packages: | ||
| - git | ||
| environment: | ||
| MKL_SERVICE_FORCE_INTEL: "1" | ||
| # Explicitly disable MPS | ||
| PYTORCH_ENABLE_MPS_FALLBACK: "0" | ||
| PYTORCH_MPS_HIGH_WATERMARK_RATIO: "0.0" | ||
|
|
||
| parameters: | ||
| # Uses a smaller model for CPU training | ||
| base_model_id: microsoft/Phi-3.5-mini-instruct | ||
| use_fast: False | ||
| load_in_4bit: False | ||
| load_in_8bit: False | ||
| cpu_only: True # Enable CPU-only mode | ||
| # Extra conservative dataset size for CPU | ||
| max_train_samples: 50 | ||
| max_val_samples: 10 | ||
| max_test_samples: 5 | ||
| 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 | ||
| # These settings are now defined at the pipeline level | ||
| # max_train_samples: 100 | ||
| # max_val_samples: 20 | ||
| # max_test_samples: 10 | ||
|
|
||
| finetune: | ||
| parameters: | ||
| max_steps: 25 # Further reduced steps for CPU training | ||
| eval_steps: 5 # More frequent evaluation | ||
| bf16: False # Disable bf16 for CPU compatibility | ||
| per_device_train_batch_size: 1 # Smallest batch size for CPU | ||
| gradient_accumulation_steps: 2 # Reduced for CPU | ||
| optimizer: "adamw_torch" # Use standard AdamW rather than 8-bit for CPU | ||
| logging_steps: 2 # More frequent logging | ||
| save_steps: 25 # Save less frequently | ||
| save_total_limit: 1 # Keep only the best model | ||
| evaluation_strategy: "steps" | ||
|
|
||
| promote: | ||
| parameters: | ||
| metric: rouge2 | ||
| target_stage: staging |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.