Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
multiprocessing-examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Gepetto
multiprocessing-examples
Commits
93eb4063
Commit
93eb4063
authored
2 years ago
by
Guilhem Saurel
Browse files
Options
Downloads
Patches
Plain Diff
pfc-2g
parent
a6b60b34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pfc-2g/README.md
+5
-5
5 additions, 5 deletions
pfc-2g/README.md
pfc-2g/requirements.txt
+2
-0
2 additions, 0 deletions
pfc-2g/requirements.txt
pfc-2g/schedule.sh
+3
-0
3 additions, 0 deletions
pfc-2g/schedule.sh
pfc-2g/work.py
+4
-2
4 additions, 2 deletions
pfc-2g/work.py
with
14 additions
and
7 deletions
pfc-2g/README.md
+
5
−
5
View file @
93eb4063
# pfcalcul 2
# pfcalcul 2
- GPU
extend pfc-
1 with a venv
extend pfc-
2 for GPU use
You'll need:
-
understanding of pfc-
1
-
a copy of this example in
`/pfcalcul/work/$USER/pfc-2`
-
understanding of pfc-
2
-
a copy of this example in
`/pfcalcul/work/$USER/pfc-2
g
`
-
create a venv inside and instadd dependencies, eg.:
```
bash
cd
/pfcalcul/work/
$USER
/pfc-2
cd
/pfcalcul/work/
$USER
/pfc-2
g
python3
-m
venv venv
source
venv/bin/activate
python3
-m
pip
install
--upgrade
pip
...
...
This diff is collapsed.
Click to expand it.
pfc-2g/requirements.txt
+
2
−
0
View file @
93eb4063
pin
--extra-index-url https://download.pytorch.org/whl/cu113
torch
This diff is collapsed.
Click to expand it.
pfc-2g/schedule.sh
+
3
−
0
View file @
93eb4063
...
...
@@ -5,6 +5,9 @@
#SBATCH --mail-type=ALL
#SBATCH --output=output-%A-%a-%N.log
#SBATCH --error=output-%A-%a-%N.err
#SBATCH --gres=gpu:1
#SBATCH --partition=robgpu
#SBATCH --account=dept_rob
source
venv/bin/activate
...
...
This diff is collapsed.
Click to expand it.
pfc-2g/work.py
+
4
−
2
View file @
93eb4063
#!/usr/bin/env python3
"""
Hard work here. Not efficient, but hard.
"""
"""
Hard work here. Not efficient, but hard.
On CUDA device.
"""
from
typing
import
Tuple
import
pinocchio
as
pin
# type: ignore
import
torch
# type: ignore
def
is_prime
(
number
:
int
)
->
bool
:
"""
Check if a number is prime.
"""
return
not
any
(
number
%
i
==
0
for
i
in
range
(
2
,
number
))
t
=
torch
.
arange
(
2
,
number
,
device
=
"
cuda
"
)
return
not
bool
((
number
%
t
==
0
).
any
().
cpu
())
def
find_prime
(
goal
:
int
=
10
,
verbose
:
bool
=
False
)
->
Tuple
[
int
,
int
]:
...
...
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