-
Notifications
You must be signed in to change notification settings - Fork 240
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
loss.backward() on an LSTM causes SegFault on Arc GPU #698
Comments
@LivesayMe Thanks for reporting the issue. Will look into it and give feedback later. |
@LivesayMe I am able to reproduce the SegFalut issue with your code snippet. I saved the core dumped file and used
The beginning of the
The end of the
The above stack trace indicates that the program crashed at calling |
@LivesayMe But I'm a little bit confused about your current LSTM training code snippet where:
If I modify the code with varying the random input data and use a separate synthetic target data during the training loop:
The training normally executes with the following output:
Enlarges the input tensor shape also works, such as to |
@wangkl2 The code I shared wasn't supposed to be a fully fledged implementation, rather just a minimum code to reproduce the issue I was having. |
@LivesayMe Okay, thanks for the clarification. Makes sense. As a workaround, you can set I've verified it works for:
|
Describe the bug
Training a model with an LSTM module causes a segmentation fault after loss.backward() has been called a random number of times. The number of times the training loop can run seems to be dependent on what the tensor x is, but I can't find what the relationship is. On my system the code below will run through the loop twice before having a segmentation fault. If x is instead torch.randn(10, 1) it runs for 3 loops. If ipex.optimize is not called it will not have a segfault as long as x is small. If it is large it will still cause a segfault.
Code to reproduce:
Output
tensor(0.8119, device='xpu:0', grad_fn=)
tensor(0.7972, device='xpu:0', grad_fn=)
Segmentation fault (core dumped)
Versions
PyTorch version: 2.1.0.post3+cxx11.abi
PyTorch CXX11 ABI: Yes
IPEX version: 2.1.40+xpu
IPEX commit: 80ed476
Build type: Release
OS: Linux Mint 22 (x86_64)
GCC version: (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Clang version: N/A
IGC version: 2024.2.1 (2024.2.1.20240711)
CMake version: N/A
Libc version: glibc-2.39
Python version: 3.11.9 (main, Apr 27 2024, 21:16:11) [GCC 13.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-41-generic-x86_64-with-glibc2.39
Is XPU available: True
DPCPP runtime version: 2024.2
MKL version: 2024.2
GPU models and configuration:
[0] _DeviceProperties(name='Intel(R) Arc(TM) A770 Graphics', platform_name='Intel(R) Level-Zero', dev_type='gpu', driver_version='1.3.29735', has_fp64=0, total_memory=15473MB, max_compute_units=512, gpu_eu_count=512)
Intel OpenCL ICD version: 24.22.29735.27-914
22.0422.04Level Zero version: 1.3.29735.27-914
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 5 5600 6-Core Processor
CPU family: 25
Model: 33
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
Stepping: 2
Frequency boost: enabled
CPU(s) scaling MHz: 70%
CPU max MHz: 4467.2852
CPU min MHz: 2200.0000
BogoMIPS: 6999.84
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm debug_swap
Virtualization: AMD-V
L1d cache: 192 KiB (6 instances)
L1i cache: 192 KiB (6 instances)
L2 cache: 3 MiB (6 instances)
L3 cache: 32 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-11
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Vulnerable: Safe RET, no microcode
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] intel_extension_for_pytorch==2.1.40+xpu
[pip3] numpy==1.26.4
[pip3] torch==2.1.0.post3+cxx11.abi
[pip3] torchaudio==2.1.0.post3+cxx11.abi
[pip3] torchvision==0.16.0.post3+cxx11.abi
[conda] N/A
The text was updated successfully, but these errors were encountered: