Repository navigation
Use cudart symbols from the main program. - #994
Merged
Merged
Conversation
Our extension library links against cudart and pulls in the symbols. Use LoadLibrary(None) to use the same symbols as the _C extension. This fixes the PyTorch wheel when you don't have system CUDA installed.
soumith
approved these changes
Mar 13, 2017
jjsjann123
pushed a commit
to jjsjann123/pytorch
that referenced
this pull request
Aug 5, 2021
…. Print randlike input in fusion ir. (pytorch#994)
pedronaugusto
added a commit
to pedronaugusto/pytorch
that referenced
this pull request
Aug 7, 2026
…declines TORCH_IMPL_FUNC(ufunc_add_CUDA) carried a Sprint F.1 bypass: when `out` or either input was non-contiguous it contiguified the inputs, computed into a fresh buffer through haganeOpsAdd directly -- skipping add_stub and the whole vendor route -- then did out.set_(fresh). That was two silent-wrongs. torch.add(a, b, out=base[::2]) left `base` entirely untouched, because set_ rebinds the caller's tensor to the fresh storage; an explicit out= never received the result and the view's stride silently changed 2 -> 1. Measured all-zeros where CPU gives [3,0,3,0,3,0,3,0]. Separately add(x.t(), y).stride() returned (4,1) against CPU/CUDA's (1,6), since torch's meta function assigns the output the first input's strides and a contiguous substitute is an observable layout change. The bypass was not load-bearing: sub/mul/div never had it and are correct, and Double already took add_stub while non-contiguous. Removing it makes the wrapper the thin add_stub call its own header describes, and lets bin_g route the non-contiguous inputs it was hiding -- 60 stashes/step on ARDY, 579 -> 519, with zero bin_g out_not_contiguous declines. The capture-tape concern it was written for is pytorch#1003's, which is fixed; the conformance suite (pytorch#994) is unchanged by this commit (its one red row, retagged_activation_backward, is pre-existing and filed as pytorch#1028). note_general_alpha closes the instrument gap that made this hard to find: the alpha bridge recorded nothing on its MLX path, so those 60 stashes arrived with no named reason. It reports compute dtype, whether operand 2 is a cpu scalar, and whether alpha*b is exactly representable -- the three facts that decide whether a caller could be folded. On ARDY it fires zero times, which is what established that the general-alpha fold this slice was planned around is worth no stashes at all (pytorch#1029). Authored with Claude.
1 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our extension library links against cudart and pulls in the symbols. Use
LoadLibrary(None) to use the same symbols as the _C extension.
This fixes the PyTorch wheel when you don't have system CUDA installed.