-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync with develop and resolve conflicts
Signed-off-by: Abolfazl Shahbazi <[email protected]>
- Loading branch information
Showing
22 changed files
with
1,038 additions
and
72 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 @@ | ||
# API Reference | ||
|
||
Low-code Python\* API documentation is automatically generated from the code and | ||
appears in the Transfer Learning Tool documentation website's [API](https://intelai.github.io/transfer-learning/main/api.html) page. | ||
appears in the Transfer Learning Tool documentation website's [API](https://intel.github.io/transfer-learning/main/api.html) page. |
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 @@ | ||
# CLI Reference | ||
|
||
No-code bash CLI documentation is automatically generated from the code and | ||
appears in the Transfer Learning Tool documentation website's [CLI](https://intelai.github.io/transfer-learning/main/cli.html) page. | ||
appears in the Transfer Learning Tool documentation website's [CLI](https://intel.github.io/transfer-learning/main/cli.html) page. |
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,36 @@ | ||
# Copyright (c) 2024 Intel Corporation | ||
# | ||
# 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
ARG GAUDI_SW_VER=1.15.1 | ||
ARG OS=ubuntu22.04 | ||
ARG TORCH_VER=2.2.0 | ||
|
||
FROM vault.habana.ai/gaudi-docker/${GAUDI_SW_VER}/${OS}/habanalabs/pytorch-installer-${TORCH_VER}:latest | ||
|
||
ARG GAUDI_SW_VER=1.15.1 | ||
ARG OPTIMUM_HABANA_VER=1.11.1 | ||
|
||
RUN pip install --no-cache-dir optimum-habana==${OPTIMUM_HABANA_VER} && \ | ||
git clone https://github.com/huggingface/optimum-habana.git --single-branch --branch v${OPTIMUM_HABANA_VER} && \ | ||
pip install --no-cache-dir -r optimum-habana/examples/language-modeling/requirements.txt && \ | ||
mkdir -p /workspace/optimum-habana && \ | ||
cp -r optimum-habana/examples /workspace/optimum-habana/examples && \ | ||
rm -rf optimum-habana && \ | ||
pip install --no-cache-dir git+https://github.com/HabanaAI/DeepSpeed.git@${GAUDI_SW_VER} | ||
|
||
COPY scripts /workspace/scripts | ||
|
||
WORKDIR /workspace |
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,108 @@ | ||
# Copyright (c) 2024 Intel Corporation | ||
# | ||
# 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
metadata: | ||
name: llama2-gaudi-multicard | ||
namespace: kubeflow | ||
|
||
secret: | ||
encodedToken: | ||
|
||
image: | ||
name: # Specify the image name that was pushed to docker hub or copied to the nodes | ||
tag: # Specify the image tag that was pushed to docker hub or copied to the nodes | ||
pullPolicy: Always | ||
|
||
securityContext: | ||
runAsUser: | ||
runAsGroup: | ||
fsGroup: | ||
privileged: true | ||
allowPrivilegeEscalation: false | ||
|
||
distributed: | ||
script: /workspace/scripts/finetune.py | ||
modelNameOrPath: meta-llama/Llama-2-7b-hf | ||
logLevel: info | ||
|
||
doTrain: True | ||
doEval: True | ||
|
||
train: | ||
useMpi: false | ||
useDeepSpeed: false | ||
datasetName: medalpaca/medical_meadow_medical_flashcards # Name of the Hugging Face dataset to use. Leave blank if using a data file | ||
dataFile: | ||
datasetConcatenation: True | ||
promptWithInput: Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. | ||
promptWithoutInput: Below is an instruction that describes a task. Write a response that appropriately completes the request. | ||
perDeviceBatchSize: 12 | ||
epochs: 3 | ||
maxSteps: -1 | ||
maxGradNorm: 0.3 | ||
gradientAccumulationSteps: 1 | ||
learningRate: 1e-4 | ||
lrSchedularType: "constant" | ||
useFastTokenizer: False | ||
outputDir: /tmp/pvc-mount/output/saved_model | ||
loggingSteps: 1020 | ||
saveTotalLimit: 2 | ||
evaluationStrategy: "no" | ||
saveStrategy: "no" | ||
warmupRatio: 0.03 | ||
throughputWarmupSteps: 3 | ||
useLora: True | ||
useLazyMode: True | ||
loraRank: 8 | ||
loraAlpha: 16 | ||
loraDropout: 0.05 | ||
loraTargetModules: q_proj vproj | ||
noCuda: True | ||
overwriteOutputDir: True | ||
adamEpsilon: 1e-08 | ||
bf16: True | ||
useHabana: true | ||
eval: | ||
perDeviceBatchSize: 8 | ||
validationSplitPercentage: 0.20 | ||
|
||
envVars: | ||
ldPreload: | ||
logLevel: INFO | ||
transformersCache: /tmp/pvc-mount/transformers_cache | ||
hfDatasetsCache: /tmp/pvc-mount/hf_dataset_cache | ||
hfHome: /tmp/home | ||
httpProxy: | ||
httpsProxy: | ||
noProxy: | ||
ftpProxy: | ||
socksProxy: | ||
|
||
# Resources allocated to each worker | ||
resources: | ||
hpu: 8 | ||
memoryRequest: 409Gi | ||
memoryLimit: 409Gi | ||
nodeSelectorLabel: | ||
nodeSelectorValue: | ||
hugePages2Mi: 35202Mi | ||
|
||
# Persistent volume claim storage resources | ||
storage: | ||
storageClassName: nfs-client | ||
resources: 50Gi | ||
pvcMountPath: /tmp/pvc-mount |
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,106 @@ | ||
# Copyright (c) 2024 Intel Corporation | ||
# | ||
# 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
metadata: | ||
name: llama2-gaudi-finetuning | ||
namespace: kubeflow | ||
|
||
secret: | ||
encodedToken: | ||
|
||
image: | ||
name: # Specify the image name that was pushed to docker hub or copied to the nodes | ||
tag: # Specify the image tag that was pushed to docker hub or copied to the nodes | ||
pullPolicy: IfNotPresent | ||
|
||
securityContext: | ||
runAsUser: | ||
runAsGroup: | ||
fsGroup: | ||
privileged: true | ||
allowPrivilegeEscalation: false | ||
|
||
distributed: | ||
script: /workspace/scripts/finetune.py | ||
modelNameOrPath: meta-llama/Llama-2-7b-chat-hf | ||
logLevel: info | ||
|
||
doTrain: True | ||
doEval: True | ||
|
||
train: | ||
datasetName: # Name of the Hugging Face dataset to use. Leave blank if using a data file | ||
dataFile: /tmp/pvc-mount/dataset/financial-alpaca.json | ||
datasetConcatenation: True | ||
promptWithInput: Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. | ||
promptWithoutInput: Below is an instruction that describes a task. Write a response that appropriately completes the request. | ||
perDeviceBatchSize: 8 | ||
epochs: 3 | ||
maxSteps: -1 | ||
maxGradNorm: 0.3 | ||
gradientAccumulationSteps: 1 | ||
learningRate: 1e-4 | ||
lrSchedularType: "constant" | ||
useFastTokenizer: False | ||
outputDir: /tmp/pvc-mount/output/saved_model | ||
loggingSteps: 10 | ||
saveTotalLimit: 2 | ||
evaluationStrategy: "no" | ||
saveStrategy: "no" | ||
warmupRatio: 0.03 | ||
throughputWarmupSteps: 3 | ||
useLora: True | ||
useLazyMode: True | ||
loraRank: 8 | ||
loraAlpha: 16 | ||
loraDropout: 0.05 | ||
loraTargetModules: q_proj vproj | ||
noCuda: True | ||
overwriteOutputDir: True | ||
adamEpsilon: 1e-08 | ||
bf16: True | ||
useHabana: true | ||
eval: | ||
perDeviceBatchSize: 8 | ||
validationSplitPercentage: 0.20 | ||
|
||
envVars: | ||
ldPreload: /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4.5.9:/usr/local/lib/libiomp5.so | ||
logLevel: INFO | ||
transformersCache: /tmp/pvc-mount/transformers_cache | ||
hfDatasetsCache: /tmp/pvc-mount/hf_dataset_cache | ||
hfHome: /tmp/home | ||
httpProxy: | ||
httpsProxy: | ||
noProxy: | ||
ftpProxy: | ||
socksProxy: | ||
|
||
# Resources allocated to each worker | ||
resources: | ||
hpu: 1 | ||
memoryRequest: 409Gi | ||
memoryLimit: 409Gi | ||
nodeSelectorLabel: | ||
nodeSelectorValue: | ||
hugePages2Mi: 35202Mi | ||
|
||
# Persistent volume claim storage resources | ||
storage: | ||
storageClassName: nfs-client | ||
resources: 50Gi | ||
pvcMountPath: /tmp/pvc-mount |
Oops, something went wrong.