To submit a Large Language Model (LLM) Python script created on Jupyter Notebook on a High Performance Computing (HPC) system, follow these steps:
Create a Job Script:
- Write a bash script that loads the necessary modules, such as Python and Jupyter, and executes the Jupyter notebook using
nbconvert
. - Ensure the script includes the necessary directives for the HPC job scheduler, such as SLURM commands.
- Write a bash script that loads the necessary modules, such as Python and Jupyter, and executes the Jupyter notebook using
Submit the Job:
- Save the script with a
.sh
extension (e.g.,job.sh
). - Submit the job using the HPC job scheduler command, typically
sbatch job.sh
.
- Save the script with a
Here is an example of a job script:
#!/bin/bash
#SBATCH --nodes=1
module load conda
source activate jupyter-env
srun jupyter nbconvert --to notebook --execute mynotebook.ipynb
This script loads the necessary modules, activates the Jupyter environment, and executes the Jupyter notebook using nbconvert
.
- Monitor the Job:
- Check the job status using the HPC job scheduler commands, such as
squeue
orsacct
. - Verify the output file generated by the job, typically named
slurm-<job_id>.out
.
- Check the job status using the HPC job scheduler commands, such as
By following these steps, you can successfully submit and run your LLM Python script created on Jupyter Notebook on an HPC system.