***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LLM Finetuning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eurocc_pub
LLM Finetuning
Commits
ad1ff5ef
Commit
ad1ff5ef
authored
1 year ago
by
Pfister, Martin
Browse files
Options
Downloads
Patches
Plain Diff
Remove CPU affinity again (no time difference for DDP)
parent
1dcdc510
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
mistral7b-bnb/mistral7b_train.py
+0
-23
0 additions, 23 deletions
mistral7b-bnb/mistral7b_train.py
with
0 additions
and
23 deletions
mistral7b-bnb/mistral7b_train.py
+
0
−
23
View file @
ad1ff5ef
# https://saankhya.medium.com/mistral-instruct-7b-finetuning-on-medmcqa-dataset-6ec2532b1ff1
import
psutil
import
torch
from
accelerate
import
PartialState
from
datasets
import
load_dataset
...
...
@@ -12,26 +11,6 @@ import medmcqa_helper
import
gpu_helper
def
lumi_set_cpu_affinity
(
local_rank
):
LUMI_GPU_CPU_map
=
{
# A mapping from GCD to the closest CPU cores in a LUMI-G node
# Note that CPU cores 0, 8, 16, 24, 32, 40, 48, 56 are reserved for the
# system and not available for the user
# See https://docs.lumi-supercomputer.eu/hardware/lumig/
0
:
[
49
,
50
,
51
,
52
,
53
,
54
,
55
],
1
:
[
57
,
58
,
59
,
60
,
61
,
62
,
63
],
2
:
[
17
,
18
,
19
,
20
,
21
,
22
,
23
],
3
:
[
25
,
26
,
27
,
28
,
29
,
30
,
31
],
4
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
],
5
:
[
9
,
10
,
11
,
12
,
13
,
14
,
15
],
6
:
[
33
,
34
,
35
,
36
,
37
,
38
,
39
],
7
:
[
41
,
42
,
43
,
44
,
45
,
46
,
47
],
}
cpu_list
=
LUMI_GPU_CPU_map
[
local_rank
]
print
(
f
"
Local rank
{
local_rank
}
binding to cpus:
{
cpu_list
}
"
)
psutil
.
Process
().
cpu_affinity
(
cpu_list
)
model_id
=
'
mistralai/Mistral-7B-Instruct-v0.3
'
tokenizer
=
AutoTokenizer
.
from_pretrained
(
model_id
)
...
...
@@ -54,8 +33,6 @@ num_processes = ps.num_processes
process_index
=
ps
.
process_index
local_process_index
=
ps
.
local_process_index
lumi_set_cpu_affinity
(
local_process_index
)
model
=
AutoModelForCausalLM
.
from_pretrained
(
model_id
,
quantization_config
=
quantization_config
,
...
...
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