Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/SK-1025 | Fix torch dependencies based on arch #701

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions examples/FedSimSiam/client/python_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ build_dependencies:
- setuptools
- wheel==0.37.1
dependencies:
- torch==2.2.0
- torchvision==0.17.0
- fedn==0.9.0
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
# PyTorch macOS x86 builds deprecation
- torch==2.2.2; sys_platform == "darwin" and platform_machine == "x86_64"
- torchvision==0.19.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torchvision==0.17.2; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64" and python_version >= "3.9") or (sys_platform == "win" or sys_platform == "linux" and python_version >= "3.9")
- numpy==1.26.4; (sys_platform == "darwin" and platform_machine == "x86_64" and python_version >= "3.9")
- numpy==1.24.4; python_version == "3.8"
- fedn
12 changes: 9 additions & 3 deletions examples/flower-client/client/python_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ build_dependencies:
- setuptools
- wheel==0.37.1
dependencies:
- torch==2.2.1
- torchvision==0.17.1
- fedn[flower]
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
# PyTorch macOS x86 builds deprecation
- torch==2.2.2; sys_platform == "darwin" and platform_machine == "x86_64"
- torchvision==0.19.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torchvision==0.17.2; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64" and python_version >= "3.9") or (sys_platform == "win" or sys_platform == "linux" and python_version >= "3.9")
- numpy==1.26.4; (sys_platform == "darwin" and platform_machine == "x86_64" and python_version >= "3.9")
- numpy==1.24.4; python_version == "3.8"
- fire==0.3.1
- fedn[flower]==0.9.0
- flwr-datasets[vision]==0.1.0
11 changes: 8 additions & 3 deletions examples/huggingface/client/python_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ build_dependencies:
- setuptools
- wheel
dependencies:
- numpy==2.0.2
- torch==2.4.1
- torchvision==0.19.1
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
# PyTorch macOS x86 builds deprecation
- torch==2.2.2; sys_platform == "darwin" and platform_machine == "x86_64"
- torchvision==0.19.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torchvision==0.17.2; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64" and python_version >= "3.9") or (sys_platform == "win" or sys_platform == "linux" and python_version >= "3.9")
- numpy==1.26.4; (sys_platform == "darwin" and platform_machine == "x86_64" and python_version >= "3.9")
- numpy==1.24.4; python_version == "3.8"
- transformers
- datasets
- fedn
7 changes: 4 additions & 3 deletions examples/mnist-pytorch-DPSGD/client/python_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ build_dependencies:
- wheel
dependencies:
- fedn
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
# PyTorch macOS x86 builds deprecation
- torch==2.2.2; sys_platform == "darwin" and platform_machine == "x86_64"
- torchvision==0.19.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torchvision==0.17.2; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- numpy==1.26.4; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64" and python_version >= "3.9") or (sys_platform == "win" or sys_platform == "linux" and python_version >= "3.9")
- numpy==1.26.4; (sys_platform == "darwin" and platform_machine == "x86_64" and python_version >= "3.9")
- numpy==1.24.4; python_version == "3.8"
- opacus
10 changes: 8 additions & 2 deletions examples/mnist-pytorch/client/python_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ build_dependencies:
- setuptools
- wheel
dependencies:
- torch
- torchvision
- fedn
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
# PyTorch macOS x86 builds deprecation
- torch==2.2.2; sys_platform == "darwin" and platform_machine == "x86_64"
- torchvision==0.19.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torchvision==0.17.2; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64" and python_version >= "3.9") or (sys_platform == "win" or sys_platform == "linux" and python_version >= "3.9")
- numpy==1.26.4; (sys_platform == "darwin" and platform_machine == "x86_64" and python_version >= "3.9")
- numpy==1.24.4; python_version == "3.8"
11 changes: 8 additions & 3 deletions examples/monai-2D-mednist/client/python_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ build_dependencies:
- setuptools
- wheel
dependencies:
- torch==2.2.1
- torchvision==0.17.1
- fedn
- torch==2.4.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
# PyTorch macOS x86 builds deprecation
- torch==2.2.2; sys_platform == "darwin" and platform_machine == "x86_64"
- torchvision==0.19.1; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "win" or sys_platform == "linux")
- torchvision==0.17.2; sys_platform == "darwin" and platform_machine == "x86_64"
- numpy==2.0.2; (sys_platform == "darwin" and platform_machine == "arm64" and python_version >= "3.9") or (sys_platform == "win" or sys_platform == "linux" and python_version >= "3.9")
- numpy==1.26.4; (sys_platform == "darwin" and platform_machine == "x86_64" and python_version >= "3.9")
- numpy==1.24.4; python_version == "3.8"
- monai-weekly[pillow, tqdm]
- numpy==1.26.4
- scikit-learn
2 changes: 1 addition & 1 deletion fedn/network/combiner/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
network_id = get_network_config()

statestore = MongoStateStore(network_id, statestore_config["mongo_config"])
repository = Repository(modelstorage_config["storage_config"])
repository = Repository(modelstorage_config["storage_config"], init_buckets=False)

modelservice = ModelService()
9 changes: 5 additions & 4 deletions fedn/network/storage/s3/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Repository:
"""Interface for storing model objects and compute packages in S3 compatible storage."""

def __init__(self, config):
def __init__(self, config, init_buckets=True):
self.model_bucket = config["storage_bucket"]
self.context_bucket = config["context_bucket"]
try:
Expand All @@ -19,9 +19,10 @@ def __init__(self, config):
# TODO: Make a plug-in solution
self.client = MINIORepository(config)

self.client.create_bucket(self.context_bucket)
self.client.create_bucket(self.model_bucket)
self.client.create_bucket(self.inference_bucket)
if init_buckets:
self.client.create_bucket(self.context_bucket)
self.client.create_bucket(self.model_bucket)
self.client.create_bucket(self.inference_bucket)

def get_model(self, model_id):
"""Retrieve a model with id model_id.
Expand Down
Loading