622 Commits

Author SHA1 Message Date
Jeremy Francis Reizenstein
3fc3ea507b PyTorch>1.9 version str
Make code for downloading linux wheels robust to double-digit PyTorch version.
2021-12-17 06:01:51 -08:00
Jeremy Reizenstein
d049cd2e01 PyTorch 1.10 + CUDA 11.1 builds
Summary: Although the PyTorch website, which describes the current version 1.10, suggests CUDA 10.2 and 11.3 are supported, it would appear that we need to include builds for CUDA 11.1 to avoid surprises. This is because these builds are on anaconda, and this combination is used on Google Colab.

Reviewed By: nikhilaravi

Differential Revision: D33063932

fbshipit-source-id: 1b22d1f06e22bd18fb53ceecb58e78ac6a5d1693
v0.6.1
2021-12-13 10:11:00 -08:00
Jeremy Reizenstein
1edc624d82 version 0.6.1
Summary: Update version number

Reviewed By: patricklabatut

Differential Revision: D33016833

fbshipit-source-id: ee3b0997887ab3bc5779503b13fa2014df41eaed
2021-12-13 04:38:16 -08:00
Jeremy Reizenstein
6ea6314792 [pytorch3d install.md for 0.6.1
Summary: Update references to dependencies

Reviewed By: patricklabatut

Differential Revision: D33016832

fbshipit-source-id: aa41c7ccc6acd19654303bc18bfd734dc29d88a3
2021-12-13 04:38:16 -08:00
Jeremy Reizenstein
093999e71f update tutorials for release
Summary: Pre 0.6.1 release, make the tutorials expect wheels with PyTorch 1.10.0

Reviewed By: patricklabatut

Differential Revision: D33016834

fbshipit-source-id: b8c5c1c6158f806c3e55ec668117fa762fa4b75f
2021-12-13 04:38:16 -08:00
Jeremy Reizenstein
a22b1e32a4 linux builds for PyTorch 1.10.0
Summary: Build the wheels with latest PyTorch

Reviewed By: patricklabatut

Differential Revision: D33016835

fbshipit-source-id: 0ec42f31f1e4d4055562f18790f929b34bb13c52
2021-12-13 04:38:16 -08:00
CodemodService FBSourceClangFormatLinterBot
9c9d9440f9 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D32975574

fbshipit-source-id: 66856595c7bc29921f24a2c5c00c72892f262aa1
2021-12-09 00:10:21 -08:00
Peter Bell
c65af9ef5a Remove remaining THC code (#69039)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69039

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D32872476

Pulled By: ngimel

fbshipit-source-id: 7972aacc24aef9450fb59b707ed6396c501bcb31
2021-12-08 12:15:58 -08:00
Jeremy Reizenstein
70acb3e415 new tests demonstrating pixel matching
Summary: Demonstrate current behavior of pixels with new tests of all renderers.

Reviewed By: gkioxari

Differential Revision: D32651141

fbshipit-source-id: 3ca30b4274ed2699bc5e1a9c6437eb3f0b738cbf
2021-12-07 15:04:20 -08:00
Jeremy Reizenstein
bf3bc6f8e3 screen cameras lose -1
Summary:
All the renderers in PyTorch3D (pointclouds including pulsar, meshes, raysampling) use align_corners=False style. NDC space goes between the edges of the outer pixels. For a non square image with W>H, the vertical NDC space goes from -1 to 1 and the horizontal from -W/H to W/H.

However it was recently pointed out that functionality which deals with screen space inside the camera classes is inconsistent with this. It unintentionally uses align_corners=True. This fixes that.

This would change behaviour of the following:
- If you create a camera in screen coordinates, i.e. setting in_ndc=False, then anything you do with the camera which touches NDC space may be affected, including trying to use renderers. The transform_points_screen function will not be affected...
- If you call the function “transform_points_screen” on a camera defined in NDC space results will be different. I have illustrated in the diff how to get the old results from the new results but this probably isn’t the right long-term solution..

Reviewed By: gkioxari

Differential Revision: D32536305

fbshipit-source-id: 377325a9137282971dcb7ca11a6cba3fc700c9ce
2021-12-07 15:04:20 -08:00
Jeremy Reizenstein
cff4876131 add from_ndc to unproject_points
Summary: Give unproject_points an argument letting it bypass screen space. use it to let the raysampler work for cameras defined in screen space.

Reviewed By: gkioxari

Differential Revision: D32596600

fbshipit-source-id: 2fe585dcd138cdbc65dd1c70e1957fd894512d3d
2021-12-07 15:04:20 -08:00
Jeremy Reizenstein
a0e2d2e3c3 move benchmarks to separate directory
Summary: Move benchmarks to a separate directory as tests/ is getting big.

Reviewed By: nikhilaravi

Differential Revision: D32885462

fbshipit-source-id: a832662a494ee341ab77d95493c95b0af0a83f43
2021-12-07 10:26:50 -08:00
Roman Shapovalov
a6508ac3df Fix: Pointclouds.inside_box reducing over spatial dimensions.
Summary: As subj. Tests corrected accordingly. Also changed the test to provide a bit better diagnostics.

Reviewed By: bottler

Differential Revision: D32879498

fbshipit-source-id: 0a852e4a13dcb4ca3e54d71c6b263c5d2eeaf4eb
2021-12-06 07:45:46 -08:00
Ana Dodik
d9f709599b Adding the option to choose the texture sampling mode in TexturesUV.
Summary:
This diff adds the `sample_mode` parameter to `TexturesUV` to control the interpolation mode during texture sampling. It simply gets forwarded to `torch.nn.funcitonal.grid_sample`.

This option was requested in this [GitHub issue](https://github.com/facebookresearch/pytorch3d/issues/805).

Reviewed By: patricklabatut

Differential Revision: D32665185

fbshipit-source-id: ac0bc66a018bd4cb20d75fec2d7c11145dd20199
2021-11-29 07:01:28 -08:00
Patrick Labatut
e4456dba2f Facebook -> Meta Platforms on website footer + docs
Summary: Update company copyright on website footer + documentation pages, see [guidelines](https://www.internalfb.com/intern/wiki/Open_Source/Launch_an_OSS_Project/Launch_Preparation/Automated_Checkup/Terms_Of_Use_&_Privacy_Policy/).

Reviewed By: bottler

Differential Revision: D32649563

fbshipit-source-id: f285be79c185496832c5d41b839ee974234a8fa5
2021-11-24 10:07:15 -08:00
Jeremy Reizenstein
7fa333f632 Fix some Transform3D -> Transform3d
Summary: Fix some typos in comments.

Reviewed By: patricklabatut

Differential Revision: D32596645

fbshipit-source-id: 09b6d8c49f4f0301b80df626c6f9a2d5b5d9b1a7
2021-11-23 11:31:11 -08:00
Jeremy Reizenstein
a0247ea6bd pulsar image_size validation
Summary:
For a non-square image, the image_size in PointsRasterizationSettings is now (H,W) not (W,H). A part of pulsar's validation code wasn't updated for this.

The following now works.
```
H, W = 249, 125
image_size = (H, W)
camera = PerspectiveCameras(focal_length=1.0, image_size=(image_size,), in_ndc=True)
points_rasterizer = PointsRasterizer(cameras=camera, raster_settings=PointsRasterizationSettings(image_size=image_size, radius=0.0000001))
pulsar_renderer = PulsarPointsRenderer(rasterizer=points_rasterizer)
pulsar_renderer(Pointclouds(...), gamma = (0.1,), znear = (0.1,), zfar = (70,))
```

Reviewed By: nikhilaravi, classner

Differential Revision: D32316322

fbshipit-source-id: 8405a49acecb1c95d37ee368c3055868b797208a
2021-11-17 15:18:01 -08:00
Pyre Bot Jr
a8cb7fa862 suppress errors in fbcode/vision - batch 2
Differential Revision: D32509948

fbshipit-source-id: 762ad27c7e6c76c30eb97fd44f1739295f63b98b
2021-11-17 14:38:11 -08:00
Jeremy Reizenstein
7ce18f38cd TexturesAtlas in plotly
Summary:
Lets a K=1 textures atlas be viewed in plotly. Fixes https://github.com/facebookresearch/pytorch3d/issues/916 .

Test: Now get colored faces in
```
import torch
from pytorch3d.utils import ico_sphere
from pytorch3d.vis.plotly_vis import plot_batch_individually
from pytorch3d.renderer import TexturesAtlas

b = ico_sphere()
face_colors = torch.rand(b.faces_padded().shape)
tex = TexturesAtlas(face_colors[:,:,None,None])
b.textures=tex
plot_batch_individually(b)
```

Reviewed By: gkioxari

Differential Revision: D32190470

fbshipit-source-id: 258d30b7e9d79751a79db44684b5540657a2eff5
2021-11-11 02:15:33 -08:00
Jeremy Reizenstein
5fbdb99aec builds for pytorch 1.10.0
Summary:
Add builds corresponding to the new pytorch 1.10.0. We omit CUDA 11.3 testing because it fails with current hardware, and omit the main build too for the moment.

Also move to the newer GPU circle CI executors.

Reviewed By: gkioxari

Differential Revision: D32335934

fbshipit-source-id: 416d92a8eecd06ef7fc742664a5f2d46f93415f8
2021-11-11 02:03:37 -08:00
Pyre Bot Jr
1836c786fe suppress errors in vision/fair/pytorch3d
Differential Revision: D32310496

fbshipit-source-id: fa1809bbe0b999baee6d07fad3890dc8c2a2157b
2021-11-10 02:52:00 -08:00
Ignacio Rocco
cac6cb1b78 Update NDC raysampler for non-square convention (#29)
Summary:
- Old NDC convention had xy coords in [-1,1]x[-1,1]
- New NDC convention has xy coords in [-1, 1]x[-u, u] or [-u, u]x[-1, 1]

where u > 1 is the aspect ratio of the image.

This PR fixes the NDC raysampler to use the new convention.

Partial fix for https://github.com/facebookresearch/pytorch3d/issues/868

Pull Request resolved: https://github.com/fairinternal/pytorch3d/pull/29

Reviewed By: davnov134

Differential Revision: D31926148

Pulled By: bottler

fbshipit-source-id: c6c42c60d1473b04e60ceb49c8c10951ddf03c74
2021-11-05 10:36:19 -07:00
Jeremy Reizenstein
bfeb82efa3 some pointcloud typing
Summary: Make clear that features_padded() etc can return None

Reviewed By: patricklabatut

Differential Revision: D31795088

fbshipit-source-id: 7b0bbb6f3b7ad7f7b6e6a727129537af1d1873af
2021-10-28 04:54:20 -07:00
Jeremy Reizenstein
73a14d7266 dataparallel fix
Summary: Attempt to overcome flaky test

Reviewed By: patricklabatut

Differential Revision: D31895560

fbshipit-source-id: 1ecbb1782b0eafe132f88425c48487c2d0e10d2d
2021-10-26 14:35:30 -07:00
una-dinosauria
bee31c48d3 Make some matrix conversion jittable (#898)
Summary:
Make sure the functions from `rotation_conversion` are jittable, and add some type hints.

Add tests to verify this is the case.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/898

Reviewed By: patricklabatut

Differential Revision: D31926103

Pulled By: bottler

fbshipit-source-id: bff6013c5ca2d452e37e631bd902f0674d5ca091
2021-10-26 14:31:46 -07:00
RWL
29417d1f9b NaN (divide by zero) fix for issue #561 and #790 (#891)
Summary:
https://github.com/facebookresearch/pytorch3d/issues/561
https://github.com/facebookresearch/pytorch3d/issues/790
Divide by zero fix (NaN fix).  When perspective_correct=True, BarycentricPerspectiveCorrectionForward and BarycentricPerspectiveCorrectionBackward in ../csrc/utils/geometry_utils.cuh are called.  The denominator (denom) values should not be allowed to go to zero. I'm able to resolve this issue locally with this PR and submit it for the team's review.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/891

Reviewed By: patricklabatut

Differential Revision: D31829695

Pulled By: bottler

fbshipit-source-id: a3517b8362f6e60d48c35731258d8ce261b1d912
2021-10-22 04:52:06 -07:00
Peter Bell
57b9c729b8 Remove THCGeneral.cpp (#66766)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/66766

Test Plan: Imported from OSS

Reviewed By: zou3519

Differential Revision: D31721647

Pulled By: ngimel

fbshipit-source-id: 5033a2800871c8745a1a92e379c9f97c98af212e
2021-10-19 16:08:39 -07:00
Pyre Bot Jr
7c111f7379 suppress errors in vision/fair/pytorch3d
Differential Revision: D31737477

fbshipit-source-id: 2590548c1b7a65c277ccddd405276c244fde0961
2021-10-18 12:18:08 -07:00
Jeremy Reizenstein
3953de47ee remove torch from cuda
Summary: Keep using at:: instead of torch:: so we don't need torch/extension.h and can keep other compilers happy.

Reviewed By: patricklabatut

Differential Revision: D31688436

fbshipit-source-id: 1825503da0104acaf1558d17300c02ef663bf538
2021-10-18 03:38:11 -07:00
Jeremy Reizenstein
1a7442a483 windows compatibility
Summary: Few tweaks to make CUDA build on windows happier, as remarked in #876.

Reviewed By: patricklabatut

Differential Revision: D31688188

fbshipit-source-id: 20816d6215f2e3ec898f81ae4221b1c2ff24b64f
2021-10-18 03:38:11 -07:00
Ignacio Rocco
16ebf54e69 NDC doc fix (#28)
Summary:
- Added clarifications about NDC coordinate system for square and non-square images.

Pull Request resolved: https://github.com/fairinternal/pytorch3d/pull/28

Reviewed By: nikhilaravi

Differential Revision: D31681444

Pulled By: bottler

fbshipit-source-id: f71eabe9b3dd54b9372cef617e08f837f316555b
2021-10-17 07:41:57 -07:00
Jeremy Reizenstein
14dd2611ee Remove version number from docs title
Summary: Small docs fixes: spelling. Avoid things which get out of date quickly: year, version.

Reviewed By: patricklabatut

Differential Revision: D31659927

fbshipit-source-id: b0111140bdaf3c6cadc09f70621bf5656909ca02
2021-10-16 15:06:23 -07:00
Jeremy Reizenstein
34b1b4ab8b defaulted grid_sizes in points2vols
Summary: Fix #873, that grid_sizes defaults to the wrong dtype in points2volumes code, and mask doesn't have a proper default.

Reviewed By: nikhilaravi

Differential Revision: D31503545

fbshipit-source-id: fa32a1a6074fc7ac7bdb362edfb5e5839866a472
2021-10-16 14:41:59 -07:00
Nikhila Ravi
2f2466f472 Update eps for coplanar check in 3D IoU
Summary: Make eps=1e-4 by default for coplanar check and also enable it to be set by the user in call to `box3d_overlap`.

Reviewed By: gkioxari

Differential Revision: D31596836

fbshipit-source-id: b57fe603fd136cfa58fddf836922706d44fe894e
2021-10-13 13:29:47 -07:00
Jeremy Reizenstein
53d99671bd remove PyTorch 1.5 builds
Summary: PyTorch 1.6.0 came out on 28 Jul 2020. Stop builds for 1.5.0 and 1.5.1. Also update the news section of the README for recent releases.

Reviewed By: nikhilaravi

Differential Revision: D31442830

fbshipit-source-id: 20bdd8a07090776d0461240e71c6536d874615f6
2021-10-11 06:13:01 -07:00
Pyre Bot Jr
6d36c1e2b0 suppress errors in vision/fair/pytorch3d
Differential Revision: D31496551

fbshipit-source-id: 705fd88f319875db3f7938a2946c48a51ea225f5
2021-10-07 21:58:08 -07:00
Nikhila Ravi
6dfa326922 IOU box3d epsilon fix
Summary: The epsilon value is important for determining whether vertices are inside/outside a plane.

Reviewed By: gkioxari

Differential Revision: D31485247

fbshipit-source-id: 5517575de7c02f1afa277d00e0190a81f44f5761
2021-10-07 18:42:09 -07:00
Jeremy Reizenstein
b26f4bc33a test tolerance loosenings
Summary: Increase some test tolerances so that they pass in more situations, and re-enable two tests.

Reviewed By: nikhilaravi

Differential Revision: D31379717

fbshipit-source-id: 06a25470cc7b6d71cd639d9fd7df500d4b84c079
2021-10-07 10:48:12 -07:00
Ruilong Li
8fa438cbda Fix camera conversion between opencv and pytorch3d
Summary:
For non square image, the NDC space in pytorch3d is not square [-1, 1]. Instead, it is [-1, 1] for the smallest side, and [-u, u] for the largest side, where u > 1. This behavior is followed by the pytorch3d renderer.

See the function `get_ndc_to_screen_transform` for a example.

Without this fix, the rendering result is not correct using the converted pytorch3d-camera from a opencv-camera on non square images.

This fix also helps the `transform_points_screen` function delivers consistent results with opencv projection for the converted pytorch3d-camera.

Reviewed By: classner

Differential Revision: D31366775

fbshipit-source-id: 8858ae7b5cf5c0a4af5a2af40a1358b2fe4cf74b
2021-10-07 10:15:31 -07:00
CodemodService Bot
815a93ce89 Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D31464988

fbshipit-source-id: 2eaf28d6869ccb70fd4df4f7de15d959cdaba0be
2021-10-06 21:19:23 -07:00
Jeremy Reizenstein
23ef666db1 build website in docker container
Summary: Do the website building in a docker container to avoid worrying about dependencies.

Reviewed By: nikhilaravi

Differential Revision: D30223892

fbshipit-source-id: 77b7b4630188167316891381f6ca9e9fbe7f0a05
2021-10-06 18:09:45 -07:00
Nikita Smetanin
d7d740abe9 Symmetric eigen 3x3 implementation + benchmark & tests
Summary:
Symmetric eigenvalues 3x3 implementation from https://github.com/fairinternal/denseposeslim/blob/roman_c3dpo/tools/functions.py#L612

based on https://en.wikipedia.org/wiki/Eigenvalue_algorithm#3.C3.973_matrices and https://www.geometrictools.com/Documentation/RobustEigenSymmetric3x3.pdf

Benchmarks show significant outperformance of symeig3x3 in comparison with torch implementations (torch.symeig and torch.linalg.eigh) on GPU (P100), especially for large batches: 70-280ns per sample vs 3400ns per sample for torch_linalg_eigh_1048576_cpu

It's worth mentioning that torch.linalg.eigh is still comparably fast for batches up to 8192 on CPU.

Some tests are still failing as the error thresholds need to be adjusted appropriately.

Reviewed By: patricklabatut

Differential Revision: D29915453

fbshipit-source-id: 7c1b062da631c57c4e22a42dd0027ea5e205f1b5
2021-10-06 10:57:07 -07:00
Jeremy Reizenstein
9585a58d10 version number 0.6.0
Summary: update

Reviewed By: patricklabatut

Differential Revision: D31338002

fbshipit-source-id: 90ed6c2ea411c0384dd233ee88e51b5f608eef88
v0.6.0
2021-10-05 16:25:25 -07:00
Jeremy Reizenstein
364a7dcaf4 Install.md for next release.
Summary: now supporting PyTorch 1.9.1

Reviewed By: patricklabatut

Differential Revision: D31338001

fbshipit-source-id: 11140819d10af388d31905a39f1da136cf9c5ff2
2021-10-05 16:25:25 -07:00
Georgia Gkioxari
1360d69ffb minor note fix
Summary: A small fix for the iou3d note

Reviewed By: bottler

Differential Revision: D31370686

fbshipit-source-id: 6c97302b5c78de52915f31be70f234179c4b246d
2021-10-03 17:17:47 -07:00
Jeremy Reizenstein
4281df19ce subsample pointclouds
Summary: New function to randomly subsample Pointclouds to a maximum size.

Reviewed By: nikhilaravi

Differential Revision: D30936533

fbshipit-source-id: 789eb5004b6a233034ec1c500f20f2d507a303ff
2021-10-02 13:40:16 -07:00
Jeremy Reizenstein
ee2b2feb98 Use C++/CUDA in points2vols
Summary:
Move the core of add_points_to_volumes to the new C++/CUDA implementation. Add new flag to let the user stop this happening. Avoids copies. About a 30% speedup on the larger cases, up to 50% on the smaller cases.

New timings
```
Benchmark                                                               Avg Time(μs)      Peak Time(μs) Iterations
--------------------------------------------------------------------------------
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[25, 25, 25]_1000                     4575           12591            110
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[25, 25, 25]_10000                   25468           29186             20
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[25, 25, 25]_100000                 202085          209897              3
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[101, 111, 121]_1000                 46059           48188             11
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[101, 111, 121]_10000                83759           95669              7
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[101, 111, 121]_100000              326056          339393              2
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[25, 25, 25]_1000                       2379            4738            211
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[25, 25, 25]_10000                     12100           63099             42
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[25, 25, 25]_100000                    63323           63737              8
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[101, 111, 121]_1000                   45216           45479             12
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[101, 111, 121]_10000                  57205           58524              9
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[101, 111, 121]_100000                139499          139926              4
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[25, 25, 25]_1000                   40129           40431             13
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[25, 25, 25]_10000                 204949          239293              3
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[25, 25, 25]_100000               1664541         1664541              1
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[101, 111, 121]_1000               391573          395108              2
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[101, 111, 121]_10000              674869          674869              1
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[101, 111, 121]_100000            2713632         2713632              1
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[25, 25, 25]_1000                     12726           13506             40
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[25, 25, 25]_10000                    73103           73299              7
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[25, 25, 25]_100000                  598634          598634              1
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[101, 111, 121]_1000                 398742          399256              2
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[101, 111, 121]_10000                543129          543129              1
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[101, 111, 121]_100000              1242956         1242956              1
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[25, 25, 25]_1000                  1814            8884            276
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[25, 25, 25]_10000                 1996            8851            251
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[25, 25, 25]_100000                4608           11529            109
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[101, 111, 121]_1000               5183           12508             97
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[101, 111, 121]_10000              7106           14077             71
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[101, 111, 121]_100000            25914           31818             20
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[25, 25, 25]_1000                    1778            8823            282
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[25, 25, 25]_10000                   1825            8613            274
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[25, 25, 25]_100000                  3154           10161            159
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[101, 111, 121]_1000                 4888            9404            103
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[101, 111, 121]_10000                5194            9963             97
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[101, 111, 121]_100000               8109           14933             62
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[25, 25, 25]_1000                 3320           10306            151
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[25, 25, 25]_10000                7003            8595             72
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[25, 25, 25]_100000              49140           52957             11
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[101, 111, 121]_1000             35890           36918             14
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[101, 111, 121]_10000            58890           59337              9
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[101, 111, 121]_100000          286878          287600              2
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[25, 25, 25]_1000                   2484            8805            202
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[25, 25, 25]_10000                  3967            9090            127
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[25, 25, 25]_100000                19423           19799             26
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[101, 111, 121]_1000               33228           33329             16
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[101, 111, 121]_10000              37292           37370             14
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[101, 111, 121]_100000             73550           74017              7
--------------------------------------------------------------------------------
```
Previous timings
```
Benchmark                                                               Avg Time(μs)      Peak Time(μs) Iterations
--------------------------------------------------------------------------------
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[25, 25, 25]_1000                    10100           46422             50
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[25, 25, 25]_10000                   28442           32100             18
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[25, 25, 25]_100000                 241127          254269              3
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[101, 111, 121]_1000                 54149           79480             10
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[101, 111, 121]_10000               125459          212734              4
ADD_POINTS_TO_VOLUMES_cpu_10_trilinear_[101, 111, 121]_100000              512739          512739              1
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[25, 25, 25]_1000                       2866           13365            175
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[25, 25, 25]_10000                      7026           12604             72
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[25, 25, 25]_100000                    48822           55607             11
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[101, 111, 121]_1000                   38098           38576             14
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[101, 111, 121]_10000                  48006           54120             11
ADD_POINTS_TO_VOLUMES_cpu_10_nearest_[101, 111, 121]_100000                131563          138536              4
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[25, 25, 25]_1000                   64615           91735              8
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[25, 25, 25]_10000                 228815          246095              3
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[25, 25, 25]_100000               3086615         3086615              1
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[101, 111, 121]_1000               464298          465292              2
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[101, 111, 121]_10000             1053440         1053440              1
ADD_POINTS_TO_VOLUMES_cpu_100_trilinear_[101, 111, 121]_100000            6736236         6736236              1
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[25, 25, 25]_1000                     11940           12440             42
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[25, 25, 25]_10000                    56641           58051              9
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[25, 25, 25]_100000                  711492          711492              1
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[101, 111, 121]_1000                 326437          329846              2
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[101, 111, 121]_10000                418514          427911              2
ADD_POINTS_TO_VOLUMES_cpu_100_nearest_[101, 111, 121]_100000              1524285         1524285              1
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[25, 25, 25]_1000                  5949           13602             85
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[25, 25, 25]_10000                 5817           13001             86
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[25, 25, 25]_100000               23833           25971             21
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[101, 111, 121]_1000               9029           16178             56
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[101, 111, 121]_10000             11595           18601             44
ADD_POINTS_TO_VOLUMES_cuda:0_10_trilinear_[101, 111, 121]_100000            46986           47344             11
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[25, 25, 25]_1000                    2554            9747            196
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[25, 25, 25]_10000                   2676            9537            187
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[25, 25, 25]_100000                  6567           14179             77
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[101, 111, 121]_1000                 5840           12811             86
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[101, 111, 121]_10000                6102           13128             82
ADD_POINTS_TO_VOLUMES_cuda:0_10_nearest_[101, 111, 121]_100000              11945           11995             42
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[25, 25, 25]_1000                 7642           13671             66
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[25, 25, 25]_10000               25190           25260             20
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[25, 25, 25]_100000             212018          212134              3
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[101, 111, 121]_1000             40421           45692             13
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[101, 111, 121]_10000            92078           92132              6
ADD_POINTS_TO_VOLUMES_cuda:0_100_trilinear_[101, 111, 121]_100000          457211          457229              2
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[25, 25, 25]_1000                   3574           10377            140
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[25, 25, 25]_10000                  7222           13023             70
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[25, 25, 25]_100000                48127           48165             11
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[101, 111, 121]_1000               34732           35295             15
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[101, 111, 121]_10000              43050           51064             12
ADD_POINTS_TO_VOLUMES_cuda:0_100_nearest_[101, 111, 121]_100000            106028          106058              5
--------------------------------------------------------------------------------
```

Reviewed By: nikhilaravi

Differential Revision: D29548609

fbshipit-source-id: 7026e832ea299145c3f6b55687f3c1601294f5c0
2021-10-01 11:58:24 -07:00
Jeremy Reizenstein
9ad98c87c3 Cuda function for points2vols
Summary: Added CUDA implementation to match the new, still unused, C++ function for the core of points2vols.

Reviewed By: nikhilaravi

Differential Revision: D29548608

fbshipit-source-id: 16ebb61787fcb4c70461f9215a86ad5f97aecb4e
2021-10-01 11:58:24 -07:00
Jeremy Reizenstein
0dfc6e0eb8 CPU function for points2vols
Summary: Single C++ function for the core of points2vols, not used anywhere yet. Added ability to control align_corners and the weight of each point, which may be useful later.

Reviewed By: nikhilaravi

Differential Revision: D29548607

fbshipit-source-id: a5cda7ec2c14836624e7dfe744c4bbb3f3d3dfe2
2021-10-01 11:58:24 -07:00
Jeremy Reizenstein
c7c6deab86 compatibility statement in README
Summary: Statement about compatibility.

Reviewed By: nikhilaravi

Differential Revision: D30697072

fbshipit-source-id: aeb5e3e0a08c1797033d8c00b24484c8a699cb02
2021-09-30 10:50:11 -07:00