Skip to content

Triple backward custom CUDA kernel for interpolation supporting third order gradients

License

Notifications You must be signed in to change notification settings

NamGyuKang/CosineSampler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CosineSampler

We implemented the 2D, and 3D customized CUDA kernel of the triple backward grid sampler that supports cosine, linear, and smoothstep kernel (Thomas Müller) and third-order gradients $u_{xxc}, u_{yyc}$ with second-order gradients (Tymoteusz Bleja). As a result, the runtime and the memory requirement were significantly reduced. It is used in https://github.com/NamGyuKang/PIXEL

Installation

The code is tested with Python3 environment (3.8, 3.9) and PyTorch (1.11, 11.2) with CUDA (>=11.3).

pip install git+https://github.com/NamGyuKang/CosineSampler.git

Usage

You can choose the kernel (cosine, linear, smoothstep), and the multicell (True, False). The multicell is used in PIXEL (Physics-Informed Cell Representation), and if you set the multicell False, and linear kernel, it is the same with Pytorch grid_sample and our CosineSampler support triple backpropagation of kernel.

Compare CUDA with Pytorch

Second-order PDE (Helmholtz equation)

Citation

If you use this code for research, please consider citing:

@article{kang2023pixel,
title={PIXEL: Physics-Informed Cell Representations for Fast and Accurate PDE Solvers},
author={Kang, Namgyu and Lee, Byeonghyeon and Hong, Youngjoon and Yun, Seok-Bae and Park, Eunbyung},
journal={Proceedings of the AAAI Conference on Artificial Intelligence}, 
year={2023}}
                    

About

Triple backward custom CUDA kernel for interpolation supporting third order gradients

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published