Skip to content

Commit

Permalink
#357 monai-full - onnx dep
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelToman committed Nov 28, 2024
1 parent f29b077 commit 2d04ea3
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 19 deletions.
6 changes: 3 additions & 3 deletions 357_Synthcity/2023b_v0.2.11_new/monai-2023b-full/dep_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ greenlet 3.1.1
grpcio 1.67.1
gunicorn 23.0.0
h5py 3.12.1
huggingface-hub 0.26.2
huggingface-hub 0.26.2 -> OK
idna 3.10
imagecodecs 2024.9.22
imagecodecs 2024.9.22 -> HAVE 2024.6.1
imageio 2.36.0
importlib_metadata 8.4.0
itk 5.4.0 -> HAVE 5.3.0
Expand Down Expand Up @@ -72,7 +72,7 @@ mpmath 1.3.0
networkx 3.4.2
nibabel 5.3.2 -> OK created
ninja 1.11.1.1
nni 3.0
nni 3.0 -> ok
nptyping 2.5.0
numcodecs 0.13.1
numpy 1.26.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,39 @@ github_account = 'Project-MONAI'
# pytype>=2020.6.1; platform_system != "Windows"
# types-setuptools
# mypy>=1.5.0, <1.12.0
# ninja
# OK ninja
# OK torchvision
# OK psutil - v5.9.6 in pypi bundle
# X cucim-cu12; platform_system == "Linux" and python_version >= "3.9" and python_version <= "3.10"
# OK CREATED openslide-python + CREATED OpenSlide-4.0.0
# CREATE imagecodecs; platform_system == "Linux" or platform_system == "Darwin"
# OK CREATED imagecodecs; platform_system == "Linux" or platform_system == "Darwin"
# OK tifffile; platform_system == "Linux" or platform_system == "Darwin" in scikit-image
# OK pandas
# requests
# OK CREATED einops
# OK transformers>=4.36.0, <4.41.0; python_version <= '3.10'
# OK CREATED mlflow>=2.12.2
# clearml>=1.10.0rc0
# matplotlib>=3.6.3
# tensorboardX
# OK CREATED clearml>=1.10.0rc0
# OK matplotlib>=3.6.3
# OK tensorboardX
# types-PyYAML
# OK pyyaml
# ok fire
# OK jsonschema - v4.17.3 in pypi bundle
# pynrrd
# pre-commit
# OK CREATED pydicom - in NiBabel
# h5py
# nni==2.10.1; platform_system == "Linux" and "arm" not in platform_machine and "aarch" not in platform_machine
# optuna
# OK h5py
# ok nni==2.10.1; platform_system == "Linux" and "arm" not in platform_machine and "aarch" not in platform_machine
# OK optuna
# git+https://github.com/Project-MONAI/MetricsReloaded@monai-support#egg=MetricsReloaded
# onnx>=1.13.0
# onnxruntime; python_version <= '3.10'
# OK CREATED onnx>=1.13.0
# typeguard<3 # https://github.com/microsoft/nni/issues/5457
# filelock<3.12.0 # https://github.com/microsoft/nni/issues/5523
# zarr
# lpips==0.1.4
# nvidia-ml-py
# huggingface_hub
# ok huggingface_hub
# pyamg>=5.0.0
# git+https://github.com/facebookresearch/segment-anything.git@6fdee8f2727f4506cfbbe553e23b895e27956588
# onnx_graphsurgeon
Expand Down Expand Up @@ -109,17 +108,18 @@ github_account = 'Project-MONAI'


# extras: not in local_pip_extras now
# [ cucim (some cuda stuff, do not install),
# imagecodecs, ninja, pynrrd, h5py, nni, optuna, onnx, onnxruntime, zarr, lpips, pynvml, huggingface_hub]
# [ cucim, (some cuda stuff, do not install)
# pynvml, (NVIDIA mng lib)
# pynrrd, onnxruntime, zarr, lpips, ]

# ORIGINAL from 5.3.0
# local_pip_extras = "einops,fire,gdown,ignite,itk,jsonschema,lmdb,nibabel,pydicom,"
# local_pip_extras += "openslide,pandas,pillow,psutil,pyyaml,scipy,"
# local_pip_extras += "skimage,tensorboard,torchvision,tqdm"

local_pip_extras = "einops,fire,gdown,ignite,scipy,tqdm,itk,jsonschema,lmdb,nibabel,pydicom,"
local_pip_extras += "openslide,pandas,pillow,psutil,pyyaml,skimage,tensorboard,torchvision,"
local_pip_extras += "transformers,mlflow,clearml,matplotlib,tensorboardX,tifffile"
local_pip_extras = "einops,fire,gdown,ignite,scipy,tqdm,itk,jsonschema,lmdb,nibabel,pydicom,ninja,h5py,optuna,"
local_pip_extras += "openslide,pandas,pillow,psutil,pyyaml,skimage,tensorboard,torchvision,_hubhuggingface,nni,"
local_pip_extras += "transformers,mlflow,clearml,matplotlib,tensorboardX,tifffile,imagecodecs,onnx"

builddependencies = [
('hatchling', '1.18.0'),
Expand Down Expand Up @@ -149,11 +149,20 @@ dependencies = [
('matplotlib', '3.8.2'),
('clearml', '1.16.5'),
('tensorboardX', '2.6.2.2'), # not merged yet
('imagecodecs', '2024.6.1'),
('h5py', '3.11.0'),
('Optuna', '3.6.1'),
('ONNX', '1.17.0'),
]

use_pip = True

exts_list = [
('nni', '3.0'),
('huggingface-hub', '0.26.2', {
'sources': ['huggingface_hub-%(version)s.tar.gz'],
'checksums': ['b100d853465d965733964d123939ba287da60a547087783ddff8a323f340332b'],
}),
('lmdb', '1.5.1', {
'checksums': ['717c255827d331e02f7242b44051aa06466c90f6d732ecb07b31edfb1e06c67a'],
}),
Expand Down
62 changes: 62 additions & 0 deletions 357_Synthcity/2023b_v0.2.11_new/monai-2023b-full/onnx-2023b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
easyblock = 'PythonPackage'

name = 'ONNX'
version = '1.17.0'

homepage = 'https://onnx.ai'
description = """
Open Neural Network Exchange (ONNX) is an open ecosystem that empowers AI
developers to choose the right tools as their project evolves. ONNX provides an
open source format for AI models, both deep learning and traditional ML. It
defines an extensible computation graph model, as well as definitions of
built-in operators and standard data types. Currently we focus on the
capabilities needed for inferencing (scoring)."""

toolchain = {'name': 'gfbf', 'version': '2023b'}

sources = [SOURCELOWER_TAR_GZ]
patches = ['ONNX-1.15.0_fix-protobuf-linking.patch']
checksums = [
{'onnx-1.15.0.tar.gz': 'b18461a7d38f286618ca2a6e78062a2a9c634ce498e631e708a8041b00094825'},
{'ONNX-1.15.0_fix-protobuf-linking.patch': '5c11eca5275a25d69f989571fe1f387b84c7334478356577f6f6349c5954f54d'},
]

builddependencies = [
('CMake', '3.27.6'),
]

dependencies = [
('Python', '3.11.5'),
('SciPy-bundle', '2023.11'),
('protobuf-python', '4.25.3'),
('typing-extensions', '4.10.0'),
]

use_pip = True
download_dep_fail = True

# hardcode version in pyproject.toml rather than determining it dynamically
preinstallopts = """sed -i 's/"version",//g' pyproject.toml && """
preinstallopts += """sed -i 's/readme = .*/version = "%(version)s"/g' pyproject.toml && """

# specify C++17 standard and link to protobuf shared library (also requires patch to use -DPROTOBUF_USE_DLLS);
# required to fix "error: 'string_view' in namespace 'std' does not name a type",
# see also https://github.com/onnx/onnx/issues/5430
preinstallopts += "export CMAKE_ARGS='-DCMAKE_CXX_STANDARD=17 -DONNX_USE_PROTOBUF_SHARED_LIBS=ON' && "

preinstallopts += 'env MAX_JOBS="%(parallel)s"'

sanity_check_paths = {
'files': ['bin/check-model', 'bin/check-node', 'bin/backend-test-tools'],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

sanity_check_commands = [
('check-model', '-h'),
('check-node', '-h'),
('backend-test-tools', '-h'),
]

sanity_pip_check = True

moduleclass = 'devel'

0 comments on commit 2d04ea3

Please sign in to comment.