Skip to content

Commit

Permalink
Added a version 0 for the binaries repo workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatwardhan committed Sep 5, 2023
1 parent 888e4a4 commit 0b83225
Show file tree
Hide file tree
Showing 68 changed files with 87 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ with_time_logs/
*.csv
*.csv#
*.ods
*.json
*.jpg
*.jpeg
*.png
Expand Down
31 changes: 31 additions & 0 deletions binaries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"ivy": {
"compiler": [
"_compiler.so",
{
"utils": [
"III.so",
"IIV.so",
"IIX.so",
"IVI.so",
"IVV.so",
"IXI.so",
"IXV.so",
"IXX.so",
"VII.so",
"VIV.so",
"VIX.so",
"VVI.so",
"VVV.so",
"VVX.so",
"VXI.so",
"XII.so",
"XIX.so",
"XVV.so",
"XVX.so",
"XXI.so"
]
}
]
}
}
Binary file removed ivy/compiler/_compiler.so
Binary file not shown.
Binary file removed ivy/compiler/_compiler_38.so
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/III.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IIV.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IIX.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IVI.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IVV.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IXI.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IXV.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/IXX.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VII.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VIV.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VIX.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VVI.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VVV.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VVX.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/VXI.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/XII.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/XIX.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/XVV.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/XVX.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ivy/compiler/utils/XXI.so
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ packaging
nvidia-ml-py # mod_name=pynvml
diskcache
google-auth # mod_name=google.auth
urllib3<2.0
requests
pyvis
dill
55 changes: 55 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,68 @@
import setuptools
from setuptools import setup
from pathlib import Path
from packaging import tags
import os
import json
import requests
import itertools
import re
from tqdm import tqdm


def _get_paths(binaries, root_dir=""):
paths = []
if isinstance(binaries, str):
return [os.path.join(root_dir, binaries)]
elif isinstance(binaries, dict):
for k, v in binaries.items():
paths += _get_paths(v, os.path.join(root_dir, k))
else:
for i in binaries:
paths += _get_paths(i, root_dir)
return paths


def _strip(line):
return line.split(" ")[0].split("#")[0].split(",")[0]


all_tags = list(tags.sys_tags())
binaries = json.load(open("binaries.json"))
paths = _get_paths(binaries)
end = False
pbar = None
spinner = itertools.cycle(["-", "\\", "|", "/"])
print(f"Locating the binaries {next(spinner)} ", end="")


for tag in all_tags:
print(f"\rLocating the binaries {next(spinner)} ", end="")
if end:
pbar.close()
break
for i, path in enumerate(paths):
folders = path.split(os.sep)
folder_path, file_path = os.sep.join(folders[:-1]), folders[-1]
file_name = f"{file_path[:-3]}_{tag}.so"
search_path = f"compiler/{file_name}"
r = requests.get(
f"https://github.com/vedpatwardhan/ivy/raw/fixes/{search_path}",
timeout=20,
)
if r.status_code == 200:
if pbar is None:
print()
print("Downloading binaries ...")
pbar = tqdm(total=len(paths))
with open(path, "wb") as f:
f.write(r.content)
end = path == paths[-1]
pbar.update(1)
else:
break


this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text(encoding="utf-8")

Expand Down

0 comments on commit 0b83225

Please sign in to comment.