-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
torch.dot()
produce wrong results
#180
Comments
Thanks for the detailed report. To try to narrow down the problem (in this case: away from OpenBLAS, which does a lot of the internals behind matrix/tensor multiplication), could you try modifying (or recreating) your
and try again? |
thx for the instant reply. i name this environment conda create -y -n test02
conda install -y -n test02 -c conda-forge python pytorch "libblas=*=*netlib"
# libblas[build=*netlib]
conda activate test02 python draft00.py
# tensor(0.+0.j, dtype=torch.complex128) ##should be 4
|
Could you please print |
❯ python -c "import torch; print(torch.__config__.show())"
PyTorch built with:
- GCC 4.2
- C++ Version: 201703
- clang 15.0.7
- OpenMP 201811
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: NO AVX
- Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/Users/runner/miniforge3/conda-bld/pytorch-recipe_1690825982320/_build_env/bin/arm64-apple-darwin20.0.0-clang++, CXX_FLAGS=-ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fmessage-length=0 -isystem /Users/runner/miniforge3/conda-bld/pytorch-recipe_1690825982320/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/pytorch-recipe_1690825982320/work=/usr/local/src/conda/pytorch-2.0.0 -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/pytorch-recipe_1690825982320/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac=/usr/local/src/conda-prefix -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-error=unused-command-line-argument -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Werror=bool-operation -Winconsistent-missing-override -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wvla-extension -Wno-range-loop-analysis -Wno-pass-failed -Wsuggest-override -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wconstant-conversion -Wno-invalid-partial-specialization -Wno-typedef-redefinition -Wno-unused-private-field -Wno-inconsistent-missing-override -Wno-aligned-allocation-unavailable -Wno-constexpr-not-const -Wno-missing-braces -Wunused-lambda-capture -Wunused-local-typedef -Qunused-arguments -fcolor-diagnostics -fdiagnostics-color=always -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unguarded-availability-new -Wno-unused-private-field -Wno-missing-braces -Wno-constexpr-not-const -Wno-stringop-overflow, LAPACK_INFO=open, TORCH_DISABLE_GPU_ASSERTS=OFF, TORCH_VERSION=2.0.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKLDNN=0, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, |
Thanks. I can reproduce locally. Similar to this. pytorch/pytorch#64156 |
Also, pytorch from the pytorch channel has the right results |
Both |
Solution to issue cannot be found in the documentation.
Issue
claim:
pip install torch
gives the correct results, so I think it should be an issue to be reported here.claim: right now (2023-08-04) i can only reproduce this issue on macOS (I test both M1 and M2 silicon), cannot reproduce on ubuntu-22.04 with cuda.
minimum working example (MWE) to reproduce wrong results
python draft00.py # tensor(0.+0.j, dtype=torch.complex128) ##should be 4
MWE to reproduce correct results
python draft00.py # tensor(4.+0.j, dtype=torch.complex128)
Installed packages
Environment info
The text was updated successfully, but these errors were encountered: