KEMBAR78
Fixed double memory accesses of several pointwise operations. by yongjik · Pull Request #5068 · pytorch/pytorch · GitHub
Skip to content

Conversation

@yongjik
Copy link
Contributor

@yongjik yongjik commented Feb 6, 2018

Because nvcc does not know that in/out pointers do not alias each other,
if we assign a value to *out and then use *in again, the kernel has to
emit a write to *out and then another read from *in.

(Affected kernels become marginally faster after the fix.)

Because nvcc does not know that in/out pointers do not alias each other,
if we assign a value to *out and then use *in again, the kernel has to
emit a write to *out and then another read from *in.

(Affected kernels become marginally faster after the fix.)
@soumith
Copy link
Member

soumith commented Feb 6, 2018

@pytorchbot retest this please

@soumith soumith added the 0.3.1 label Feb 6, 2018
@apaszke
Copy link
Contributor

apaszke commented Feb 6, 2018

Another possibility would be to use restrict, but this should be safer.

@soumith soumith merged commit 36bbaf0 into pytorch:master Feb 6, 2018
soumith pushed a commit that referenced this pull request Feb 7, 2018
Because nvcc does not know that in/out pointers do not alias each other,
if we assign a value to *out and then use *in again, the kernel has to
emit a write to *out and then another read from *in.

(Affected kernels become marginally faster after the fix.)
@yongjik yongjik deleted the 0205-remainder branch March 3, 2018 19:20
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.

4 participants