Move the model to cuda inside infer() (vggt-omega pattern) rather than relying
on module-level placement, which may leave compute on CPU inside the GPU worker
(would explain the multi-minute runs). Embed dev/amp/dtype + per-decode time in
the returned timings (logged by the main process). duration=300 to let it finish
and report.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make the GPU call non-generator (fix ZeroGPU hang)
A lazily-consumed @spaces.GPU generator (driven by an outer generator that does
CPU work between pulls) never yielded its first item on ZeroGPU — it hung and
got aborted at a fixed ~323s regardless of frame count, even with FA3 loaded.
Switch to the proven vggt-omega/DA3 shape: `infer` runs all K steps in one GPU
call and returns the list of intermediate clouds; `reconstruct` reveals them
progressively on the CPU side. Duration back to 120s.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kernels>=0.12 requires an explicit version; get_kernel("kernels-community/
flash-attn3") errored ("a version or revision must be specified") so FA3
silently fell back to SDPA. Pin version=1 (the kernel's major; it ships a
torch28-cu128-x86_64 build matching ZeroGPU). Add kernels to requirements.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use Flash-Attention 3 (prebuilt via HF kernels) as the attention backend
Load kernels-community/flash-attn3 (auto-resolves the prebuilt kernel for
ZeroGPU's Blackwell arch) and expose it as `flash_attn_interface`, which is what
DVLT's attention imports. Hardcode set_attn_backend("fa3") — dropped the
ATTN_BACKEND env + _select_attn_backend selection logic. Falls back to SDPA only
when the kernel is unavailable (e.g. local CPU).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Perf: cap views to 16, duration 180s, phase timing, free memory, attn backend
Comparison vs the official demo confirmed our inference is faithful (no bug) —
the recurrent loop's attention dominates and streaming decodes the heads + fp32
pose-solver multiple times. So: cap MAX_FRAMES=16 (~0.33x the attention of 28),
raise GPU budget to 180s, del preds between decodes, and add phase timings
(enc/steps/decode) surfaced via the yield so they show in the run log. Add a
configurable attention backend (prefers fa3 > flash > auto).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Simplify app.py; bf16 inference; unified video->images input; drop onnx
- import spaces directly (no shim); @dataclass StepResult; remove estimate_duration
(fixed @spaces.GPU(duration=120)).
- bf16 autocast on GPU (repo's efficient precision) — the prior fp32 path over
many frames timed out / OOM'd ("GPU task aborted"). fp32 only on CPU.
- Cap views to MAX_FRAMES=32 so global attention stays in budget.
- Unified input: a video is sampled into frames that fill the image batch; the
reconstructor always consumes the image batch. Examples are videos only.
- Remove the sky-segmentation feature and onnxruntime (only user of onnx).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The reconstruct call hung at 'Encoding 0%' with no logs. Add print() tracing
through reconstruct/infer_stream for observability, and launch with
ssr_mode=False (the experimental SSR server can swallow streamed generator
updates on Spaces).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Consolidate into a single PEP 723 app.py; fix ZeroGPU GPU-fn detection
- Move all code (model load, streaming inference, viz, UI) into app.py with the
@spaces.GPU function at module top level. ZeroGPU scans the entrypoint, so a
decorator buried in a submodule gave "No @spaces.GPU function detected during
startup" -> RUNTIME_ERROR. Defining infer_stream in app.py fixes it.
- Add a PEP 723 / uv script header + shebang so `uv run app.py` works standalone.
- Drop the buildable package (pyproject.toml, dvlt_demo/) and packages/dvlt/README.md.
- Model placed on cuda at module level per ZeroGPU guidance; fp32 inference.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Commit the dvlt wheel (uv had dropped a .gitignore in wheels/)
build.sh now removes the uv-generated wheels/.gitignore so the artifact is tracked.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Install dvlt from a vendored prebuilt wheel (ZeroGPU, no git/sys.path)
packages/dvlt/
repo/ verbatim nv-tlabs/dvlt @ 265fe61, diff = 3 relaxed pins
(torch, torchvision, pydantic) so it resolves with the
ZeroGPU torch>=2.8 + gradio 5.50 stack
wheels/ prebuilt wheel (built by build.sh)
build.sh builds repo/ -> wheels/
requirements.txt installs that wheel via the Space's HTTPS resolve URL
(git+url and local-path installs both fail on HF's Gradio build). No sys.path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Vendor edited dvlt in packages/dvlt; install via git subdirectory (ZeroGPU)
- packages/dvlt: clone of nv-tlabs/dvlt@265fe61 with only torch/torchvision
pins relaxed (Blackwell needs torch>=2.8); source unmodified.
- requirements.txt installs it via git+.../spaces/blanchon/dvlt#subdirectory
(HF installs requirements before copying the repo, so a local path can't work;
pip's blob:none clone of the git-pushed Space repo works).
- dvlt_demo moved to repo root; no sys.path needed anywhere.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unofficial DVLT 3D reconstruction demo (Gradio + ZeroGPU)
Streaming K-step looped inference, 3D point cloud + camera poses viewer,
depth maps, video/image upload, examples. Installs an inference-lean dvlt
fork (torch unpinned) for ZeroGPU/Blackwell compatibility.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>