Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:mila-iqia/milabench into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre.delaunay committed Sep 4, 2024
2 parents ef74bf8 + 4de3f7b commit 59909e0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
2 changes: 2 additions & 0 deletions benchmarks/diffusion/main.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

from dataclasses import dataclass

from accelerate import Accelerator
Expand Down
29 changes: 22 additions & 7 deletions config/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,8 @@ _diffusion:
inherits: _defaults
definition: ../benchmarks/diffusion
install_group: torch
plan:
method: njobs
n: 1
tags:
- diffusion

argv:
--num_epochs: 5
Expand All @@ -408,10 +407,13 @@ diffusion-single:
inherits: _diffusion
num_machines: 1
plan:
method: njobs
method: per_gpu

diffusion-gpus:
inherits: _diffusion
plan:
method: njobs
n: 1
num_machines: 1

diffusion-nodes:
Expand All @@ -426,6 +428,8 @@ _lightning:
inherits: _defaults
definition: ../benchmarks/lightning
install_group: torch
tags:
- lightning
argv:
--epochs: 10
--num-workers: "auto({n_worker}, 8)"
Expand All @@ -452,6 +456,9 @@ _dinov2:
definition: ../benchmarks/dinov2
install_group: torch
num_machines: 1
tags:
- image
- transformer
plan:
method: njobs
n: 1
Expand Down Expand Up @@ -505,7 +512,9 @@ _llm:
voir:
options:
stop: 30

tags:
- nlp
- llm
max_duration: 1200
num_machines: 1
inherits: _defaults
Expand All @@ -517,7 +526,6 @@ llm-lora-single:
inherits: _llm
plan:
method: per_gpu

argv:
"{milabench_code}/recipes/lora_finetune_single_device.py": true
--config: "{milabench_code}/configs/llama3_8B_lora_single_device.yaml"
Expand Down Expand Up @@ -664,6 +672,10 @@ ppo:

_geo_gnn:
inherits: _defaults
tags:
- graph
# FIXME: torch cluster is laging behind pytorch
# we are forced to use torch==2.3 instead of torch==2.4
install_group: gnn
group: geo_gnn
definition: ../benchmarks/geo_gnn
Expand All @@ -682,6 +694,8 @@ recursiongfn:
definition: ../benchmarks/recursiongfn
install_group: gnn
group: recursiongfn_gnn
tags:
- graph
plan:
method: per_gpu

Expand All @@ -698,7 +712,8 @@ torchatari:
install_group: torch
plan:
method: per_gpu

tags:
- rl
argv:
--num-minibatches: 16
--update-epochs: 4
Expand Down
1 change: 1 addition & 0 deletions milabench/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
__tag__ = "v0.1.0-28-g8069946"
__commit__ = "8069946d331fb92090057d7eedd598515249521d"
__date__ = "2024-08-01 12:39:13 -0400"

12 changes: 9 additions & 3 deletions milabench/scripts/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ def retrieve_git_versions(tag="<tag>", commit="<commit>", date="<date>"):
}


def version_file():
return os.path.join(ROOT, "milabench", "_version.py")

def read_previous():
info = ["<tag>", "<commit>", "<date>"]

with open(os.path.join(ROOT, "milabench", "_version.py"), "r") as file:

if not os.path.exists(version_file()):
return info

with open(version_file(), "r") as file:
for line in file.readlines():
if "tag" in line:
_, v = line.split("=")
Expand All @@ -49,7 +55,7 @@ def read_previous():
def update_version_file():
version_info = retrieve_git_versions(*read_previous())

with open(os.path.join(ROOT, "milabench", "_version.py"), "w") as file:
with open(version_file(), "w") as file:
file.write('"""')
file.write("This file is generated, do not modify")
file.write('"""\n\n')
Expand Down

0 comments on commit 59909e0

Please sign in to comment.