From fb1356ba6083d72d7a16fe39ae6580a7142d7964 Mon Sep 17 00:00:00 2001 From: Soulsharp <138900246+soulsharp@users.noreply.github.com> Date: Sat, 30 Aug 2025 15:53:55 +0530 Subject: [PATCH 1/6] fix: remove flake8 --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 702a86d..3c03b10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,6 @@ jobs: - name: Run linters run: | black --check . - flake8 . test: name: Full Tests From a4bb86c6a0396bdf87490d2d899ae938322583f2 Mon Sep 17 00:00:00 2001 From: Soulsharp <138900246+soulsharp@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:05:37 +0530 Subject: [PATCH 2/6] feat: add dockerignore --- docker/.dockerignore | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docker/.dockerignore diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 0000000..cb52787 --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1,24 @@ +# Github workflows +.github/workflows/ + +# Python cache +**/__pycache__/ +**/*.py[cod] + +# Train datasets +data/train/ +data/test/ + +# Profiling scripts/ logs +profiler/ + +# Tests +tests/ + +# Model weights and checkpoints +model/weights +checkpoints/ + +# Temp files +*.log +*.tmp From 08585d95d88b920a58deb830cdcd085b36dadf7c Mon Sep 17 00:00:00 2001 From: Soulsharp <138900246+soulsharp@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:59:34 +0530 Subject: [PATCH 3/6] feat: add docker image --- docker/.dockerignore | 19 +++++++++++++------ docker/Dockerfile | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 docker/Dockerfile diff --git a/docker/.dockerignore b/docker/.dockerignore index cb52787..be2b3c2 100644 --- a/docker/.dockerignore +++ b/docker/.dockerignore @@ -6,19 +6,26 @@ **/*.py[cod] # Train datasets -data/train/ -data/test/ +/data/train/ +/data/test/ # Profiling scripts/ logs -profiler/ +/profiler/ # Tests -tests/ +/tests/ # Model weights and checkpoints -model/weights -checkpoints/ +/model/weights +/checkpoints/ + +# Model compression logic +/compress/ # Temp files *.log *.tmp + +# Misc +/LICENSE +/README.md diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..6f7dc10 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.13-slim +LABEL maintainer="soulsharp" +LABEL repository="Compress-Resnet" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN python -m venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" + +# Creates missing files that werent copied +RUN mkdir /data/test /model/weights + +# Container paths to datasets +ENV TEST_DATASET_PATH="/data/test" + +RUN python -m pip install --no-cache-dir --upgrade pip +COPY requirements.txt /tmp/requirements.txt +RUN pip install -r /tmp/requirements.txt \ No newline at end of file From 2fd1dbc192c2ee9b56c1a4aa55aac0309fa865cd Mon Sep 17 00:00:00 2001 From: Soulsharp <138900246+soulsharp@users.noreply.github.com> Date: Wed, 3 Sep 2025 23:33:22 +0530 Subject: [PATCH 4/6] Fix: docker related bugs --- docker/.dockerignore | 20 ++++++++++---------- docker/Dockerfile | 22 +++++++++++++++++----- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/docker/.dockerignore b/docker/.dockerignore index be2b3c2..05aff57 100644 --- a/docker/.dockerignore +++ b/docker/.dockerignore @@ -5,27 +5,27 @@ **/__pycache__/ **/*.py[cod] +# venv +venv/ + # Train datasets -/data/train/ -/data/test/ +data/train/ +data/test/ # Profiling scripts/ logs -/profiler/ +profiler/ # Tests -/tests/ +tests/ # Model weights and checkpoints -/model/weights -/checkpoints/ +model/weights/ +checkpoints/ # Model compression logic -/compress/ +compress/ # Temp files *.log *.tmp -# Misc -/LICENSE -/README.md diff --git a/docker/Dockerfile b/docker/Dockerfile index 6f7dc10..1fc0c8e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,17 +2,29 @@ FROM python:3.13-slim LABEL maintainer="soulsharp" LABEL repository="Compress-Resnet" -ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\ + build-essential libblas-dev liblapack-dev \ + && rm -rf /var/lib/apt/lists/* RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" +WORKDIR /app +COPY requirements.txt . + +RUN --mount=type=cache,target=/root/.cache/pip \ + python -m pip install --upgrade pip \ + && python -m pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu126 \ + && python -m pip install -r requirements.txt + +COPY . . + # Creates missing files that werent copied -RUN mkdir /data/test /model/weights +RUN mkdir -p /data/test /model/weights # Container paths to datasets ENV TEST_DATASET_PATH="/data/test" +ENV MODEL_WT_PATH="/model/weights" -RUN python -m pip install --no-cache-dir --upgrade pip -COPY requirements.txt /tmp/requirements.txt -RUN pip install -r /tmp/requirements.txt \ No newline at end of file +CMD ["python", "-m", "scripts.run_benchmark"] \ No newline at end of file From d24eb6c25c44330a3b197a5d8587d76fef744973 Mon Sep 17 00:00:00 2001 From: Soulsharp <138900246+soulsharp@users.noreply.github.com> Date: Wed, 3 Sep 2025 23:34:27 +0530 Subject: [PATCH 5/6] refactor: minor name change --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c03b10..2fb7019 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ concurrency: jobs: lint: - name: Quick Lint (PRs only) + name: Quick Lint runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: From ca50e5c124552b4b8615d73e1a66fb8659cf169a Mon Sep 17 00:00:00 2001 From: Soulsharp <138900246+soulsharp@users.noreply.github.com> Date: Wed, 3 Sep 2025 23:35:07 +0530 Subject: [PATCH 6/6] feat: add actual dep versions --- requirements.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2bd4db5..b034247 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ -ptflops -tensorboard -torch -torchvision -onnx -onnxruntime -onnxsim -numpy -matplotlib -torchinfo -PyYAML -pytorch-lightning -pytest -pytest-mock \ No newline at end of file +ptflops==0.7.5 +tensorboard==2.19.0 +# torch==2.8.0 +# torchvision==0.23.0 +# onnx +# onnxruntime +# onnxsim +numpy==2.0.2 +matplotlib==3.10.0 +torchinfo==1.8.0 +PyYAML==6.0.2 +pytorch-lightning==2.5.4 +pytest==8.4.1 +pytest-mock==3.14.1 \ No newline at end of file