Repository navigation
Conversation
dipatched arange_out to linspace stub for complex types. To get same behvavior from the linspace we edited the end scalar to get proper steps
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/194890
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 5 Unrelated Failures, 3 Unclassified FailuresAs of commit bb84e66 with merge base 6b1f3af ( NEW FAILURES - The following jobs have failed:
NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following jobs failed, but the AI CI Advisor judged the failures not to be evidence against this change:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
|
You'd probably need to change dtype support in opinfo tests at least |
|
@ngimel I have added ComplexFloat, ComplexDouble as well as torch.bool in OpInfo. There was one more question about this codeblock. pytorch/torch/_refs/__init__.py Lines 5534 to 5570 in d724554 Should I remove the assertions since Complex types are now supported, It still works completely fine with complex types. |
|
YEs remove those assertions too |
I just noticed, if we remove these assertions, then we would have to do some bounds check again for complex numbers too. But same is already done in C++ bounds check at |
|
Yes python refs and c++ impls need to be in sync |
|
@ngimel Changes done. something like imo the step is 1 + 0j instead of 1 + 1j, so its expected to throw error. |
|
@ngimel can you start off the workflow? |
fix included handling for size 0 and 1 for arange, as well as fixed the expected Failure issues
|
@ngimel current fixes should fix all previous failures. Can you verify if semantics is as expected for torch.arange. Since current behavior diverges from numpy implementation of np.arange. |
|
cc @albanD |
|
Is the decision here that the default step is 1 + 0j ? For the discrepency with NumPy for |
yes the default step is if not specified must be 1 +0j.
if that is the expected behavior then we will go with it. |
|
I'll confirm that the numpy behavior makes no sense, there's a long-standing issue about it: numpy/numpy#10332. The docs were updated to make clear that only int/float dtypes are supported; the discussion on that issue leans towards a hard error, because there are several reasonable ways complex steps could be implemented.
I like some version of the latter suggestion better, since a default where the last element isn't approaching >>> start = 0; end = 4+8j
>>> (end - start) / (end - start)
(1+0j)There's no nice answer though, because if you approach the end point in a uniform fashion you'll get non-integer numbers: >>> (end - start) / abs(end - start)
(0.4472135954999579+0.8944271909999159j)Might be cleaner to require a |
|
Ho yes sorry. I forgot that complex division is not R2. Requiring the step to be specified sounds very fair to me indeed. |
|
@ngimel approved for the merge? |
|
@claude was a suggestion to require |
|
Claude finished @ngimel's task in 3m 9s —— View job Answer: No — and the last commit moved in the opposite direction
Short answer: the suggestion from @rgommers / @albanD to require an explicit Details1. Defaulted
|
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 6 checks: docs-build / linux-docs / build-docs-python-false, docs-build / linux-docs / build-docs-cpp-false, pull / linux-noble-xpu-n-py3.11 / build, pull / linux-jammy-aarch64-py3.11 / build, pull / linux-jammy-cuda13.2-cudnn9-py3.11-clang20 / build, pull / linux-jammy-py3.11-gcc11 / test (docs_test, 1, 1, mt-l-x86iavx512-8-64) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (mps, 1, 1, macos-m2-15), trunk / macos-py3-arm64 / test (default, 1, 3, macos-m1-stable) Details for Dev Infra teamRaised by workflow job |
|
|
|
@ngimel I have added same arange for CUDA as well and skipped mps tests since it does not support linespace as well |
|
@PyDevC looks like there's a related mps failure? |
|
@ngimel skipping for pythonrefinfo would fix it? |
|
@ngimel |
|
@claude are there CI failures related to this PR? |
|
Claude finished @ngimel's task in 1m 29s —— View job No, none of the current CI failures are related to this PR.On the latest commit ( DetailsI read the logs of the failing jobs in trunk run 37680852436.
|
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 11 checks: docs-build / linux-docs / build-docs-python-false, docs-build / linux-docs / build-docs-cpp-false, pull / linux-jammy-cuda13.2-cudnn9-py3.11-clang20 / build, pull / linux-jammy-aarch64-py3.11 / build, pull / linux-noble-xpu-n-py3.11 / build, pull / linux-jammy-py3.11-clang21 / test (dynamo_wrapped, 5, 6, mt-l-x86iavx512-8-64), pull / linux-jammy-py3.11-gcc11 / test (docs_test, 1, 1, mt-l-x86iavx512-8-64), trunk / dynamo-unittest / dynamo-test (3.11) / test (dynamo_wrapped, 5, 7, mt-l-x86iavx512-8-64), trunk / macos-py3-arm64 / test (default, 3, 3, macos-m1-stable), trunk / macos-py3-arm64 / test (default, 1, 3, macos-m1-stable), trunk / macos-py3-arm64 / test (default, 2, 3, macos-m1-stable) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Added support ComplexFloat and ComplexDouble for arange_cpu via linspace dispatch. Issue: pytorch#160629 @ngimel @malfet Pull Request resolved: pytorch#194890 Approved by: https://github.com/albanD
Added support ComplexFloat and ComplexDouble for arange_cpu via linspace dispatch.
Issue: #160629
@ngimel @malfet
cc @ezyang @anjali411 @dylanbespalko @mruberry @nikitaved @amjames