-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added .devcontainer setup and updated versions (#59)
* dev container env * devcontainer working * include py311 and bump minor version * update torch to 2.5.0 * add cupy dependency * jax[cuda] working * tensor_split expects tensor_indices_or_sections to be on cpu * exclude py38 with torch25 Signed-off-by: theo-barfoot <[email protected]> --------- Signed-off-by: theo-barfoot <[email protected]>
- Loading branch information
1 parent
10a0ace
commit ba06291
Showing
9 changed files
with
129 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Stage 1: NVIDIA CUDA Image | ||
ARG CUDA_VERSION=12.5.0 | ||
FROM nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu22.04 AS cuda-base | ||
|
||
# Stage 2: Miniconda setup from configuration | ||
FROM continuumio/miniconda3 AS miniconda-stage | ||
|
||
# Stage 3: Final image combining CUDA and Miniconda | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 | ||
|
||
# Copy from CUDA base | ||
COPY --from=cuda-base /usr/local/cuda /usr/local/cuda | ||
|
||
# Copy Miniconda from the Miniconda stage | ||
COPY --from=miniconda-stage /opt/conda /opt/conda | ||
|
||
# Set environment variables for Miniconda | ||
ENV PATH /opt/conda/bin:$PATH | ||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | ||
|
||
# Install Python 3.10 | ||
ARG PYTHON_VERSION=3.12 | ||
RUN conda install python=${PYTHON_VERSION} | ||
|
||
# Arguments for PyTorch and CUDA Toolkit versions | ||
ARG PYTORCH_VERSION=2.5.0 | ||
ARG CUDATOOLKIT_VERSION=12.4 | ||
|
||
# Install PyTorch and other dependencies | ||
RUN conda install pytorch=${PYTORCH_VERSION} pytorch-cuda=${CUDATOOLKIT_VERSION} -c pytorch -c nvidia | ||
|
||
# Handle environment.yml if it exists | ||
RUN echo env_change_20241021_2 | ||
COPY environment.yml* noop.txt /tmp/conda-tmp/ | ||
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then \ | ||
/opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; \ | ||
fi \ | ||
&& rm -rf /tmp/conda-tmp | ||
|
||
# Append Miniconda to PATH in .bashrc for interactive shells | ||
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> /root/.bashrc \ | ||
&& echo "conda activate base" >> /root/.bashrc | ||
|
||
# Final CMD or ENTRYPOINT | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "torchsparsegradutils Dev Container", | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": ".", | ||
"args": { | ||
"CUDA_VERSION": "12.4.0", | ||
"PYTORCH_VERSION": "2.5.0", | ||
"CUDATOOLKIT_VERSION": "12.4", | ||
"PYTHON_VERSION": "3.12" | ||
} | ||
}, | ||
"runArgs": [ | ||
"--gpus", | ||
"all" | ||
], | ||
"remoteEnv": { | ||
"SSH_AUTH_SOCK": "/tmp/ssh-agent.sock" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.defaultInterpreterPath": "/opt/conda/bin/python", | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"terminal.integrated.env.linux": { | ||
"CONDA_DEFAULT_ENV": "base", | ||
"CONDA_PREFIX": "/opt/conda", | ||
"CONDA_PYTHON_EXE": "/opt/conda/bin/python", | ||
"PATH": "/opt/conda/bin:${env:PATH}" | ||
}, | ||
"python.testing.pytestArgs": [ | ||
"torchsparsegradutils/tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
}, | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"ms-python.vscode-pylance", | ||
"ms-python.python", | ||
"github.copilot", | ||
"GitHub.vscode-pull-request-github", | ||
"GitHub.vscode-github-actions", | ||
"mhutchie.git-graph", | ||
"waderyan.gitblame" | ||
] | ||
} | ||
}, | ||
"remoteUser": "vscode", | ||
"postCreateCommand": "echo 'Container is ready!'" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: base | ||
channels: | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- numpy | ||
- cupy | ||
- scipy | ||
- pre-commit==3.7.1 | ||
- black==24.4.2 | ||
- flake8==7.1.0 | ||
- parameterized==0.9.0 | ||
- pytest==8.2.2 | ||
- pytest-rerunfailures==14.0 | ||
- pyyaml==6.0.1 | ||
- conda-libmamba-solver | ||
- libmamba | ||
- libmambapy | ||
- libarchive | ||
- pip | ||
- pip: | ||
- "jax[cuda12]" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
language_version: python3.10 | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
rev: 7.1.0 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters