-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execute pytorch version lookup on the bench environment
- Loading branch information
pierre.delaunay
committed
Nov 28, 2023
1 parent
6fe9b71
commit d381abd
Showing
7 changed files
with
127 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
def get_pytorch_version(): | ||
def clean(k: str): | ||
pad = " - " | ||
if k.startswith(pad): | ||
return k[len(pad) :].strip() | ||
return k.strip() | ||
|
||
def find_config(lines, key): | ||
for line in lines: | ||
if key in line: | ||
return clean(line) | ||
|
||
return None | ||
|
||
def parse_build_settings(settings): | ||
flags = dict() | ||
|
||
if settings is None: | ||
return flags | ||
|
||
_, settings = settings.split(":") | ||
for setting in settings.split(","): | ||
try: | ||
k, v = setting.split("=", maxsplit=1) | ||
flags[k.strip()] = v.strip() | ||
except ValueError: | ||
pass | ||
|
||
return flags | ||
|
||
try: | ||
import torch | ||
|
||
conf = torch.__config__.show().split("\n") | ||
|
||
compiler = conf[1] | ||
cpp = find_config(conf, "C++ Version") | ||
intel = find_config(conf, "oneAPI") | ||
mkl = find_config(conf, "OpenMP") | ||
openmp = find_config(conf, "OpenMP") | ||
lapack = find_config(conf, "LAPACK") | ||
nnpack = find_config(conf, "NNPACK") | ||
cpu = find_config(conf, "CPU") | ||
build_settings = find_config(conf, "Build settings") | ||
|
||
return dict( | ||
torch=torch.__version__, | ||
compiler=clean(compiler), | ||
cpp=clean(cpp), | ||
intel=clean(intel), | ||
mkl=clean(mkl), | ||
openmp=clean(openmp), | ||
lapack=clean(lapack), | ||
nnpack=clean(nnpack), | ||
cpu=clean(cpu), | ||
build_settings=parse_build_settings(build_settings), | ||
) | ||
|
||
except ImportError: | ||
return dict() | ||
|
||
|
||
if __name__ == "__main__": | ||
import json | ||
|
||
print(json.dumps(get_pytorch_version())) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
|
||
WORKSPACE="$(pwd)/workspace" | ||
|
||
|
||
ARCH="cuda" | ||
PYTHON="3.9" | ||
BRANCH="master" | ||
ORIGIN="https://github.com/mila-iqia/milabench.git" | ||
LOC="$SLURM_TMPDIR" | ||
CONFIG="$(pwd)/config/standard.yaml" | ||
BASE="$WORKSPACE" | ||
|
||
export HF_HOME=$BASE/cache | ||
export HF_DATASETS_CACHE=$BASE/cache | ||
export TORCH_HOME=$BASE/cache | ||
export XDG_CACHE_HOME=$BASE/cache | ||
|
||
export MILABENCH_GPU_ARCH=$ARCH | ||
export MILABENCH_DASH=no | ||
export PYTHONUNBUFFERED=1 | ||
export MILABENCH_BASE=$BASE | ||
export MILABENCH_CONFIG=$CONFIG | ||
|
||
# . scripts/schedule.sh && milabench run --select resnet50 |