Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Fidle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Talks
Fidle
Commits
a8e84281
Commit
a8e84281
authored
4 years ago
by
Jean-Luc Parouty
Browse files
Options
Downloads
Patches
Plain Diff
Update presentation
parent
b0e3ba38
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GTSRB/06-Notebook-as-a-batch.ipynb
+16
-147
16 additions, 147 deletions
GTSRB/06-Notebook-as-a-batch.ipynb
with
16 additions
and
147 deletions
GTSRB/06-Notebook-as-a-batch.ipynb
+
16
−
147
View file @
a8e84281
...
@@ -31,117 +31,7 @@
...
@@ -31,117 +31,7 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"### Step 1 - Import and init \n",
"## Step 1 - How to run a notebook as a batch ?\n",
"Not really useful here ;-)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style>\n",
"\n",
"div.warn { \n",
" background-color: #fcf2f2;\n",
" border-color: #dFb5b4;\n",
" border-left: 5px solid #dfb5b4;\n",
" padding: 0.5em;\n",
" font-weight: bold;\n",
" font-size: 1.1em;;\n",
" }\n",
"\n",
"\n",
"\n",
"div.nota { \n",
" background-color: #DAFFDE;\n",
" border-left: 5px solid #92CC99;\n",
" padding: 0.5em;\n",
" }\n",
"\n",
"div.todo:before { content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9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LC4xMTc1LTEuMzQyMmwuODI1NC0uODI1NEExLjA1NjgsMS4wNTY4LDAsMCwxLDM0LjMyNDUsOS4zNmwxLjE0NDIuODAxOUE3LjEzNTUsNy4xMzU1LDAsMCwxLDM3LjE4LDkuNDUxbC4yNDE2LTEuMzcyNGExLjA1NjgsMS4wNTY4LDAsMCwxLDEuMDQtLjg3NTdoMS4xNjc3YTEuMDU2OSwxLjA1NjksMCwwLDEsMS4wNC44NzU3bC4yNDE2LDEuMzcyNGE3LjEyNSw3LjEyNSwwLDAsMSwxLjcxMTIuNzExM0w0My43NjY2LDkuMzZBMS4wNTY5LDEuMDU2OSwwLDAsMSw0NS4xMjU1LDkuNDY3N1ptLTIuMDMsNi44OTg3QTQuMDQzMyw0LjA0MzMsMCwxLDAsMzkuMDUyMywyMC40MWgwQTQuMDQ2NSw0LjA0NjUsMCwwLDAsNDMuMDk1NSwxNi4zNjY0WiIgc3R5bGU9ImZpbGw6I2UxMjIyOSIvPjxwb2x5Z29uIHBvaW50cz0iMzkuNDEzIDM0Ljc1NyAzOS41MzcgMzQuNzU3IDM5LjY3NSAzNC43NTcgMzkuNjc1IDEwOS41MSAzOS41MzcgMTA5LjUxIDM5LjQxMyAxMDkuNTEgMzkuNDEzIDM0Ljc1NyAzOS40MTMgMzQuNzU3IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojOTk5O3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO3N0cm9rZS13aWR0aDowLjMwODg1NDQ1MDU2MDE2MThweDtmaWxsLXJ1bGU6ZXZlbm9kZCIvPjwvc3ZnPg==);\n",
" float:left;\n",
" margin-right:20px;\n",
" margin-top:-20px;\n",
" margin-bottom:20px;\n",
"}\n",
"div.todo{\n",
" font-weight: bold;\n",
" font-size: 1.1em;\n",
" margin-top:40px;\n",
"}\n",
"div.todo ul{\n",
" margin: 0.2em;\n",
"}\n",
"div.todo li{\n",
" margin-left:60px;\n",
" margin-top:0;\n",
" margin-bottom:0;\n",
"}\n",
"\n",
"div .comment{\n",
" font-size:0.8em;\n",
" color:#696969;\n",
"}\n",
"\n",
"\n",
"\n",
"</style>\n",
"\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"<br>**FIDLE 2020 - Practical Work Module**"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Version : 1.2b1 DEV\n",
"Notebook id : GTSRB6\n",
"Run time : Thursday 7 January 2021, 15:41:17\n",
"TensorFlow version : 2.2.0\n",
"Keras version : 2.3.0-tf\n",
"Datasets dir : /home/pjluc/datasets/fidle\n",
"Run dir : ./run\n",
"Update keras cache : False\n",
"Save figs : True\n",
"Path figs : ./run/figs\n"
]
}
],
"source": [
"import sys\n",
"\n",
"sys.path.append('..')\n",
"import fidle.pwk as pwk\n",
"\n",
"datasets_dir = pwk.init('GTSRB6')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 2 - How to run a notebook as a batch ?\n",
"\n",
"\n",
"Two simple solutions are possible :-)\n",
"Two simple solutions are possible :-)\n",
"\n",
"\n",
...
@@ -173,16 +63,16 @@
...
@@ -173,16 +63,16 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"## Step
3
- Run as a script\n",
"## Step
2
- Run as a script\n",
"\n",
"\n",
"Maybe not always the best solution, but this solution is very rustic ! \n",
"Maybe not always the best solution, but this solution is very rustic ! \n",
"\n",
"\n",
"###
3
.1 - Convert to IPython script :"
"###
2
.1 - Convert to IPython script :"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
2
,
"execution_count":
1
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -190,8 +80,8 @@
...
@@ -190,8 +80,8 @@
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"[NbConvertApp] Converting notebook 05-Full-convolutions.ipynb to script\n",
"[NbConvertApp] Converting notebook 05-Full-convolutions.ipynb to script\n",
"[NbConvertApp] Writing 128
5
4 bytes to 05-full_convolutions.py\n",
"[NbConvertApp] Writing 12
9
84 bytes to 05-full_convolutions.py\n",
"-rw-r--r-- 1
pjluc pjluc
128
5
4 Jan
7 15:41
05-full_convolutions.py\n"
"-rw-r--r-- 1
uja62cb mlh
12
9
84 Jan
28 11:35
05-full_convolutions.py\n"
]
]
}
}
],
],
...
@@ -206,9 +96,9 @@
...
@@ -206,9 +96,9 @@
"source": [
"source": [
"### 2.2 - Batch submission\n",
"### 2.2 - Batch submission\n",
"\n",
"\n",
"See the two examples of bash launch script :\n",
"
See the two examples of bash launch script :\n",
" -
`
batch_slurm.sh
`
using Slurm (like at IDRIS)\n",
" -
[
batch_slurm.sh
](batch_slurm.sh)
using Slurm (like at IDRIS)\n",
" -
`
batch_oar.sh
`
using OAR (like at GRICAD)"
" -
[
batch_oar.sh
](batch_oar.sh)
using OAR (like at GRICAD)"
]
]
},
},
{
{
...
@@ -267,40 +157,19 @@
...
@@ -267,40 +157,19 @@
"```\n"
"```\n"
]
]
},
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"End time is : Thursday 7 January 2021, 15:41:18\n",
"Duration is : 00:00:01 101ms\n",
"This notebook ends here\n"
]
}
],
"source": [
"pwk.end()"
]
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"----\n",
"----\n",
"<div class='todo'>\n",
"**What you can do :**\n",
" Your mission if you accept it: Run our full_convolution code in batch mode.<br>\n",
"\n",
"(If you have a calculation environment with a scheduler...)\n",
"Your mission if you accept it: Run our full_convolution code in batch mode.<br>\n",
" For that :\n",
" For that :\n",
" <ul>\n",
" - Validate the full_convolution notebook on short tests</li>\n",
" <li>Validate the full_convolution notebook on short tests</li>\n",
" - Submit it in batch mode for validation</li>\n",
" <li>Submit it in batch mode for validation</li>\n",
" - Modify the notebook for a full run and submit it :-)</li>\n"
" <li>Modify the notebook for a full run and submit it :-)</li>\n",
" </ul>\n",
" \n",
"</div>"
]
]
},
},
{
{
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
<img
width=
"800px"
src=
"../fidle/img/00-Fidle-header-01.svg"
></img>
<img
width=
"800px"
src=
"../fidle/img/00-Fidle-header-01.svg"
></img>
# <!-- TITLE --> [GTSRB6] - Full convolutions as a batch
# <!-- TITLE --> [GTSRB6] - Full convolutions as a batch
<!-- DESC -->
Episode 6 : To compute bigger, use your notebook in batch mode
<!-- DESC -->
Episode 6 : To compute bigger, use your notebook in batch mode
<!-- AUTHOR : Jean-Luc Parouty (CNRS/SIMaP) -->
<!-- AUTHOR : Jean-Luc Parouty (CNRS/SIMaP) -->
## Objectives :
## Objectives :
-
Run a notebook code as a
**job**
-
Run a notebook code as a
**job**
-
Follow up with Tensorboard
-
Follow up with Tensorboard
The German Traffic Sign Recognition Benchmark (GTSRB) is a dataset with more than 50,000 photos of road signs from about 40 classes.
The German Traffic Sign Recognition Benchmark (GTSRB) is a dataset with more than 50,000 photos of road signs from about 40 classes.
The final aim is to recognise them !
The final aim is to recognise them !
Description is available there : http://benchmark.ini.rub.de/?section=gtsrb&subsection=dataset
Description is available there : http://benchmark.ini.rub.de/?section=gtsrb&subsection=dataset
## What we're going to do :
## What we're going to do :
Our main steps:
Our main steps:
-
Run Full-convolution.ipynb as a batch :
-
Run Full-convolution.ipynb as a batch :
-
Notebook mode
-
Notebook mode
-
Script mode
-
Script mode
-
Tensorboard follow up
-
Tensorboard follow up
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
### Step 1 - Import and init
## Step 1 - How to run a notebook as a batch ?
Not really useful here ;-)
%% Cell type:code id: tags:
```
python
import
sys
sys
.
path
.
append
(
'
..
'
)
import
fidle.pwk
as
pwk
datasets_dir
=
pwk
.
init
(
'
GTSRB6
'
)
```
%% Output
<br>**FIDLE 2020 - Practical Work Module**
Version : 1.2b1 DEV
Notebook id : GTSRB6
Run time : Thursday 7 January 2021, 15:41:17
TensorFlow version : 2.2.0
Keras version : 2.3.0-tf
Datasets dir : /home/pjluc/datasets/fidle
Run dir : ./run
Update keras cache : False
Save figs : True
Path figs : ./run/figs
%% Cell type:markdown id: tags:
## Step 2 - How to run a notebook as a batch ?
Two simple solutions are possible :-)
Two simple solutions are possible :-)
-
**Option 1 - As a notebook ! (a good choice)**
-
**Option 1 - As a notebook ! (a good choice)**
Very simple.
Very simple.
The result is the executed notebook, so we can retrieve all the cell'soutputs of the notebook :
The result is the executed notebook, so we can retrieve all the cell'soutputs of the notebook :
```
jupyter nbconvert (...) --to notebook --execute <notebook>```
```
jupyter nbconvert (...) --to notebook --execute <notebook>```
Example :
Example :
```
jupyter nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --execute my_notebook.ipynb'
```
```
jupyter nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --execute my_notebook.ipynb'
```
The result will be a notebook: 'my_notebook.nbconvert.ipynb'.
The result will be a notebook: 'my_notebook.nbconvert.ipynb'.
See: [nbconvert documentation](https://nbconvert.readthedocs.io/en/latest/usage.html#convert-notebook)
See: [nbconvert documentation](https://nbconvert.readthedocs.io/en/latest/usage.html#convert-notebook)
- **Option 2 - As a script**
- **Option 2 - As a script**
Very simple too, but with some constraints on the notebook.
Very simple too, but with some constraints on the notebook.
We will convert the notebook to a Python script (IPython, to be precise) :
We will convert the notebook to a Python script (IPython, to be precise) :
```
jupyter nbconvert --to script
<notebook>
```
```
jupyter nbconvert --to script
<notebook>
```
Then we can execute this script :
Then we can execute this script :
```
ipython
<script>
```
```
ipython
<script>
```
See: [nbconvert documentation](https://nbconvert.readthedocs.io/en/latest/usage.html#executable-script)
See: [nbconvert documentation](https://nbconvert.readthedocs.io/en/latest/usage.html#executable-script)
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Step
3
- Run as a script
## Step
2
- Run as a script
Maybe not always the best solution, but this solution is very rustic !
Maybe not always the best solution, but this solution is very rustic !
###
3
.1 - Convert to IPython script :
###
2
.1 - Convert to IPython script :
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
! jupyter nbconvert --to script --output='05-full_convolutions' '05-Full-convolutions.ipynb'
! jupyter nbconvert --to script --output='05-full_convolutions' '05-Full-convolutions.ipynb'
! ls -l
*
.py
! ls -l
*
.py
```
```
%% Output
%% Output
[NbConvertApp] Converting notebook 05-Full-convolutions.ipynb to script
[NbConvertApp] Converting notebook 05-Full-convolutions.ipynb to script
[NbConvertApp] Writing 128
5
4 bytes to 05-full_convolutions.py
[NbConvertApp] Writing 12
9
84 bytes to 05-full_convolutions.py
-rw-r--r-- 1
pjluc pjluc
128
5
4 Jan
7 15:41
05-full_convolutions.py
-rw-r--r-- 1
uja62cb mlh
12
9
84 Jan
28 11:35
05-full_convolutions.py
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
### 2.2 - Batch submission
### 2.2 - Batch submission
See the two examples of bash launch script :
See the two examples of bash launch script :
-
`
batch_slurm.sh
`
using Slurm (like at IDRIS)
-
[
batch_slurm.sh
](batch_slurm.sh)
using Slurm (like at IDRIS)
-
`
batch_oar.sh
`
using OAR (like at GRICAD)
-
[
batch_oar.sh
](batch_oar.sh)
using OAR (like at GRICAD)
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
#### Example at IDRIS
#### Example at IDRIS
On the frontal :
On the frontal :
```
bash
```
bash
# hostname
# hostname
jean-zay2
jean-zay2
# sbatch $WORK/fidle/GTSRB/batch_slurm.sh
# sbatch $WORK/fidle/GTSRB/batch_slurm.sh
Submitted batch job 249794
Submitted batch job 249794
#squeue -u $USER
#squeue -u $USER
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
249794 gpu_p1 GTSRB Fu uja62cb PD 0:00 1 (Resources)
249794 gpu_p1 GTSRB Fu uja62cb PD 0:00 1 (Resources)
# ls -l _batch/
# ls -l _batch/
total 32769
total 32769
-rw-r--r-- 1 uja62cb gensim01 13349 Sep 10 11:32 GTSRB_249794.err
-rw-r--r-- 1 uja62cb gensim01 13349 Sep 10 11:32 GTSRB_249794.err
-rw-r--r-- 1 uja62cb gensim01 489 Sep 10 11:31 GTSRB_249794.out
-rw-r--r-- 1 uja62cb gensim01 489 Sep 10 11:31 GTSRB_249794.out
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
#### Example at GRICAD
#### Example at GRICAD
Have to be done on the frontal :
Have to be done on the frontal :
```
bash
```
bash
# hostname
# hostname
f-dahu
f-dahu
# pwd
# pwd
/home/paroutyj
/home/paroutyj
# oarsub -S ~/fidle/GTSRB/batch_oar.sh
# oarsub -S ~/fidle/GTSRB/batch_oar.sh
[GPUNODE] Adding gpu node restriction
[GPUNODE] Adding gpu node restriction
[ADMISSION RULE] Modify resource description with type constraints
[ADMISSION RULE] Modify resource description with type constraints
#oarstat -u
#oarstat -u
Job id S User Duration System message
Job id S User Duration System message
--------- - -------- ---------- ------------------------------------------------
--------- - -------- ---------- ------------------------------------------------
5878410 R paroutyj 0:19:56 R=8,W=1:0:0,J=I,P=fidle,T=gpu (Karma=0.005,quota_ok)
5878410 R paroutyj 0:19:56 R=8,W=1:0:0,J=I,P=fidle,T=gpu (Karma=0.005,quota_ok)
5896266 W paroutyj 0:00:00 R=8,W=1:0:0,J=B,N=Full convolutions,P=fidle,T=gpu
5896266 W paroutyj 0:00:00 R=8,W=1:0:0,J=B,N=Full convolutions,P=fidle,T=gpu
# ls -l
# ls -l
total 8
total 8
-rw-r--r-- 1 paroutyj l-simap 0 Feb 28 15:58 batch_oar_5896266.err
-rw-r--r-- 1 paroutyj l-simap 0 Feb 28 15:58 batch_oar_5896266.err
-rw-r--r-- 1 paroutyj l-simap 5703 Feb 28 15:58 batch_oar_5896266.out
-rw-r--r-- 1 paroutyj l-simap 5703 Feb 28 15:58 batch_oar_5896266.out
```
```
%% Cell type:code id: tags:
```
python
pwk.end()
```
%% Output
End time is : Thursday 7 January 2021, 15:41:18
Duration is : 00:00:01 101ms
This notebook ends here
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
----
----
<div class='todo'>
**What you can do :**
Your mission if you accept it: Run our full_convolution code in batch mode.<br>
For that :
<ul>
<li>Validate the full_convolution notebook on short tests</li>
<li>Submit it in batch mode for validation</li>
<li>Modify the notebook for a full run and submit it :-)</li>
</ul>
</div>
(If you have a calculation environment with a scheduler...)
Your mission if you accept it: Run our full_convolution code in batch mode.<br>
For that :
- Validate the full_convolution notebook on short tests</li>
- Submit it in batch mode for validation</li>
- Modify the notebook for a full run and submit it :-)</li>
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
---
---
<img width="80px" src="../fidle/img/00-Fidle-logo-01.svg"></img>
<img width="80px" src="../fidle/img/00-Fidle-logo-01.svg"></img>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment