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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown layout
while initializing tensors
#120020
Comments
I am having the same trouble. |
Hi priority to get a repro the issue and validate the claim that it worked in 2.1, but broken in 2.2 |
I have no issue on torch 2.1 |
Worked for me using package: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.2.0%2Bcpu.zip as suggested in https://pytorch.org/get-started/locally/
|
@sssrijan-amazon @michael-person could you please confirm the package url you used in your test ?
|
I suspect key here is gcc version, which is gcc-7 as reported by @sssrijan-amazon , but starting with PyTorch-2.2 we are building everything with gcc-9, as the first compiler version with stable C++17 ABI, and I suspect this what might be happening thrre. Trying to find a version of AmazonLinux with gcc-7 compiler installed by default |
I'm on one of the runner, gcc-7 is indeed the default on AmazonLinux 2
and the crash can be reproduced with gcc-7
So the fix would be to upgrade gcc to 9 or above. |
Ah, that would do it. I am on a Amazon Linux 2 AMI w/ gcc-7 |
Ok, let me add a check to one of the header to raise an explicit error if GCC major is less than 9 |
@michael-person aren't newer toolchain available to you? |
It's already a requirement for building PyTorch, but should be a requirement for linking extensions with it, as that can lead to runtime crashes, as `std::optional` template layout is incompatible between gcc-9 and older compilers. Also, update minimum supported clang version to 10.x, as clang-5 is clearly not C++17 compliant Fixes #120020
See also pytorch/pytorch#120020 We need to use gcc >=9 to build against pytorch 2.2.0
See also pytorch/pytorch#120020 We need to use gcc >=9 to build against pytorch 2.2.0
See also pytorch/pytorch#120020 We need to use gcc >=9 to build against pytorch 2.2.0
See also pytorch/pytorch#120020 We need to use gcc >=9 to build against pytorch 2.2.0
@malfet they probably are but unfortunately are not easily accessible for me atm. I'm not sure how @sssrijan-amazon feels but at least for me, just knowing that my environment need to be updated is enough of a solution |
Thanks a lot for the updates. I will try out with the correct gcc versions. |
So I was able to find GCC 10.5.0 and recompiled the example code and am still getting the "unknown layout". I'm not sure how much this matters but I realized that I was also on an old Python version (3.8.8 compiled against GCC 7.3) and tried updating to a newer Python version (3.9.18 compiled against GCC 10.5) and am still seeing the "unknown layout" error. The only other thing that sticks out to me is that I am using Cuda 12.2 but PyTorch 2.2 was compiled against Cuda 12.1, would that maybe cause an issue? |
It's already a requirement for building PyTorch, but should be a requirement for linking extensions with it, as that can lead to runtime crashes, as `std::optional` template layout is incompatible between gcc-9 and older compilers. Also, update minimum supported clang version to 9.x(used to build Android), as clang-5 is clearly not C++17 compliant. Fixes pytorch#120020 Pull Request resolved: pytorch#120126 Approved by: https://github.com/Skylion007
It's already a requirement for building PyTorch, but should be a requirement for linking extensions with it, as that can lead to runtime crashes, as `std::optional` template layout is incompatible between gcc-9 and older compilers. Also, update minimum supported clang version to 9.x(used to build Android), as clang-5 is clearly not C++17 compliant. Fixes pytorch#120020 Pull Request resolved: pytorch#120126 Approved by: https://github.com/Skylion007
It's already a requirement for building PyTorch, but should be a requirement for linking extensions with it, as that can lead to runtime crashes, as `std::optional` template layout is incompatible between gcc-9 and older compilers. Also, update minimum supported clang version to 9.x(used to build Android), as clang-5 is clearly not C++17 compliant. Fixes #120020 Pull Request resolved: #120126 Approved by: https://github.com/Skylion007 (cherry picked from commit 3ad067f)
It's already a requirement for building PyTorch, but should be a requirement for linking extensions with it, as that can lead to runtime crashes, as `std::optional` template layout is incompatible between gcc-9 and older compilers. Also, update minimum supported clang version to 9.x(used to build Android), as clang-5 is clearly not C++17 compliant. Fixes #120020 Pull Request resolved: #120126 Approved by: https://github.com/Skylion007 (cherry picked from commit 3ad067f) Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
Validated we no longer support gcc < 9 for release 2.2.2
|
馃悰 Describe the bug
I am using the C++ Distributions of PyTorch 2.2.0 and following the setup and example from here
I am getting the following exception when running the code -
Tried to use other constructors of tensor and still it fails
torch::tensor(1)
Similar setup works with
torch< 2.2
but not withtorch==2.2.0
Versions
Collecting environment information...
PyTorch version: 2.2.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: Amazon Linux 2 (x86_64)
GCC version: (GCC) 7.3.1 20180712 (Red Hat 7.3.1-17)
Clang version: Could not collect
CMake version: version 2.8.12.2
Libc version: glibc-2.26
Python version: 3.8.18 (default, Feb 15 2024, 20:18:37) [GCC 7.3.1 20180712 (Red Hat 7.3.1-17)] (64-bit runtime)
Python platform: Linux-5.10.209-175.812.amzn2int.x86_64-x86_64-with-glibc2.2.5
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 96
On-line CPU(s) list: 0-95
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
Stepping: 7
CPU MHz: 3100.049
BogoMIPS: 4999.99
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 36608K
NUMA node0 CPU(s): 0-23,48-71
NUMA node1 CPU(s): 24-47,72-95
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
Versions of relevant libraries:
[pip3] torch==2.2.0+cpu
[conda] Could not collect
cc @ezyang @gchanan @zou3519 @kadeng @seemethere @malfet @osalpekar @atalman @jbschlosser
The text was updated successfully, but these errors were encountered: