Comments (7)
Yeah, I mean, numpy result can provide a reference for which result of cpu/gpu may need to be fixed. And for numpy test we should feed a numpy array input.
from pytorch.
CPU output is aligned with np.linalg.qr
import numpy as np
input_np = np.array([[float('inf'), float('nan'), 5],[float('inf'), float('nan'), 5],[float('inf'), float('nan'), 5]], dtype=np.float32)
print(np.linalg.qr(input_np, mode='raw'))
output:
(array([[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan]], dtype=float32),
array([nan, nan, 0.], dtype=float32))
from pytorch.
When I tried to reproduce your code, I found it strange that for the code you provided, if you converted the input to torch.tensor the result would be different
import torch
import numpy as np
input_tensor=torch.tensor(np.array([[float('inf'), float('nan'), 5],[float('inf'), float('nan'), 5],[float('inf'), float('nan'), 5]], dtype=np.float32))
cpu =np.linalg.qr(input_tensor, mode='raw')
print(cpu)
from pytorch.
No idea. I'm not sure why we feed a torch.tensor input for numpy test?
from pytorch.
I only discovered this issue by chance while reproducing the code you provided. I believe that "torch.geqrf" should produce the same output on both CPU and GPU.
from pytorch.
Yeah, that's right, got it. Thanks for quick response!
from pytorch.
This is reproable on torch 2.3.
from pytorch.
Related Issues (20)
- randn generates different output for 4x4 tensor size sliced to match shape of direct 2x4 or 4x2 and compare output HOT 1
- [feature request]: Update max onnx opset to 21 for onnxruntime==1.18 compatability
- ROCm 6.x appears Cannot find CO in the bundle libhipblaslt.so for ISA HOT 20
- dynamo breaks when getting attributes of builtins
- tensordict functional calls with nn.Module silently gives the wrong (non-functional) result HOT 1
- dynamo doesn't support `__torch_function__` on non-tensor classes HOT 4
- RuntimeError: "_amp_foreach_non_finite_check_and_unscale_cuda" not implemented for 'BFloat16' HOT 3
- When training done, the mode output same result each tensor input. ( I tried many way to debug, but can't find any way to fix it, so i guess this is a bug ) HOT 1
- RuntimeError: MPS device does not support bmm for non-float inputs
- [Distributed] gloo backend, barrier operation is even slower than broadcast HOT 1
- [ONNX] metadata
- ERROR: Could not find a version that satisfies the requirement torch (from versions: none) HOT 1
- fatal: not a git repository: '.git' HOT 1
- `store_param_remainders` from Apex DistributedFusedAdam
- Unify async_save and sync_save in state_dict_saver from distributed checkpointing
- Segmentation fault when importing `sklearn.model_selection` HOT 2
- Should `torch.Size` convert np.ndarrays to lists of ints? HOT 1
- torch.topk results differ on CPU and CUDA
- Tensors of the same index must be on the same device and the same dtype except step tensors that can be CPU and float32 notwithstanding. HOT 4
- A UserWarning occurs after CBAM attention is added HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.