1. Add optional language features support for LangSplat integration; 2. fix build bugs.#7
Open
jiagaoxiang wants to merge 5 commits into
Open
1. Add optional language features support for LangSplat integration; 2. fix build bugs.#7jiagaoxiang wants to merge 5 commits into
jiagaoxiang wants to merge 5 commits into
Conversation
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.
There was a problem hiding this comment.
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]torasterization()and plumb it through by concatenating/splitting channels around rasterization. - Store rendered language features in
meta["render_language_features"]while keepingrender_colorsunchanged. - Fix
setup.pygit revision/version suffix handling and add-DGLM_FORCE_CUDAto 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.
Co-authored-by: Copilot <[email protected]>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-rasterizationCUDA 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 whenlanguage_features=None(the default).This PR also fixes three build bugs in
setup.pythat prevent successful installation in Docker/CI environments.Technical Details
gsplat/rendering.py-- Addlanguage_featuresparameter torasterization()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 (
CDIMtemplate) support with no kernel changes:language_features: Optional[Tensor] = Nonewith shape[..., N, D_lang]torch.cat([colors, lf], dim=-1). Backgrounds are zero-padded accordingly.meta["render_language_features"]with shape[..., C, H, W, D_lang].packed=Trueandpacked=Falsemodes, and works with both precomputed colors and SH evaluation.setup.py-- Build fixesNameError: name 'branch_name' is not definedinget_git_rev()exception handler.1.5.3+) when git rev is empty by guarding the version suffix append.-DGLM_FORCE_CUDAto 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.