SteEsp commited on
Commit
15400ef
·
verified ·
1 Parent(s): f1fab86

Install prebuilt CUDA wheels — no compilation on the HF builder (fixes OOM)

Browse files
.gitattributes CHANGED
@@ -39,3 +39,8 @@ submodules/fused-ssim/images/inference_time_4090.png filter=lfs diff=lfs merge=l
39
  submodules/fused-ssim/images/predicted.jpg filter=lfs diff=lfs merge=lfs -text
40
  submodules/fused-ssim/images/training_time.png filter=lfs diff=lfs merge=lfs -text
41
  submodules/fused-ssim/images/training_time_4090.png filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
39
  submodules/fused-ssim/images/predicted.jpg filter=lfs diff=lfs merge=lfs -text
40
  submodules/fused-ssim/images/training_time.png filter=lfs diff=lfs merge=lfs -text
41
  submodules/fused-ssim/images/training_time_4090.png filter=lfs diff=lfs merge=lfs -text
42
+ wheels/fused_knn_attn_cuda-1.0-cp312-cp312-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
43
+ wheels/gsplat-1.5.3-cp312-cp312-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
44
+ wheels/nerfacc-0.5.3-cp312-cp312-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
45
+ wheels/pointops-1.0-cp312-cp312-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
46
+ wheels/simple_knn-0.0.0-cp312-cp312-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
Dockerfile CHANGED
@@ -1,29 +1,23 @@
1
  # Learn2Splat — interactive demo for a Hugging Face Space (Docker SDK, GPU).
2
  #
3
- # Builds the optgs package + its CUDA extensions and runs demo.py's viser GUI:
4
- # SfM-initialize a COLMAP scene, then refine the Gaussians with the learned
5
- # optimizer live in the browser. Mirrors setup.sh, minus conda — the CUDA
6
- # toolkit ships in the base image.
7
  #
8
- # Build context = the optgs repo root (see huggingface_space/DEPLOY.md).
 
 
 
 
9
  # Hardware: pick a GPU in the Space settings — A10G (24 GB) recommended; the
10
  # GUI holds the dense and sparse checkpoints in VRAM at once.
11
 
12
- # CUDA 12.8 devel (nvcc + headers); Ubuntu 22.04 — the OS setup.sh is tested on.
13
- # A devel base is required: gsplat / nerfacc JIT-compile CUDA on first use, so
14
- # nvcc must also be present at runtime.
15
  FROM nvidia/cuda:12.8.0-devel-ubuntu22.04
16
 
17
  ENV DEBIAN_FRONTEND=noninteractive \
18
  PYTHONUNBUFFERED=1 \
19
- PIP_NO_CACHE_DIR=1 \
20
- # Build CUDA kernels for exactly the A10G (compute 8.6) — no extra arches
21
- # and no PTX. The HF Docker builder has limited RAM, and every extra
22
- # codegen target pushes a single nvcc compile toward an OOM kill.
23
- TORCH_CUDA_ARCH_LIST="8.6" \
24
- # Cap parallel nvcc jobs so multi-file extensions (gsplat, nerfacc) don't
25
- # OOM the builder.
26
- MAX_JOBS=2
27
 
28
  # Python 3.12 (via deadsnakes) — optgs uses PEP 695 generic syntax that
29
  # Ubuntu 22.04's stock Python 3.10 cannot parse. Also: build tools, extension
@@ -68,22 +62,15 @@ RUN VISER_INFRA="$(python -c 'import viser.infra._infra as m; print(m.__file__)'
68
  && sed -i 's/client_version_str = "unknown"/client_version_str = viser.__version__/' "$VISER_INFRA" \
69
  && grep -q 'client_version_str = viser.__version__' "$VISER_INFRA"
70
 
71
- # gsplat + nerfaccbuilt from git against the torch installed above.
72
- RUN pip install --no-build-isolation \
73
- git+https://github.com/nerfstudio-project/nerfacc \
74
- git+https://github.com/nerfstudio-project/gsplat.git
 
75
 
76
- # The optgs repo.
77
  COPY --chown=user:user . .
78
-
79
- # CUDA-extension submodules, then optgs itself. pycolmap is the pure-Python
80
- # COLMAP reader (no C++ build); the other four compile CUDA kernels.
81
- RUN pip install submodules/pycolmap \
82
- && pip install --no-build-isolation submodules/fused-ssim \
83
- && pip install --no-build-isolation submodules/simple-knn \
84
- && pip install --no-build-isolation submodules/pointops \
85
- && pip install --no-build-isolation submodules/fused_knn_attn \
86
- && pip install --no-build-isolation --no-deps -e .
87
 
88
  # viser serves the GUI here — must equal app_port in README.md.
89
  EXPOSE 7860
 
1
  # Learn2Splat — interactive demo for a Hugging Face Space (Docker SDK, GPU).
2
  #
3
+ # Installs the optgs package + prebuilt CUDA-extension wheels, then runs
4
+ # demo.py's viser GUI: SfM-initialize a COLMAP scene and refine the Gaussians
5
+ # with the learned optimizer live in the browser.
 
6
  #
7
+ # The CUDA extensions are NOT compiled here — the HF Docker builder runs out of
8
+ # RAM doing it. They are prebuilt into wheels/ on a machine matching this image
9
+ # (Python 3.12, torch 2.7.1+cu128, glibc 2.35); see huggingface_space/DEPLOY.md.
10
+ #
11
+ # Build context = the Space repo root (optgs source + wheels/, see DEPLOY.md).
12
  # Hardware: pick a GPU in the Space settings — A10G (24 GB) recommended; the
13
  # GUI holds the dense and sparse checkpoints in VRAM at once.
14
 
15
+ # CUDA 12.8 + Ubuntu 22.04 — matches the wheels' build environment.
 
 
16
  FROM nvidia/cuda:12.8.0-devel-ubuntu22.04
17
 
18
  ENV DEBIAN_FRONTEND=noninteractive \
19
  PYTHONUNBUFFERED=1 \
20
+ PIP_NO_CACHE_DIR=1
 
 
 
 
 
 
 
21
 
22
  # Python 3.12 (via deadsnakes) — optgs uses PEP 695 generic syntax that
23
  # Ubuntu 22.04's stock Python 3.10 cannot parse. Also: build tools, extension
 
62
  && sed -i 's/client_version_str = "unknown"/client_version_str = viser.__version__/' "$VISER_INFRA" \
63
  && grep -q 'client_version_str = viser.__version__' "$VISER_INFRA"
64
 
65
+ # Prebuilt CUDA-extension wheelsgsplat, nerfacc, pycolmap, fused-ssim,
66
+ # simple-knn, pointops, fused_knn_attn. Built on a matching machine (see
67
+ # DEPLOY.md) so the HF builder never compiles CUDA and never OOMs.
68
+ COPY --chown=user:user wheels/ ./wheels/
69
+ RUN pip install --no-deps ./wheels/*.whl
70
 
71
+ # The optgs repo, then optgs itself (pure Python — editable install).
72
  COPY --chown=user:user . .
73
+ RUN pip install --no-build-isolation --no-deps -e .
 
 
 
 
 
 
 
 
74
 
75
  # viser serves the GUI here — must equal app_port in README.md.
76
  EXPOSE 7860
wheels/fused_knn_attn_cuda-1.0-cp312-cp312-linux_x86_64.whl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97497b40f23467560521cd684621cbc31e3e25bca3c05ae129472246b770f4a0
3
+ size 2747729
wheels/fused_ssim-0.0.0-cp312-cp312-linux_x86_64.whl ADDED
Binary file (99.8 kB). View file
 
wheels/gsplat-1.5.3-cp312-cp312-linux_x86_64.whl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:428ee0c884d4274814c338becfb77bcc8c36160b281bb18d49aec6946fb22fc7
3
+ size 10206283
wheels/nerfacc-0.5.3-cp312-cp312-linux_x86_64.whl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2799fe51bd7620dc033e8afd92ff812e483a531f67251cd7e7492f67ede54ab
3
+ size 552786
wheels/pointops-1.0-cp312-cp312-linux_x86_64.whl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b470cdaba1ddaeb3dbd649d73feb937dc64719321f9818c67dc95b7bec77558b
3
+ size 6305720
wheels/pycolmap-0.0.1-py3-none-any.whl ADDED
Binary file (16.7 kB). View file
 
wheels/simple_knn-0.0.0-cp312-cp312-linux_x86_64.whl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d68b38f84c1628f808a5bbdeb807eb9a0542c3af9c89de35e4bc992438fa1577
3
+ size 427877