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
AttributeError when attempting to remove inductor buffers twice #102857
Comments
I don't think I'd know how to fix this without the repro. A non-minimal repro is fine but it looks like plantain is not a public repo. Did TORCHDYNAMO_REPRO_AFTER="aot" work per https://pytorch.org/docs/stable/dynamo/troubleshooting.html ? I'm at a 30% success rate but if it works it helps a lot. If it didn't paste the error here and I can also look |
Thanks for looking at this! The TORCHDYNAMO_REPRO_AFTER functionality is awesome -- it successfully wrote the following script that reproduces the error: https://gist.github.com/mixarcid/7f836054a277500ac104caef62a4210f. |
The fix is something like https://github.com/pytorch/pytorch/compare/main...ngimel:pytorch:remove_buf?expand=1, but I won't be able to create a testcase any time soon |
Good first issue to create the test case + the proposed fix. |
I'd like to work on this issue. |
@Potato-Cracker any luck with this? If not, I can take it. I'm releasing some code in the next couple weeks that depends on this being fixed. |
…ice" (pytorch#104901) Fixes pytorch#102857 I added the proposed fix and found a reasonably small test case. I don't have any insight into why this test case was causing the error, but it is fixed now. Pull Request resolved: pytorch#104901 Approved by: https://github.com/eellison
🐛 Describe the bug
I'm having difficultly creating a minimal reproducible example of this bug, but I'm hoping it's pretty clear what's going on. Basically, I'm compiling a complex function with
dynamic=True
. This function returns a valueU
. When I callU.backward()
, I'm getting an error where the inductor attempts to remove a buffer twice. Here's the relevant part of the stack trace:When I check out
_inductor/scheduler.py:1229
, it's pretty clear what the issue is. It's trying to access theother_names
property ofbuf
, butbuf
is just the string "REMOVED":If I simply skip any already removed buffers in this code, everything seems to be working fine:
I have no idea what this code is supposed to be doing, so not sure if this is a reasonable solution to the actual problem. I'll keep trying to come up with a reproducible example for this bug, but I wanted to put this up in case the solution really is this simple.
Versions
PyTorch version: 2.1.0.dev20230601
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: Arch Linux (x86_64)
GCC version: (GCC) 13.1.1 20230429
Clang version: 15.0.7
CMake version: version 3.26.4
Libc version: glibc-2.37
Python version: 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.3.3-arch1-1-x86_64-with-glibc2.37
Is CUDA available: True
CUDA runtime version: 11.0.221
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2060
Nvidia driver version: 530.41.03
cuDNN version: Probably one of the following:
/usr/lib/libcudnn.so.8.2.1
/usr/lib/libcudnn_adv_infer.so.8.2.1
/usr/lib/libcudnn_adv_train.so.8.2.1
/usr/lib/libcudnn_cnn_infer.so.8.2.1
/usr/lib/libcudnn_cnn_train.so.8.2.1
/usr/lib/libcudnn_ops_infer.so.8.2.1
/usr/lib/libcudnn_ops_train.so.8.2.1
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
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
CPU family: 6
Model: 158
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
Stepping: 10
CPU(s) scaling MHz: 44%
CPU max MHz: 4500.0000
CPU min MHz: 800.0000
BogoMIPS: 5202.65
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
Virtualization: VT-x
L1d cache: 192 KiB (6 instances)
L1i cache: 192 KiB (6 instances)
L2 cache: 1.5 MiB (6 instances)
L3 cache: 12 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-11
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; IBRS
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; IBRS, IBPB conditional, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Vulnerable: No microcode
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] pytorch-lightning==1.9.1
[pip3] torch==2.1.0.dev20230601
[pip3] torchaudio==2.1.0.dev20230601
[pip3] torchmetrics==0.11.4
[pip3] torchvision==0.16.0.dev20230601
[pip3] triton==2.1.0
[conda] blas 1.0 mkl
[conda] mkl 2023.1.0 h6d00ec8_46342
[conda] mkl-fft 1.3.6 pypi_0 pypi
[conda] mkl-random 1.2.2 pypi_0 pypi
[conda] mkl-service 2.4.0 pypi_0 pypi
[conda] mkl_fft 1.3.6 py310h1128e8f_1
[conda] mkl_random 1.2.2 py310h1128e8f_1
[conda] numpy 1.24.3 pypi_0 pypi
[conda] numpy-base 1.24.3 py310hb5e798b_1
[conda] pytorch 2.1.0.dev20230601 py3.10_cuda12.1_cudnn8.8.1_0 pytorch-nightly
[conda] pytorch-cuda 12.1 ha16c6d3_5 pytorch-nightly
[conda] pytorch-lightning 1.9.1 pypi_0 pypi
[conda] pytorch-mutex 1.0 cuda pytorch-nightly
[conda] torch 2.1.0.dev20230601 pypi_0 pypi
[conda] torchaudio 2.1.0.dev20230601 pypi_0 pypi
[conda] torchmetrics 0.11.4 pypi_0 pypi
[conda] torchtriton 2.1.0+9820899b38 py310 pytorch-nightly
[conda] torchvision 0.16.0.dev20230601 pypi_0 pypi
[conda] triton 2.1.0 pypi_0 pypi
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @bertmaher
The text was updated successfully, but these errors were encountered: