Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9089568
added sycl code
asrathore-ai Aug 13, 2025
dedfc2d
Resolve Windows compiler / linker errors.
ssheorey Sep 13, 2025
6f44999
Fix Windows linker errors
ssheorey Sep 13, 2025
a9eaf99
Loading kernels now works in Windows.
ssheorey Sep 15, 2025
2f28ba3
COrrected libtorch path issues
asrathore-ai Sep 23, 2025
3fff3de
Updated correct shape calculation
asrathore-ai Sep 24, 2025
10c0efd
Updated proj changes
asrathore-ai Sep 24, 2025
7b3bfb8
corrected isect code
asrathore-ai Sep 24, 2025
0d25c9e
Update fully fused projection kernels
asrathore-ai Sep 25, 2025
02a596b
wip packed kernel
asrathore-ai Sep 25, 2025
fc801e8
added fully fused projection packed
asrathore-ai Sep 25, 2025
f773859
Update kernel
asrathore-ai Sep 25, 2025
4dfea00
updated training code
asrathore-ai Sep 25, 2025
6624ec0
update steps for memory error
asrathore-ai Sep 25, 2025
6597d44
torch_acc uniform API for both cuda and xpu. Maybe replaced by torch.…
ssheorey Oct 7, 2025
0a472cf
Added forward pass for 2fgs fully fused projection
asrathore-ai Oct 17, 2025
417942e
added backward pass
asrathore-ai Oct 17, 2025
6763ada
update tests
asrathore-ai Oct 17, 2025
f4d0123
Working tests
asrathore-ai Oct 17, 2025
167d0b6
Added rasterize forward kernel
asrathore-ai Oct 17, 2025
a4f90ac
added backward kernel
asrathore-ai Oct 17, 2025
aa6ff08
Update rasterize_to_pixels_2dgs_bwd.cpp
asrathore-ai Nov 11, 2025
6542d4c
Update RasterizeToPixels2DGSBwdKernel.hpp
asrathore-ai Nov 11, 2025
cb5c72a
Update RasterizeToPixels2DGSBwdKernel.hpp
asrathore-ai Nov 11, 2025
4a5bde3
Update RasterizeToPixels2DGSFwdKernel.hpp
asrathore-ai Nov 11, 2025
11604f5
Update rasterize_to_pixels_2dgs_fwd.cpp for correct block size comput…
asrathore-ai Nov 15, 2025
b5c46a9
Update rasterize_to_pixels_2dgs_bwd.cpp for correct block size comput…
asrathore-ai Nov 15, 2025
eb2174c
relocation kernel for MCMC strategy
ssheorey Nov 15, 2025
390ffc2
Merge branch '2d_gaussian_splatting' of github.com:isl-org/gsplat int…
ssheorey Nov 15, 2025
6524660
CI tests and docs should pass now.
ssheorey Nov 16, 2025
e261c04
Use pytorch 2.6 for CI (docs and core_tests)
ssheorey Nov 16, 2025
d03c5f3
black v22 and clang-format
ssheorey Nov 16, 2025
ed7352a
Fix test_rasterization for packed, fix has_xpu check from previous co…
ssheorey Nov 17, 2025
b5bc4f0
#pragma once to follow gsplat convention
ssheorey Nov 17, 2025
b785b20
Merge pull request #2 from isl-org/2d_gaussian_splatting
ssheorey Nov 17, 2025
72fcd3a
Common _wrapper.py for cuda and sycl
ssheorey Nov 18, 2025
570de47
Merge branch 'main' into sycl_code_integration
ssheorey Nov 21, 2025
cabd342
contiguous() tensors to fused_ssim
ssheorey Nov 24, 2025
31c484e
Updated fused_ssim to latest including sycl bugfix.
ssheorey Nov 24, 2025
a70b2f5
empty xpu docs
ssheorey Nov 25, 2025
bc60098
Evaluation results on B580
ssheorey Jan 26, 2026
4f022e4
Windows MSVC fixes
ssheorey Jan 27, 2026
a9f1536
Do not install fused-bilagrid
ssheorey Feb 4, 2026
b315442
Update instructions.
ssheorey Feb 4, 2026
fa4cdd9
Simplify build process.
ssheorey Feb 7, 2026
3cb8262
Initial plan
Copilot Feb 23, 2026
02d094c
Add SYCL/XPU wheel build and publish GitHub Actions workflows
Copilot Feb 23, 2026
0305370
Address PR review comments on SYCL/XPU wheel workflows
Copilot Feb 23, 2026
a5c4e47
Add SYCL/XPU wheel build and publish GitHub Actions workflows
ssheorey Feb 23, 2026
2406dfb
Initial plan
Copilot Feb 23, 2026
a0025c6
Fix XPU workflow: truncate oneAPI version X.Y.Z to X.Y for apt packag…
Copilot Feb 23, 2026
1256a06
Windows wheel workflow
ssheorey Feb 27, 2026
1baa172
Fix
ssheorey Feb 27, 2026
3328824
Fix setup.py for source only wheel
ssheorey Feb 27, 2026
b3a8f5d
installer fix
ssheorey Feb 28, 2026
02b390b
fix
ssheorey Feb 28, 2026
54de18a
Separate Windows and Linux build steps.
ssheorey Feb 28, 2026
1442ff5
fix build type for windows
ssheorey Feb 28, 2026
21f1f85
Update docs
ssheorey Mar 12, 2026
711958b
SYCL CI - wheels and PyPI repo hosting on github pages.
ssheorey Mar 12, 2026
760d963
Add info about pre-built wheels.
ssheorey Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 72 additions & 23 deletions gsplat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,72 @@
import os
import sys
import torch
import warnings

BACKEND: str = ""

FORCE_BACKEND = os.getenv("GSPLAT_BACKEND", "").lower()

if FORCE_BACKEND == "cuda" or (FORCE_BACKEND == "" and torch.cuda.is_available()):
try:
BACKEND = "cuda"
from .cuda._wrapper import (
RollingShutterType,
fully_fused_projection,
fully_fused_projection_2dgs,
fully_fused_projection_with_ut,
isect_offset_encode,
isect_tiles,
proj,
quat_scale_to_covar_preci,
rasterize_to_indices_in_range,
rasterize_to_indices_in_range_2dgs,
rasterize_to_pixels,
rasterize_to_pixels_2dgs,
rasterize_to_pixels_eval3d,
spherical_harmonics,
world_to_cam,
)
print("gsplat: CUDA backend successfully loaded.", file=sys.stderr)
except ImportError:
if FORCE_BACKEND == "cuda":
print("gsplat: Error! GSPLAT_BACKEND=cuda was set but CUDA backend failed to load.", file=sys.stderr)
pass

if not BACKEND and (FORCE_BACKEND == "sycl" or FORCE_BACKEND == ""):
try:
BACKEND = "sycl"
from .sycl._wrapper import (
RollingShutterType,
fully_fused_projection,
fully_fused_projection_2dgs,
fully_fused_projection_with_ut,
isect_offset_encode,
isect_tiles,
proj,
quat_scale_to_covar_preci,
rasterize_to_indices_in_range,
rasterize_to_indices_in_range_2dgs,
rasterize_to_pixels,
rasterize_to_pixels_2dgs,
rasterize_to_pixels_eval3d,
spherical_harmonics,
world_to_cam,
)
print("gsplat: SYCL backend successfully loaded.", file=sys.stderr)
except ImportError as e:
if FORCE_BACKEND == "sycl":
print(f"gsplat: Error! GSPLAT_BACKEND=sycl was set but SYCL backend failed to load: {e}", file=sys.stderr)
pass

if not BACKEND:
print(
"gsplat: Warning! No high-performance backend (CUDA or SYCL) found.",
file=sys.stderr,
)


from .compression import PngCompression
from .cuda._torch_impl import accumulate
from .cuda._torch_impl_2dgs import accumulate_2dgs
from .cuda._wrapper import (
RollingShutterType,
fully_fused_projection,
fully_fused_projection_2dgs,
fully_fused_projection_with_ut,
isect_offset_encode,
isect_tiles,
proj,
quat_scale_to_covar_preci,
rasterize_to_indices_in_range,
rasterize_to_indices_in_range_2dgs,
rasterize_to_pixels,
rasterize_to_pixels_2dgs,
rasterize_to_pixels_eval3d,
spherical_harmonics,
world_to_cam,
)
from .exporter import export_splats
from .optimizers import SelectiveAdam
from .rendering import (
Expand All @@ -31,7 +78,9 @@
from .strategy import DefaultStrategy, MCMCStrategy, Strategy
from .version import __version__

all = [

__all__ = [
"BACKEND",
"PngCompression",
"DefaultStrategy",
"MCMCStrategy",
Expand All @@ -47,16 +96,16 @@
"quat_scale_to_covar_preci",
"rasterize_to_pixels",
"world_to_cam",
"accumulate",
"rasterize_to_indices_in_range",
"fully_fused_projection_2dgs",
"rasterize_to_pixels_2dgs",
"rasterize_to_indices_in_range_2dgs",
"accumulate_2dgs",
"rasterization_2dgs_inria_wrapper",
"RollingShutterType",
"fully_fused_projection_with_ut",
"rasterize_to_pixels_eval3d",
"export_splats",
"__version__",
]
"SelectiveAdam",
# Note: accumulate and accumulate_2dgs are not typically part of the public API
]
2 changes: 1 addition & 1 deletion gsplat/cuda/_torch_impl.py → gsplat/_torch_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def _rasterize_to_pixels(
This function requires the `nerfacc` package to be installed. Please install it
using the following command `pip install nerfacc`.
"""
from ._wrapper import rasterize_to_indices_in_range
from .cuda._wrapper import rasterize_to_indices_in_range

image_dims = means2d.shape[:-2]
channels = colors.shape[-1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch
from torch import Tensor

from gsplat.cuda._torch_impl import _quat_scale_to_matrix
from ._torch_impl import _quat_scale_to_matrix


def _fully_fused_projection_2dgs(
Expand Down Expand Up @@ -231,7 +231,7 @@ def _rasterize_to_pixels_2dgs(
This function requires the `nerfacc` package to be installed. Please install it
using the following command `pip install nerfacc`.
"""
from ._wrapper import rasterize_to_indices_in_range_2dgs
from .cuda._wrapper import rasterize_to_indices_in_range_2dgs

image_dims = means2d.shape[:-2]
channels = colors.shape[-1]
Expand Down
2 changes: 1 addition & 1 deletion gsplat/cuda/_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def world_to_cam(
- **Gaussian means in camera coordinate system**. [..., C, N, 3]
- **Gaussian covariances in camera coordinate system**. [..., C, N, 3, 3]
"""
from ._torch_impl import _world_to_cam
from .._torch_impl import _world_to_cam

warnings.warn(
"world_to_cam() is removed from the CUDA backend as it's relatively easy to "
Expand Down
2 changes: 1 addition & 1 deletion gsplat/cuda/csrc/third_party/glm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the glm upgrade required? If yes, we need to explain why. If no, this should not be part of this PR.

13 changes: 12 additions & 1 deletion gsplat/strategy/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
import torch.nn.functional as F
from torch import Tensor

from gsplat import quat_scale_to_covar_preci
from gsplat import BACKEND
if BACKEND == "cuda":
from gsplat.cuda._wrapper import (
quat_scale_to_covar_preci,
)
elif BACKEND == "sycl":
from gsplat.sycl._wrapper import (
quat_scale_to_covar_preci,
)
else:
raise ImportError("gsplat: No backend loaded, cannot import strategy ops.")

from gsplat.relocation import compute_relocation
from gsplat.utils import normalized_quat_to_rotmat

Expand Down
119 changes: 119 additions & 0 deletions gsplat/sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
cmake_minimum_required(VERSION 3.23...4.0) # Need min 3.23 on Windows

set(CMAKE_C_COMPILER icx)
set(CMAKE_CXX_COMPILER icx)

project(gsplat_sycl)

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

if (NOT SYCL_AOT_TARGETS)
set (SYCL_AOT_TARGETS "spir64" CACHE STRING "Comma separated list of SYCL targets for ahead of time compilation. See https://github.com/intel/llvm/blob/sycl/sycl/doc/UsersManual.md for a full list.")
endif()

find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)


execute_process(
COMMAND "${Python_EXECUTABLE}" -c "import torch.utils; print(torch.utils.cmake_prefix_path)"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE Torch_DIR_From_Python
RESULT_VARIABLE _torch_path_result
ERROR_QUIET
)
if(NOT _torch_path_result EQUAL 0)
message(WARNING "Failed to get Torch CMake path from Python. "
"Make sure PyTorch is installed in the Python environment: ${Python_EXECUTABLE}")
set(Torch_DIR_From_Python "")
endif()

if(Torch_DIR_From_Python AND IS_DIRECTORY "${Torch_DIR_From_Python}")
set(Torch_DIR ${Torch_DIR_From_Python})
message(STATUS "Found Torch CMake directory via Python: ${Torch_DIR}")
find_package(Torch REQUIRED HINTS ${Torch_DIR_From_Python})
else()
message(FATAL_ERROR "Could not find Torch via Python introspection. "
"Please ensure PyTorch is installed or set CMAKE_PREFIX_PATH/Torch_DIR manually.")
endif()
execute_process(
COMMAND "${Python_EXECUTABLE}" -c "import os; from torch.utils import cpp_extension; print(os.path.join(cpp_extension.library_paths(True)[0], 'libtorch_python.so'))"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE TORCH_PYTHON_LIB
)

if (NOT EXISTS "${TORCH_PYTHON_LIB}")
message(FATAL_ERROR "Could not find libtorch_python.so at ${TORCH_PYTHON_LIB}. Please check your PyTorch installation.")
else()
message(STATUS "Found torch_python library at: ${TORCH_PYTHON_LIB}")
endif()


set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)

set( SYCL_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/ext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/adam.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/intersect_offset.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/intersect_tile.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/null.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_2dgs_fused_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_2dgs_fused_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_2dgs_packed_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_2dgs_packed_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ewa_3dgs_fused_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ewa_3dgs_fused_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ewa_3dgs_packed_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ewa_3dgs_packed_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ewa_simple_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ewa_simple_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/projection_ut_3dgs_fused.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/quat_scale_to_covar_preci_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/quat_scale_to_covar_preci_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_indices_2dgs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_indices_3dgs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_pixels_2dgs_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_pixels_2dgs_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_pixels_3dgs_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_pixels_3dgs_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_pixels_from_world_3dgs_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rasterize_to_pixels_from_world_3dgs_fwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/relocation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/spherical_harmonics_bwd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/spherical_harmonics_fwd.cpp
)

set(SYCL_MODULE_NAME gsplat_sycl_kernels)

pybind11_add_module(${SYCL_MODULE_NAME} MODULE ${SYCL_SOURCES})

target_include_directories( ${SYCL_MODULE_NAME} SYSTEM PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/../cuda/csrc/third_party/glm
)

target_compile_definitions(${SYCL_MODULE_NAME} PRIVATE
TORCH_EXTENSION_NAME=${SYCL_MODULE_NAME}
)

target_compile_options(${SYCL_MODULE_NAME} PRIVATE -fsycl)
target_compile_features(${SYCL_MODULE_NAME} PUBLIC cxx_std_17)

target_link_options(${SYCL_MODULE_NAME} PRIVATE -fsycl -fsycl-targets=${SYCL_AOT_TARGETS})
target_link_libraries(${SYCL_MODULE_NAME} PRIVATE torch)


# Fix for icx: error: '-MP' is not supported with offloading enabled
if (WIN32 AND NOT UNIX)
get_target_property(CURRENT_OPTIONS ${SYCL_MODULE_NAME} COMPILE_OPTIONS)
string(REPLACE "/MP" "" MODIFIED_OPTIONS "${CURRENT_OPTIONS}")
set_target_properties(${SYCL_MODULE_NAME} PROPERTIES COMPILE_OPTIONS "${MODIFIED_OPTIONS}")
endif ()
if (UNIX AND NOT APPLE)
# Find libtorch_xpu and libsycl at runtime in Python environment
set_target_properties(${SYCL_MODULE_NAME} PROPERTIES INSTALL_RPATH
"$ORIGIN/../../torch/lib/;$ORIGIN/../../../../")
endif()
Empty file added gsplat/sycl/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions gsplat/sycl/_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_C = None

try:
# Try to import the compiled module (via setup.py or pre-built .so)
from gsplat import gsplat_sycl_kernels as _C
except ImportError:
raise ImportError("Unable to find compiled sycl kernels package")
Loading
Loading