Skip to content

[Resubmit] Migrate AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3 to c10::complex#38144

Closed
zasdfgbnm wants to merge 4 commits intomasterfrom
ci-all/complex-AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3
Closed

[Resubmit] Migrate AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3 to c10::complex#38144
zasdfgbnm wants to merge 4 commits intomasterfrom
ci-all/complex-AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3

Conversation

@zasdfgbnm
Copy link
Copy Markdown
Collaborator

This reverts commit 0c936f9.

…_AND_COMPLEX_AND3 to c10::complex"

This reverts commit 0c936f9.
@zasdfgbnm zasdfgbnm added the module: complex Related to complex number support in PyTorch label May 8, 2020
@zasdfgbnm zasdfgbnm mentioned this pull request May 8, 2020
@zasdfgbnm
Copy link
Copy Markdown
Collaborator Author

The solution should be

#if defined(CUDA_VERSION) && (CUDA_VERSION < 10000)
#define CUDA92_BUG(x) thrust::complex<T>(x.real(), x.imag())
#else
#define CUDA92_BUG(x) x
#endif

template<typename T>
C10_HOST_DEVICE T abs(const c10::complex<T>& z) {
#if defined(__CUDACC__) || defined(__HIPCC__)
  return thrust::abs(static_cast<thrust::complex<T>>(CUDA92_BUG(z)));
#else
  return std::abs(static_cast<std::complex<T>>(z));
#endif
}

#undef CUDA92_BUG

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 8, 2020

💊 CI failures summary and remediations

As of commit e5dcdf5 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

See how this bot performed.

This comment has been revised 3 times.

@zasdfgbnm zasdfgbnm changed the title [WIP] Migrate AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3 to c10::complex [Resubmit] Migrate AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3 to c10::complex May 10, 2020
@zasdfgbnm zasdfgbnm requested a review from anjali411 May 10, 2020 05:34
@zasdfgbnm
Copy link
Copy Markdown
Collaborator Author

@anjali411 This is ready

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@anjali411 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@anjali411 merged this pull request in 5077518.

@zasdfgbnm zasdfgbnm deleted the ci-all/complex-AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3 branch May 10, 2020 17:54
@jeffdaily
Copy link
Copy Markdown
Collaborator

@anjali411 This PR has caused ROCm tests to fail. Still investigating whether we can fix or need to revert.

@dagamayank
Copy link
Copy Markdown

/cc @xw285cornell

jeffdaily added a commit to ROCm/pytorch that referenced this pull request May 12, 2020
…c10::complex (pytorch#38144)"

This reverts commit 5077518.

The commit causes significant regressions for ROCm.
jeffdaily added a commit to ROCm/pytorch that referenced this pull request May 12, 2020
facebook-github-bot pushed a commit that referenced this pull request May 13, 2020
Summary:
CC ezyang xw285cornell
Pull Request resolved: #38363

Differential Revision: D21539778

Pulled By: ezyang

fbshipit-source-id: 0f7d3b8e3b30ab4d5992f1c13aa8d48069796a8d
zasdfgbnm added a commit to zasdfgbnm/pytorch that referenced this pull request May 13, 2020
@gchanan
Copy link
Copy Markdown
Contributor

gchanan commented May 13, 2020

can I merge #38274 before we try to land this again?

@jeffdaily
Copy link
Copy Markdown
Collaborator

@gchanan I think all issues are now resolved with this PR between #38363 and quickly followed by #38380 . Those PRs should land soon.

facebook-github-bot pushed a commit that referenced this pull request May 13, 2020
Summary:
The changes in this file broke ROCm and got reverted in #38363. This PR brings it back with ROCm fixed.
Pull Request resolved: #38380

Differential Revision: D21549632

Pulled By: ezyang

fbshipit-source-id: 68498aba70e651352d58fd0c865e71420dbf900a
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…plex (pytorch#38144)

Summary:
This reverts commit 2820ca7.
Pull Request resolved: pytorch#38144

Differential Revision: D21495374

Pulled By: anjali411

fbshipit-source-id: 33249659fba88f087539233c3d297c0280e17208
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
CC ezyang xw285cornell
Pull Request resolved: pytorch#38363

Differential Revision: D21539778

Pulled By: ezyang

fbshipit-source-id: 0f7d3b8e3b30ab4d5992f1c13aa8d48069796a8d
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…" (pytorch#38380)

Summary:
The changes in this file broke ROCm and got reverted in pytorch#38363. This PR brings it back with ROCm fixed.
Pull Request resolved: pytorch#38380

Differential Revision: D21549632

Pulled By: ezyang

fbshipit-source-id: 68498aba70e651352d58fd0c865e71420dbf900a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: complex Related to complex number support in PyTorch open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants