From 201f05bc12a8b01e6c2b4dcf2cbe1a990014aeb3 Mon Sep 17 00:00:00 2001 From: Simo Tuomisto Date: Fri, 11 Oct 2024 09:46:09 +0300 Subject: [PATCH] gpu: Fixed some problems in accelerate example --- ...run_accelerate_parallel.sh => run_accelerate_cuda.sh} | 2 +- content/gpus.rst | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) rename content/examples/{run_accelerate_parallel.sh => run_accelerate_cuda.sh} (89%) diff --git a/content/examples/run_accelerate_parallel.sh b/content/examples/run_accelerate_cuda.sh similarity index 89% rename from content/examples/run_accelerate_parallel.sh rename to content/examples/run_accelerate_cuda.sh index 11c78ef..eade966 100644 --- a/content/examples/run_accelerate_parallel.sh +++ b/content/examples/run_accelerate_cuda.sh @@ -5,7 +5,7 @@ #SBATCH --gpus-per-task=2 #SBATCH --cpus-per-task=12 #SBATCH --time=00:10:00 -#SBATCH --output=accelerate_run_parallel.out +#SBATCH --output=accelerate_cuda.out export OMP_NUM_THREADS=$(( $SLURM_CPUS_PER_TASK / $SLURM_GPUS_ON_NODE )) diff --git a/content/gpus.rst b/content/gpus.rst index 924e226..661e7de 100644 --- a/content/gpus.rst +++ b/content/gpus.rst @@ -101,9 +101,9 @@ and installs a few missing Python packages: Submission script that launches the container looks like this: -:download:`run_accelerate_parallel.sh `: +:download:`run_accelerate_cuda.sh `: -.. literalinclude:: /examples/run_accelerate_parallel.sh +.. literalinclude:: /examples/run_accelerate_cuda.sh :language: slurm .. tabs:: @@ -120,8 +120,9 @@ Submission script that launches the container looks like this: .. code-block:: console - $ sbatch run_accelerate_parallel.sh - $ cat accelerate_run.out + $ wget https://raw.githubusercontent.com/huggingface/accelerate/refs/heads/main/examples/nlp_example.py + $ sbatch run_accelerate_cuda.sh + $ cat accelerate_cuda.out Some weights of BertForSequenceClassification were not initialized from the model checkpoint at bert-base-cased and are newly initialized: ['classifier.bias', 'classifier.weight'] You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference. You're using a BertTokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.