-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add support for ParMETIS to local Dockerfile #1102
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ARG DEVICE=gpu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you got any number about time to build the docker image here? I think a big burden here is that the time for building parmetis docker image will be too long, and also make the docker image itself too large. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ParMETIS dependencies are or added if requested by the user, the build time should be roughly the same as building the ParMETIS image using the specialized Dockerfile. Could you clarify if there's a concern I'm missing here? I will add some measurements of build times for the images using the specialized Dockerfile vs. this one. |
||
ARG USE_PARMETIS=false | ||
ARG SOURCE | ||
|
||
FROM ${SOURCE} as base | ||
|
@@ -48,6 +49,12 @@ ARG OGB_VERSION=1.3.6 | |
ARG TORCH_VERSION=2.3 | ||
ARG TRANSFORMERS_VERSION=4.28.1 | ||
|
||
# Download dgl files | ||
RUN cd /root; git clone --branch v${DGL_VERSION} --single-branch https://github.com/dmlc/dgl.git | ||
ENV DGL_HOME=/root/dgl | ||
ENV DGLBACKEND=pytorch | ||
ENV PYTHONPATH="/root/dgl/tools/:${PYTHONPATH}" | ||
|
||
FROM base as base-cpu | ||
|
||
# Install torch, DGL, and GSF deps that require torch | ||
|
@@ -75,18 +82,50 @@ RUN TORCH_MAJOR_MINOR=$(echo $TORCH_VERSION | cut -c1-3) && \ | |
transformers==${TRANSFORMERS_VERSION} \ | ||
&& rm -rf /root/.cache | ||
|
||
FROM base-${DEVICE} as runtime | ||
FROM base-${DEVICE} as parmetis-true | ||
|
||
ENV PYTHONPATH="/root/dgl/tools/:${PYTHONPATH}" | ||
# Install MPI and dependencies | ||
RUN apt update && apt install -y --no-install-recommends \ | ||
build-essential \ | ||
cmake \ | ||
libopenmpi-dev \ | ||
openmpi-bin \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Download DGL source code | ||
RUN cd /root; git clone --branch v${DGL_VERSION} https://github.com/dmlc/dgl.git | ||
RUN pip install \ | ||
pyyaml \ | ||
&& rm -rf /root/.cache | ||
|
||
# Copy GraphStorm source and add to PYTHONPATH | ||
RUN mkdir -p /graphstorm | ||
COPY code/python/graphstorm /graphstorm/python/graphstorm | ||
ENV PYTHONPATH="/graphstorm/python/:${PYTHONPATH}" | ||
# Install GKLib | ||
RUN cd /root && \ | ||
git clone --single-branch --branch master https://github.com/KarypisLab/GKlib && \ | ||
cd GKlib && \ | ||
make && \ | ||
make install | ||
|
||
# Install Metis | ||
RUN cd /root && \ | ||
git clone --single-branch --branch master https://github.com/KarypisLab/METIS.git && \ | ||
cd METIS && \ | ||
make config shared=1 cc=gcc prefix=/root/local i64=1 && \ | ||
make install | ||
|
||
# Install Parmetis | ||
RUN cd /root && \ | ||
git clone --single-branch --branch main https://github.com/KarypisLab/PM4GNN.git && \ | ||
cd PM4GNN && \ | ||
make config cc=mpicc prefix=/root/local && \ | ||
make install | ||
|
||
ENV PATH=$PATH:/root/local/bin | ||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/local/lib/ | ||
RUN cp /root/local/bin/pm_dglpart /root/local/bin/pm_dglpart3 | ||
thvasilo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
FROM base-${DEVICE} as parmetis-false | ||
|
||
# No additional dependencies when not supporting ParMETIS | ||
|
||
FROM parmetis-${USE_PARMETIS} as runtime | ||
|
||
# Set up SSH access | ||
ENV SSH_PORT=2222 | ||
|
@@ -101,11 +140,18 @@ RUN mkdir -p ${SSHDIR} \ | |
|
||
EXPOSE ${SSH_PORT} | ||
|
||
# Copy GraphStorm source and add to PYTHONPATH | ||
RUN mkdir -p /graphstorm | ||
COPY code/python/graphstorm /graphstorm/python/graphstorm | ||
ENV PYTHONPATH="/graphstorm/python/:${PYTHONPATH}" | ||
|
||
|
||
# Copy GraphStorm scripts and tools | ||
COPY code/examples /graphstorm/examples | ||
COPY code/inference_scripts /graphstorm/inference_scripts | ||
COPY code/tools /graphstorm/tools | ||
COPY code/training_scripts /graphstorm/training_scripts | ||
COPY code/fetch_and_run.sh /graphstorm/fetch_and_run.sh | ||
RUN chmod +x "/graphstorm/fetch_and_run.sh" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason we need to do this now? |
||
|
||
CMD ["/usr/sbin/sshd", "-D"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We better to note the option here in the doc. We have changed the way to build docker image here.