Skip to content
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,8 @@ publish_model_to_hf.py
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.ipython
.jupyter
.local
Draft.ipynb
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use the official PyTorch image as the base
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel AS build


# Set build arguments for UID and GID
ARG UID=1000
ARG GID=1000

WORKDIR /workspace
COPY requirement.txt .
RUN pip install --no-cache-dir -r requirement.txt


# Create a group and user with the specified UID and GID
RUN groupadd -g ${GID} usergroup && \
useradd -m -u ${UID} -g usergroup user


# Pre-final stage
FROM build AS pre

# Set the working directory
WORKDIR /workspace

# Copy the application code
COPY . /workspace

RUN pip install causal-conv1d/

# Final stage
FROM pre AS final

RUN pip install mamba/

# Set environment variables
ENV XDG_CACHE_HOME=/workspace/.cache
ENV HOME=/workspace

EXPOSE 8888
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
NAME=videomamba
COMMAND?=bash
OPTIONS?=

GPUS?=all
ifeq ($(GPUS),none)
GPUS_OPTION=
else
GPUS_OPTION=--gpus=$(GPUS)
endif

USER_ID := $(shell id -u)
GROUP_ID := $(shell id -g)

.PHONY: all
all: stop build run

.PHONY: build
build:
docker build --target final -t $(NAME) .

.PHONY: stop
stop:
-docker stop $(NAME)
-docker rm $(NAME)

.PHONY: run
run:
docker run --rm -dit \
--net=host \
--ipc=host \
$(OPTIONS) \
$(GPUS_OPTION) \
--user $(USER_ID):$(GROUP_ID) \
-v $(shell pwd):/workspace \
--name=$(NAME) \
$(NAME) \
$(COMMAND)

docker attach $(NAME)


.PHONY: attach
attach:
docker attach $(NAME)


.PHONY: notebook
notebook:
docker run --rm -it \
--ipc=host \
-p 8888:8888 \
$(OPTIONS) \
$(GPUS_OPTION) \
--user $(USER_ID):$(GROUP_ID) \
-v $(shell pwd):/workspace \
--name=$(NAME)_notebook \
$(NAME) \
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --notebook-dir=/workspace
3 changes: 2 additions & 1 deletion requirement.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tensorboard
mmengine
joblib
joblib
jupyterlab