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

Build Docker Image from Mac M1 machine #1633

Open
gfonseca92 opened this issue Aug 28, 2023 · 6 comments
Open

Build Docker Image from Mac M1 machine #1633

gfonseca92 opened this issue Aug 28, 2023 · 6 comments
Labels
question Further information is requested

Comments

@gfonseca92
Copy link

Hello, I am trying to build a Docker image from a model that I created using Numpyro.

However, when I try to build the Dockerfile given here I get the error message:
"No matching distribution found for jaxlib>=0.4.14 (from numpyro[cuda])"

I am using my Mac M1 to build this image. Is it related to this? How can I solve this?

Tks in advance!

@fehiepsi
Copy link
Member

fehiepsi commented Aug 28, 2023

I think you might need to update the dockerfile to

RUN pip3 install --user numpyro

@gfonseca92
Copy link
Author

Thanks! Just to make sure, my Dockerfile looks like:

# Experimental Dockerfile for CUDA-enabled numpyro
# This image should be suitable for developers on top of numpyro, or for end-users
# who wish to hit the ground running with CUDA+numpyro.
# Author/Maintainer: AndrewCSQ (web_enquiry at andrewchia dot tech)

FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04

# declare the image name
# note that this image uses Python 3.8
ENV IMG_NAME=11.2.2-cudnn8-devel-ubuntu20.04

# install python3 and pip on top of the base Ubuntu image
RUN apt update && \
    apt install python3-dev python3-pip -y

# add .local/bin to PATH for tqdm and f2py
ENV PATH=/root/.local/bin:$PATH

# # install python packages via pip
# RUN pip3 install --user \
#     # we pull wheels from google's api as per https://github.com/google/jax#installation
#     # the pre-compiled wheels that google provides work for now. This may change in the future (and necessitate building from source)
#     numpyro[cuda] -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

RUN pip3 install --user numpyro

And I still get:

Collecting numpyro
Downloading numpyro-0.13.0-py3-none-any.whl (312 kB)
Collecting tqdm
Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
ERROR: Could not find a version that satisfies the requirement jaxlib>=0.4.14 (from numpyro) (from versions: none)
ERROR: No matching distribution found for jaxlib>=0.4.14 (from numpyro)

@fehiepsi
Copy link
Member

fehiepsi commented Aug 28, 2023

Oh, I see. We no longer support python 3.8 in the last release. Could you try to find another image that includes python 3.9?

Alternatively, you can do

RUN pip3 install --user "numpyro<0.13"

@gfonseca92
Copy link
Author

gfonseca92 commented Aug 28, 2023

Did not work downgrading numpyro to <0.13

Collecting numpyro<0.13
Downloading numpyro-0.12.1-py3-none-any.whl (304 kB)
Collecting numpy
Downloading numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
ERROR: Could not find a version that satisfies the requirement jaxlib>=0.4.7 (from numpyro<0.13) (from versions: none)
ERROR: No matching distribution found for jaxlib>=0.4.7 (from numpyro<0.13)

@gfonseca92
Copy link
Author

gfonseca92 commented Aug 28, 2023

Neither this way:

FROM --platform=linux ubuntu:20.04
FROM python:3.9

# install python3 and pip on top of the base Ubuntu image
RUN apt update && \
    apt install python3-dev python3-pip -y

# add .local/bin to PATH for tqdm and f2py
ENV PATH=/root/.local/bin:$PATH

RUN pip3 install --user numpyro

As I get:

6.154 numpyro 0.3.0 depends on jaxlib==0.1.51
6.154 numpyro 0.2.4 depends on jaxlib==0.1.37
6.154 numpyro 0.2.3 depends on jaxlib==0.1.36
6.154 numpyro 0.2.2 depends on jaxlib==0.1.36
6.154 numpyro 0.2.1 depends on jaxlib==0.1.32
6.154 numpyro 0.2.0 depends on jaxlib==0.1.27
6.154 numpyro 0.1.0 depends on jaxlib>=0.1.14
6.154
6.154 To fix this you could try to:
6.154 1. loosen the range of package versions you've specified
6.154 2. remove package versions to allow pip attempt to solve the dependency conflict
6.154
6.155 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

@fehiepsi
Copy link
Member

Interesting! It looks like docker tried to install very old numpyro versions. I'm not sure why.

@fehiepsi fehiepsi added the question Further information is requested label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants