Skip to content

Commit 9357034

Browse files
committed
fVDB changes including:
•Reintroduced missing src/build/* files that were accidentally ommitted •JaggedTensor concatentation moved to a cuda kernel •Non-cumulative indices for ijk mappings is now the default return style (makes indexing into JaggedTensors of data more natural) •cuDNN disabled for CUDA versions <12 •Updated notebook files to new API and now included •Removed deprecated usage of `python setup.py test` and running pytest directly Signed-off-by: Jonathan Swartz <[email protected]>
1 parent 63f7ab0 commit 9357034

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3751
-216
lines changed

fvdb/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
build/*
2-
build/
1+
/build/*
32
*.creator
43
*.includes
54
*.files

fvdb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pip install .
9393

9494
To make sure that everything works by running tests:
9595
```shell
96-
python setup.py test
96+
pytest tests/unit
9797
```
9898

9999
### Building Documentation
@@ -118,7 +118,7 @@ docker run -it --gpus all --rm \
118118
--mount type=bind,source="$HOME/.ssh",target=/root/.ssh \
119119
--mount type=bind,source="$(pwd)",target=/fvdb \
120120
fvdb-dev:latest \
121-
conda run -n fvdb_test --no-capture-output python setup.py test
121+
conda run -n fvdb_test --no-capture-output python setup.py develop
122122
```
123123

124124

fvdb/env/build_environment.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ name: fvdb_build
22
channels:
33
- nvidia/label/cuda-12.1.0
44
- pytorch
5-
- conda-forge
65
dependencies:
76
- python=3.10
8-
- pytorch=2.2
9-
- pytorch-cuda=12.1
7+
- pytorch::pytorch=2.2
8+
- pytorch::pytorch-cuda=12.1
109
- git
1110
- gitpython
1211
- ca-certificates
1312
- certifi
1413
- openssl
15-
- cuda
16-
- cuda-nvcc
14+
- nvidia/label/cuda-12.1.0::cuda
15+
- nvidia/label/cuda-12.1.0::cuda-tools
16+
- nvidia/label/cuda-12.1.0::cuda-nvcc
17+
- nvidia/label/cuda-12.1.0::cuda-cccl
18+
- nvidia/label/cuda-12.1.0::cuda-libraries-static
1719
- gcc_linux-64=11
1820
- gxx_linux-64=11
1921
- setuptools

fvdb/env/cutlass.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ index e22c8be3..a29e6067 100644
77
storage = reinterpret_cast<uint16_t const &>(x);
88
#else
99
- __half_raw raw(x);
10-
+ __half_raw raw(*(reinterpret_cast<const unsigned short*>(&x)));
10+
+ __half_raw raw(*(reinterpret_cast<const __half_raw*>(&x)));
1111
std::memcpy(&storage, &raw.x, sizeof(storage));
1212
#endif
1313
}
@@ -16,7 +16,7 @@ index e22c8be3..a29e6067 100644
1616
storage = reinterpret_cast<uint16_t const &>(x);
1717
#else
1818
- __half_raw raw(x);
19-
+ __half_raw raw(*(reinterpret_cast<const unsigned short*>(&x)));
19+
+ __half_raw raw(*(reinterpret_cast<const __half_raw*>(&x)));
2020
std::memcpy(&storage, &raw.x, sizeof(storage));
2121
#endif
2222
return *this;

fvdb/env/test_environment.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ channels:
33
- pyg
44
- nvidia/label/cuda-12.1.0
55
- pytorch
6-
- conda-forge
76
dependencies:
87
- python=3.10
9-
- pytorch=2.2
10-
- pytorch-cuda=12.1
8+
- pytorch::pytorch=2.2
9+
- pytorch::pytorch-cuda=12.1
1110
- tensorboard
1211
- pip
1312
- git
1413
- gitpython
1514
- ca-certificates
1615
- certifi
1716
- openssl
18-
- cuda
19-
- cuda-nvcc
17+
- nvidia/label/cuda-12.1.0::cuda
18+
- nvidia/label/cuda-12.1.0::cuda-tools
19+
- nvidia/label/cuda-12.1.0::cuda-nvcc
20+
- nvidia/label/cuda-12.1.0::cuda-cccl
21+
- nvidia/label/cuda-12.1.0::cuda-libraries-static
2022
- parameterized
2123
- gcc_linux-64=11
2224
- gxx_linux-64=11

fvdb/fvdb/_Cpp.pyi

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ class JaggedTensor:
118118
@property
119119
def dtype(self) -> torch.dtype: ...
120120
@property
121-
def jidx(self) -> torch.ShortTensor: ...
121+
def jidx(self) -> torch.IntTensor: ...
122+
@property
123+
def jlidx(self) -> torch.IntTensor: ...
122124
@property
123125
def joffsets(self) -> torch.LongTensor: ...
124126
@property
@@ -134,6 +136,19 @@ class JaggedTensor:
134136
@property
135137
def requires_grad(self) -> bool: ...
136138

139+
@staticmethod
140+
def from_data_and_indices(data: torch.Tensor, indices: torch.Tensor, num_tensors: int) -> JaggedTensor: ...
141+
142+
@staticmethod
143+
def from_data_indices_and_list_ids(data: torch.Tensor, indices: torch.Tensor, list_ids: torch.Tensor, num_tensors: int) -> JaggedTensor: ...
144+
145+
@staticmethod
146+
def from_data_and_offsets(data: torch.Tensor, offsets: torch.Tensor) -> JaggedTensor: ...
147+
148+
@staticmethod
149+
def from_data_offsets_and_list_ids(data: torch.Tensor, offsets: torch.Tensor, list_ids: torch.Tensor) -> JaggedTensor: ...
150+
151+
137152
JaggedTensorOrTensor = Union[torch.Tensor, JaggedTensor]
138153

139154
class GridBatch:
@@ -243,8 +258,8 @@ class GridBatch:
243258
def cubes_in_grid(self, cube_centers: JaggedTensorOrTensor, cube_min: Vec3dOrScalar = 0.0, cube_max: Vec3dOrScalar = 0.0, ignore_disabled: bool = False) -> JaggedTensor: ...
244259
def cubes_intersect_grid(self, cube_centers: JaggedTensorOrTensor, cube_min: Vec3dOrScalar = 0.0, cube_max: Vec3dOrScalar = 0.0, ignore_disabled: bool = False) -> JaggedTensor: ...
245260

246-
def ijk_to_index(self, ijk: JaggedTensorOrTensor) -> JaggedTensor: ...
247-
def ijk_to_inv_index(self, ijk: JaggedTensorOrTensor) -> JaggedTensor: ...
261+
def ijk_to_index(self, ijk: JaggedTensorOrTensor, cumulative: bool = False) -> JaggedTensor: ...
262+
def ijk_to_inv_index(self, ijk: JaggedTensorOrTensor, cumulative: bool = False) -> JaggedTensor: ...
248263
def neighbor_indexes(self, ijk: JaggedTensorOrTensor, extent: int, bitshift: int = 0) -> JaggedTensor: ...
249264

250265
def splat_bezier(self, points: JaggedTensorOrTensor, points_data: JaggedTensorOrTensor) -> JaggedTensor: ...
@@ -256,7 +271,7 @@ class GridBatch:
256271

257272

258273
def segments_along_rays(self, ray_origins: JaggedTensorOrTensor, ray_directions: JaggedTensorOrTensor, max_segments: int, eps: float = 0.0, ignore_masked: bool = False) -> JaggedTensor: ...
259-
def voxels_along_rays(self, ray_origins: JaggedTensorOrTensor, ray_directions: JaggedTensorOrTensor, max_voxels: int, eps: float = 0.0, return_ijk: bool = True) -> Tuple[JaggedTensor, JaggedTensor]: ...
274+
def voxels_along_rays(self, ray_origins: JaggedTensorOrTensor, ray_directions: JaggedTensorOrTensor, max_voxels: int, eps: float = 0.0, return_ijk: bool = True, cumulative: bool = False) -> Tuple[JaggedTensor, JaggedTensor]: ...
260275
def uniform_ray_samples(self, ray_origins: JaggedTensorOrTensor, ray_directions: JaggedTensorOrTensor, t_min: JaggedTensorOrTensor, t_max: JaggedTensorOrTensor, step_size: float, cone_angle: float = 0.0, include_end_segments : bool = True, return_midpoints: bool = False, eps: float = 0.0) -> JaggedTensor: ...
261276
def ray_implicit_intersection(self, ray_origins: JaggedTensorOrTensor, ray_directions: JaggedTensorOrTensor, grid_scalars: JaggedTensorOrTensor, eps: float = 0.0) -> JaggedTensor: ...
262277

fvdb/fvdb/nn/vdbtensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _feature_ops(op, other: List[Union["VDBTensor", JaggedTensor, Any]]):
7171
raw_features.append(o.feature.jdata)
7272
elif isinstance(o, JaggedTensor):
7373
assert pivot_tensor.total_voxels == o.jdata.size(0), "All tensors should have the same voxels"
74-
assert pivot_tensor.grid.grid_count == len(o.joffsets), "All tensors should have the same batch size"
74+
assert pivot_tensor.grid.grid_count == o.num_tensors, "All tensors should have the same batch size"
7575
raw_features.append(o.jdata)
7676
else:
7777
raw_features.append(o)

0 commit comments

Comments
 (0)