Skip to content
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

[fine_tuning] Enable fsdp cpu offloading #524

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
subPath: entrypoint.sh
- name: storage
mountPath: /storage
serviceAccount: rhoai-tuning-test-sa
serviceAccountName: rhoai-tuning-test-sa
volumes:
{% if cluster_download_to_pvc_creds | length %}
- name: download-secret
Expand Down
7 changes: 1 addition & 6 deletions projects/fine_tuning/testing/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,13 @@ ci_presets:
- name: granite-family
model_name:
- ibm-granite/granite-3b-code-instruct
- instructlab/granite-7b-lab
- ibm-granite/granite-8b-code-base
- ibm-granite/granite-8b-code-instruct
hyper_parameters:
per_device_train_batch_size: 1
- name: llama-family
model_name:
- meta-llama/Meta-Llama-3-8B-Instruct
- meta-llama/llama-2-7b-hf
- meta-llama/Llama-2-13b-chat-hf
hyper_parameters:
per_device_train_batch_size: [1, 2]
per_device_train_batch_size: 1

ibm_80gb_models:
extends: [hf_evaluation, dgx_small_footprint]
Expand Down
2 changes: 2 additions & 0 deletions projects/fine_tuning/testing/prepare_finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def prepare_gpu():


def prepare_rhoai():
return
if not PSAP_ODS_SECRET_PATH.exists():
raise RuntimeError(f"Path with the secrets (PSAP_ODS_SECRET_PATH={PSAP_ODS_SECRET_PATH}) does not exists.")

Expand Down Expand Up @@ -68,6 +69,7 @@ def prepare_rhoai():


def set_namespace_annotations():
return
metal = config.ci_artifacts.get_config("clusters.sutest.is_metal")
dedicated = config.ci_artifacts.get_config("clusters.sutest.compute.dedicated")
namespace = config.ci_artifacts.get_config("tests.fine_tuning.namespace")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ accelerate_launch_args:
tpu_use_sudo: false
{% if (fine_tuning_run_fine_tuning_job_gpu or 1) > 1 %}
use_fsdp: true
# fsdp_offload_params: true
{% endif %}
# below are the *default* values. They might be overwritten when 'config_final.json' is generated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
mountPath: /mnt/entrypoint
- name: config-volume
mountPath: /mnt/config
- name: output-volume
- name: scratch-volume
mountPath: /mnt/output
resources:
requests: &request_block
Expand All @@ -79,8 +79,18 @@ spec:
- name: entrypoint-volume
configMap:
name: {{ job_name_safe }}-entrypoint
- name: output-volume
emptyDir: {}
# - name: output-volume
# emptyDir: {}
- name: scratch-volume
ephemeral:
volumeClaimTemplate:
metadata:
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 500Gi

{% if fine_tuning_run_fine_tuning_job_worker_replicas > 0 %}
Worker:
replicas: {{ fine_tuning_run_fine_tuning_job_worker_replicas }}
Expand Down
6 changes: 3 additions & 3 deletions projects/local_ci/testing/config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
base_image:
namespace: topsail
namespace: rhoai-tuning-test
imagestream: topsail
repo:
url: https://github.com/openshift-psap/topsail/
ref: main
dockerfile_path: build/Dockerfile
user:
service_account: topsail
role: cluster-admin
service_account: rhoai-tuning-test-sa
role: rhoai-tuning-test-admin-role
secrets:
psap-ods-secret:
env_key: PSAP_ODS_SECRET_PATH
Expand Down
4 changes: 2 additions & 2 deletions projects/local_ci/testing/run
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def local_ci_prepare():
# Prepare the ServiceAccount
#

run.run(f"oc create serviceaccount {service_account} -n {namespace} --dry-run=client -oyaml | oc apply -f-")
run.run(f"oc adm policy add-cluster-role-to-user {role} -z {service_account} -n {namespace}")
# run.run(f"oc create serviceaccount {service_account} -n {namespace} --dry-run=client -oyaml | oc apply -f-")
# run.run(f"oc adm policy add-cluster-role-to-user {role} -z {service_account} -n {namespace}")

#
# Prepare the Secrets
Expand Down
Loading