Skip to content

1. Add optional language features support for LangSplat integration; 2. fix build bugs.#7

Open
jiagaoxiang wants to merge 5 commits into
release/1.5.3b2from
douglas/langsplat
Open

1. Add optional language features support for LangSplat integration; 2. fix build bugs.#7
jiagaoxiang wants to merge 5 commits into
release/1.5.3b2from
douglas/langsplat

Conversation

@jiagaoxiang

Copy link
Copy Markdown

Motivation

LangSplat (3D Language Gaussian Splatting) requires rendering per-Gaussian language features (e.g. 3-channel CLIP embeddings) alongside RGB colors during rasterization. Currently, LangSplat relies on a separate langsplat-rasterization CUDA backend that duplicates most of gsplat's pipeline with hard-coded language feature parameters threaded through every kernel.

This PR adds optional language feature support directly to gsplat.rasterization() so that LangSplat can use gsplat's AMD-optimized kernels (DPP warp reductions, 8x8 tiles, HIP-native streams) without maintaining a separate rasterizer fork. The design has zero overhead when the feature is unused -- the existing code path is completely unchanged when language_features=None (the default).

This PR also fixes three build bugs in setup.py that prevent successful installation in Docker/CI environments.

Technical Details

gsplat/rendering.py -- Add language_features parameter to rasterization()

Language features are alpha-blended with the same transmittance as colors, making them mathematically equivalent to extra color channels. The implementation leverages gsplat's existing N-D channel (CDIM template) support with no kernel changes:

  • New optional parameter: language_features: Optional[Tensor] = None with shape [..., N, D_lang]
  • After render_mode depth handling and before tile intersection, language features are concatenated to the end of the color channels via torch.cat([colors, lf], dim=-1). Backgrounds are zero-padded accordingly.
  • After rasterization but before depth normalization, language features are split back out and stored in meta["render_language_features"] with shape [..., C, H, W, D_lang].
  • Supports both packed=True and packed=False modes, and works with both precomputed colors and SH evaluation.
  • Docstrings updated for the new parameter and return values.

setup.py -- Build fixes

  • Fix NameError: name 'branch_name' is not defined in get_git_rev() exception handler.
  • Fix invalid PEP 440 version string (e.g. 1.5.3+) when git rev is empty by guarding the version suffix append.
  • Add -DGLM_FORCE_CUDA to CXX and hipcc compile flags for GLM header compatibility with HIP device kernels.

Test Plan

Integrated this new version rocm/gsplat into LangSplat and trained the Language Features with rendering. The evaluation results match Langsplat-rasterization perfectly.

Enhanced the rasterization function to accept optional per-Gaussian language features. These features are concatenated with colors during rasterization and stored in the metadata. Updated documentation to reflect the new parameter and its behavior.
Improved error messaging in the get_git_rev function for better clarity. Added a check to ensure git_rev is not empty before appending it to the version string. Updated compile arguments to include "-DGLM_FORCE_CUDA" for both extra_compile_args and hipcc_flags to enhance compatibility with CUDA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional per-Gaussian language feature rendering support to gsplat.rasterization() for LangSplat integration, and fixes several ROCm build/versioning issues in setup.py.

Changes:

  • Add language_features: Optional[Tensor] to rasterization() and plumb it through by concatenating/splitting channels around rasterization.
  • Store rendered language features in meta["render_language_features"] while keeping render_colors unchanged.
  • Fix setup.py git revision/version suffix handling and add -DGLM_FORCE_CUDA to ROCm compile flags.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
setup.py Fixes git-rev/version handling and updates ROCm compile flags for GLM/HIP compatibility.
gsplat/rendering.py Adds optional language feature channels to rasterization via concat/split with doc updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.py Outdated
Co-authored-by: Copilot <[email protected]>
jiagaoxiang and others added 2 commits February 26, 2026 00:19
Add launch-time checks that reject intersection buffers beyond int32 limits to prevent ROCm VM-fault crashes, and document the detailed root cause plus a 64-bit functional fix path for the team.

Made-with: Cursor
…guard

Guard rasterization against int32 intersection overflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants