Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[fft][2 of 3] Forward for fft methods#5856

Merged
ezyang merged 2 commits into
pytorch:masterfrom
ssnl:fft_fwd
Mar 28, 2018
Merged

[fft][2 of 3] Forward for fft methods#5856
ezyang merged 2 commits into
pytorch:masterfrom
ssnl:fft_fwd

Conversation

@ssnl
Copy link
Copy Markdown
Collaborator

@ssnl ssnl commented Mar 17, 2018

This builds upon #5855 , and is the second of three PRs that #5537 will be split into.

@ezyang
Copy link
Copy Markdown
Contributor

ezyang commented Mar 19, 2018

Forgot to check in a file?

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 19, 2018

@ezyang This should be built upon #5855 , but it doesn't include the commits from that. I didn't know how to split a PR. :P I'll fix this.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment thread test/test_torch.py Outdated

This comment was marked as off-topic.

Comment thread test/test_torch.py Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 23, 2018 via email

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 23, 2018 via email

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 23, 2018 via email

This comment was marked as off-topic.

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 23, 2018 via email

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ezyang
Copy link
Copy Markdown
Contributor

ezyang commented Mar 23, 2018

Still haven't reviewed the mkl. Just cufft and the wrapper.

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 23, 2018

.... omg why doesn't github email reply directly reply to the review comment.

// We need to clone the input tensor in these two cases.
auto complex_size_bytes = 2 * input.type().elementSizeInBytes();
if ((reinterpret_cast<std::uintptr_t>(input.data_ptr()) % complex_size_bytes != 0 ||
(complex_input && !complex_output && input.stride(signal_ndim) != 2))) {

This comment was marked as off-topic.

std::ostringstream ss;
ss << "cuFFT doesn't support signals of half type with compute "
<< "capability less than SM_53, but the device containing input half "
<< "tensor only has SM_" << dev_prop->major << dev_prop->minor;

This comment was marked as off-topic.

// including cuFFT and MKL.
//
// cuFFT doc: http://docs.nvidia.com/cuda/cufft/index.html#multi-dimensional
// MKL doc: https://software.intel.com/en-us/mkl-developer-reference-c-dfti-complex-storage-dfti-real-storage-dfti-conjugate-even-storage#CONJUGATE_EVEN_STORAGE

This comment was marked as off-topic.

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 28, 2018

@ezyang Ready for round 2 review :)

// signals, but only contains half (onesided) of the values.
// This function modifies inplace.
__forceinline__
static void _fft_fill_with_conjugate_symmetry_(Tensor& input,

This comment was marked as off-topic.

This comment was marked as off-topic.

bool need_contiguous = input.stride(signal_ndim) == 0;
if (complex_input) {
// Real/imag dimension must be like complex type. Need to make the input
// tensor conitugous if this dimension is not contiguous.

This comment was marked as off-topic.

// need to check input and output size and strides
// be careful about complex domain, where the stride needs to be divided by 2
// only need to test upper bound MKL_LONG_MAX as these values are non-negative
if (sizeof(MKL_LONG) < sizeof(int64_t)) {

This comment was marked as off-topic.

This comment was marked as off-topic.

});
}

// Returns undefined tensor if the parameter range is greater than MKL_LONG.

This comment was marked as off-topic.

@ezyang ezyang merged commit ecd5de0 into pytorch:master Mar 28, 2018
ssnl added a commit to ssnl/pytorch that referenced this pull request Mar 28, 2018
@ssnl ssnl mentioned this pull request Mar 28, 2018
@ssnl ssnl deleted the fft_fwd branch March 29, 2018 01:28
ezyang pushed a commit that referenced this pull request Mar 29, 2018
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
* implement fft ifft rfft irfft

* add tests for fft ifft rfft irfft
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants