Serial Number
int64
1
6k
Issue Number
int64
75.6k
112k
Title
stringlengths
3
357
Labels
stringlengths
3
241
βŒ€
Body
stringlengths
9
74.5k
βŒ€
Comments
int64
0
867
2,501
102,206
copy_'s functionalized operator keeps copied into tensor live
triaged, module: functionalization, oncall: pt2
### πŸ› Describe the bug It's possible decomps fix this problem, but without decomps the graph is not as good as it could be: ``` import torch from torch._functorch.aot_autograd import aot_export_joint_simple def f(x, weight): def cb(grad_out): y = grad_out.sin() # stand-in for collective result weight.data.copy_(y) # Better would be: # weight.data = y return grad_out r = x @ weight r.register_hook(cb) return (r,) gm = aot_export_joint_simple( f, [torch.randn(2, 3, requires_grad=True), torch.randn(3, 4)], trace_joint=True, ) gm.print_readable() ``` gives ``` class joint_helper(torch.nn.Module): def forward(self, primals, tangents): primals_1: f32[2, 3], primals_2: f32[3, 4], tangents_1: f32[2, 4], = fx_pytree.tree_flatten_spec([primals, tangents], self._in_spec) # No stacktrace found for following nodes mm: f32[2, 4] = torch.ops.aten.mm.default(primals_1, primals_2); primals_1 = None sin: f32[2, 4] = torch.ops.aten.sin.default(tangents_1) copy: f32[3, 4] = torch.ops.aten.copy.default(primals_2, sin); primals_2 = sin = None t_1: f32[4, 3] = torch.ops.aten.t.default(copy); copy = None mm_1: f32[2, 3] = torch.ops.aten.mm.default(tangents_1, t_1); tangents_1 = t_1 = None return pytree.tree_unflatten([mm, mm_1, None], self._out_spec) ``` I don't want the dependence on primals_2. This example modeled based off of FSDP. cc @msaroufim @wconstab @ngimel @bdhirsh @anijain2305 ### Versions main
3
2,502
102,205
aot_export_joint_simple on plain callable (not graph module) doesn't attach stack traces
triaged, better-engineering, oncall: pt2, module: aotdispatch
### πŸ› Describe the bug Repro example: ``` import torch from torch._functorch.aot_autograd import aot_export_joint_simple def f(x, weight): def cb(grad_out): y = grad_out.sin() # stand-in for collective result weight.data.copy_(y) # Better would be: # weight.data = y return grad_out r = x @ weight r.register_hook(cb) return (r,) gm = aot_export_joint_simple( f, [torch.randn(2, 3, requires_grad=True), torch.randn(3, 4)], trace_joint=True, ) gm.print_readable() ``` gives ``` # No stacktrace found for following nodes ``` It would be nice to get the native stack traces in this case. ### Versions main cc @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
1
2,503
102,201
scipy.ndimage.find_objects
feature, module: nn, triaged, needs research
### πŸš€ The feature, motivation and pitch This function a basic building block of any biomedical image analysis application. It gives a list of tuple of slices of coordinates of labelled objects/cells within a mask image of dtype Uint16 or Uint8, assuming the image background is 0, and the labelled objects go from 1, 2, ..., max_label. I was wondering it is possible to implement it in torch C++ using a simple TensorIterator. Basically the simplest case would be it takes a 2D tensor of size (H, W) as input and outputs a tensor of slices of size (N, 2) where N is the number of objects, and each row is [slice(start,end,step), slice(start,end,step)]. ### Alternatives The implementation in C numpy can be found here: https://github.com/scipy/scipy/blob/v1.10.1/scipy/ndimage/src/ni_measure.c which uses Iterators defined here: https://github.com/scipy/scipy/blob/v1.10.1/scipy/ndimage/src/ni_support.h ### Additional context Can it also be extended to allow extract objects from a tensor of dimension (B, C, W, H) where B is the batch size, C the number of channels and W is the width and H is the height. cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
10
2,504
102,197
torch.func.jvp fails when acting on a DistributedDataParallel model
oncall: distributed, module: forward ad, module: functorch
Evaluating the jvp of a model's forward method with respect to an input variable fails when the model is parallel distributed with DistributedDataParallel. Specifically, the next jvp evaluation after calling backward() fails with the error message: ``` Traceback (most recent call last): File "test.py", line 39, in <module> out, grad_out = jvp(model, (style,), jvp_tangents) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/_functorch/eager_transforms.py", line 916, in jvp return _jvp_with_argnums(func, primals, tangents, argnums=None, strict=strict, has_aux=has_aux) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/_functorch/vmap.py", line 39, in fn return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/_functorch/eager_transforms.py", line 965, in _jvp_with_argnums result_duals = func(*duals) ^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1502, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1531, in forward inputs, kwargs = self._pre_forward(*inputs, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1419, in _pre_forward if torch.is_grad_enabled() and self.reducer._rebuild_buckets(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Cannot access data pointer of Tensor that doesn't have storage ``` Here is a minimal example: ```python import os import torch import torch.distributed as dist from torch.nn.parallel import DistributedDataParallel from torch.func import jvp class TestNet(torch.nn.Module): def __init__(self): super().__init__() self.weight = torch.nn.Parameter(torch.randn((1,))) def forward(self, x) : return self.weight * x if __name__ == '__main__': os.environ['MASTER_ADDR'] = '127.0.0.1' os.environ['MASTER_PORT'] = '29500' dist.init_process_group(backend='nccl', world_size=1, rank=0) device = torch.device('cuda', 0) model = TestNet().to(device) # The code runs without error if this is commented out model = DistributedDataParallel(model, device_ids=[device], process_group=dist.new_group()) criterion = torch.nn.MSELoss().to(device) for epoch in range(2) : print('epoch {} started'.format(epoch)) target = torch.randn(1).to(device) input = torch.randn([1]).to(device) jvp_tangents = (torch.ones_like(input).to(device),) out, grad_out = jvp(model, (input,), jvp_tangents) loss = criterion(out, target) torch.log(loss).backward() print('epoch {} finished'.format(epoch)) print('Success!') ``` If I use DistributedDataParallel with find_unused_parameters=True I get a different error, which occurs the first time jvp is invoked, instead of after the first time torch.log(loss).backward() is called. ``` Traceback (most recent call last): File "test.py", line 39, in <module> out, grad_out = jvp(model, (style,), jvp_tangents) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/_functorch/eager_transforms.py", line 916, in jvp return _jvp_with_argnums(func, primals, tangents, argnums=None, strict=strict, has_aux=has_aux) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/_functorch/vmap.py", line 39, in fn return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/_functorch/eager_transforms.py", line 965, in _jvp_with_argnums result_duals = func(*duals) ^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1502, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1537, in forward return self._post_forward(output) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1511, in _post_forward passthrough_tensor_list = _DDPSink.apply( ^^^^^^^^^^^^^^^ File "/Mamba/envs/ptjvp/lib/python3.11/site-packages/torch/autograd/function.py", line 509, in apply raise RuntimeError( RuntimeError: In order to use an autograd.Function with functorch transforms (vmap, grad, jvp, jacrev, ...), it must override the setup_context staticmethod. For more details, please see https://pytorch.org/docs/master/notes/extending.func.html ``` ### Versions Collecting environment information... PyTorch version: 2.1.0.dev20230522+cu118 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Rocky Linux release 8.8 (Green Obsidian) (x86_64) GCC version: (GCC) 8.5.0 20210514 (Red Hat 8.5.0-16) Clang version: Could not collect CMake version: version 3.25.0 Libc version: glibc-2.28 Python version: 3.11.3 | packaged by conda-forge | (main, Apr 6 2023, 08:57:19) [GCC 11.3.0] (64-bit runtime) Python platform: Linux-5.15.90.1.fi-x86_64-with-glibc2.28 Is CUDA available: True CUDA runtime version: 11.8.89 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA A100-SXM4-80GB GPU 1: NVIDIA A100-SXM4-80GB GPU 2: NVIDIA A100-SXM4-80GB GPU 3: NVIDIA A100-SXM4-80GB Nvidia driver version: 530.30.02 cuDNN version: Could not collect 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): 64 On-line CPU(s) list: 0-63 Thread(s) per core: 1 Core(s) per socket: 32 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 106 Model name: Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz Stepping: 6 CPU MHz: 2600.000 CPU max MHz: 3400.0000 CPU min MHz: 800.0000 BogoMIPS: 5200.00 Virtualization: VT-x L1d cache: 48K L1i cache: 32K L2 cache: 1280K L3 cache: 49152K NUMA node0 CPU(s): 0-31 NUMA node1 CPU(s): 32-63 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 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid fsrm md_clear pconfig flush_l1d arch_capabilities Versions of relevant libraries: [pip3] numpy==1.23.5 [pip3] pytorch-triton==2.1.0+7d1a95b046 [pip3] torch==2.1.0.dev20230522+cu118 [pip3] torchaudio==2.1.0.dev20230522+cu118 [pip3] torchvision==0.16.0.dev20230522+cu118 [pip3] triton==2.0.0 [conda] numpy 1.23.5 pypi_0 pypi [conda] pytorch-triton 2.1.0+7d1a95b046 pypi_0 pypi [conda] torch 2.1.0.dev20230522+cu118 pypi_0 pypi [conda] torchaudio 2.1.0.dev20230522+cu118 pypi_0 pypi [conda] torchvision 0.16.0.dev20230522+cu118 pypi_0 pypi [conda] triton 2.0.0 pypi_0 pypi cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @zou3519 @Chillee @samdow @kshitij12345 @janeyx99
4
2,505
102,187
Extend fake fast path to more situations
triaged, module: fakeTensor
### πŸ› Describe the bug https://github.com/pytorch/pytorch/blob/d316a2dd5c8c89c1e0a18a0cce595a81dd9e52ab/torch/_subclasses/fake_tensor.py#L679-L824 Only applied to four ops right now. Apply it to more. ### Versions main
0
2,506
102,186
torch/distributed/_spmd/api.py should aot_module_export instead of make_fx directly
oncall: distributed
### πŸ› Describe the bug Self explanatory cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @bdhirsh @wanchaol @gmagogsfm ### Versions main
0
2,507
102,167
Calling pin_memory() fails for nested tensor
triaged, module: nestedtensor, topic: new features
### πŸ› Describe the bug calling pin_memory() on a nested tensor fails: ``` a, b = torch.arange(3), torch.arange(5) + 3 nt = torch.nested.nested_tensor([a, b]) nt.pin_memory() RuntimeError: Internal error: NestedTensorImpl doesn't support strides. Please file an issue on https://github.com/pytorch/nestedtensor ``` ### Versions Collecting environment information... PyTorch version: 2.0.1+cu118 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Ubuntu 20.04.5 LTS (x86_64) GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Clang version: 10.0.0-4ubuntu1 CMake version: version 3.25.2 Libc version: glibc-2.31 Python version: 3.10.11 (main, Apr 5 2023, 14:15:10) [GCC 9.4.0] (64-bit runtime) Python platform: Linux-5.15.107+-x86_64-with-glibc2.31 Is CUDA available: False CUDA runtime version: 11.8.89 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: Could not collect Nvidia driver version: Could not collect cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.7.0 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 Address sizes: 46 bits physical, 48 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 79 Model name: Intel(R) Xeon(R) CPU @ 2.20GHz Stepping: 0 CPU MHz: 2200.168 BogoMIPS: 4400.33 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32 KiB L1i cache: 32 KiB L2 cache: 256 KiB L3 cache: 55 MiB NUMA node0 CPU(s): 0,1 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Mitigation; PTE Inversion Vulnerability Mds: Vulnerable; SMT Host state unknown Vulnerability Meltdown: Vulnerable Vulnerability Mmio stale data: Vulnerable Vulnerability Retbleed: Vulnerable Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers Vulnerability Spectre v2: Vulnerable, IBPB: disabled, STIBP: disabled, PBRSB-eIBRS: Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Vulnerable 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 rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat md_clear arch_capabilities Versions of relevant libraries: [pip3] numpy==1.22.4 [pip3] torch==2.0.1+cu118 [pip3] torchaudio==2.0.2+cu118 [pip3] torchdata==0.6.1 [pip3] torchsummary==1.5.1 [pip3] torchtext==0.15.2 [pip3] torchvision==0.15.2+cu118 [pip3] triton==2.0.0 [conda] Could not collect cc @cpuhrsch @jbschlosser @bhosmer @drisspg
1
2,508
102,162
NotImplementedError in backprop on on dense-sparse matrices
module: sparse, triaged
### πŸ› Describe the bug As Pytorch does not (yet?) support broadcasting on sparse matrices, I implemented a simple autograd class. Forward propagation works fine, but backprop fails with a cryptic: ``` Could not run 'aten::as_strided' with arguments from the 'SparseCPU' backend. ``` Here is a snippet of minimal code to reproduce the issue (including full error message): https://gist.github.com/mino98/38ef8278470ffdd254c50b428cf1bb38 Thanks ### Versions Collecting environment information... PyTorch version: 2.0.1+cu118 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Ubuntu 20.04.5 LTS (x86_64) GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Clang version: 10.0.0-4ubuntu1 CMake version: version 3.25.2 Libc version: glibc-2.31 Python version: 3.10.11 (main, Apr 5 2023, 14:15:10) [GCC 9.4.0] (64-bit runtime) Python platform: Linux-5.15.107+-x86_64-with-glibc2.31 Is CUDA available: False CUDA runtime version: 11.8.89 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: Could not collect Nvidia driver version: Could not collect cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.7.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.7.0 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 Address sizes: 46 bits physical, 48 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 79 Model name: Intel(R) Xeon(R) CPU @ 2.20GHz Stepping: 0 CPU MHz: 2200.216 BogoMIPS: 4400.43 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32 KiB L1i cache: 32 KiB L2 cache: 256 KiB L3 cache: 55 MiB NUMA node0 CPU(s): 0,1 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Mitigation; PTE Inversion Vulnerability Mds: Vulnerable; SMT Host state unknown Vulnerability Meltdown: Vulnerable Vulnerability Mmio stale data: Vulnerable Vulnerability Retbleed: Vulnerable Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers Vulnerability Spectre v2: Vulnerable, IBPB: disabled, STIBP: disabled, PBRSB-eIBRS: Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Vulnerable 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 rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat md_clear arch_capabilities Versions of relevant libraries: [pip3] numpy==1.22.4 [pip3] torch==2.0.1+cu118 [pip3] torchaudio==2.0.2+cu118 [pip3] torchdata==0.6.1 [pip3] torchsummary==1.5.1 [pip3] torchtext==0.15.2 [pip3] torchvision==0.15.2+cu118 [pip3] triton==2.0.0 [conda] Could not collect cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer
4
2,509
102,157
DISABLED test_build_tuple_unpack_dynamic_shapes (torch._dynamo.testing.DynamicShapesMiscTests)
triaged, module: flaky-tests, skipped, module: dynamo
Platforms: linux, mac This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_build_tuple_unpack_dynamic_shapes&suite=DynamicShapesMiscTests) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 2 workflow(s) with 2 failures and 2 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_build_tuple_unpack_dynamic_shapes` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `dynamo/test_dynamic_shapes.py` or `dynamo/test_dynamic_shapes.py` cc @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx
3
2,510
102,148
Add mps support for maxpool3d
triaged, open source, Stale, release notes: mps, ciflow/mps
Fixes #100674 Added mps support for forward / backward passes of maxpool3d. As mentioned in the referenced issue, I'm utilizing the maxpool 4d op that is available from the metal library to achieve this. cc: @mattiaspaul
6
2,511
102,142
Pytorch CXX11 ABI version
module: build, module: abi, triaged
### πŸ› Describe the bug Hello, I met some problems recently. I have three third party shared libraries which is compiled with C++17. And I want to extend operators in these libraries to Pytorch. Therefore, I write a cpp file to test whether I linked thes libraries successfully. The following is my example.cpp: ` #include <torch/torch.h> #include <iostream> #include "conv.h" using Tensor = torch::Tensor; using IntArrayRef = torch::IntArrayRef; int main() { std::cout << torch::cuda::is_available() << std::endl; std::cout << torch::cuda::cudnn_is_available() << std::endl; std::cout << torch::cuda::device_count() << std::endl; auto optionals = at::TensorOptions(at::kCUDA).dtype(at::kFloat); Tensor input = torch::randint(1, 9,{2, 2, 5, 5}, optionals).to(c10::MemoryFormat::ChannelsLast); Tensor bias = torch::zeros({1}, optionals); Tensor weight = torch::randint(1, 9, {1, 2, 2, 2}, optionals).to(c10::MemoryFormat::ChannelsLast); c10::optional<Tensor> bias_opt{bias}; IntArrayRef stride{1, 1}; // for senseconv must be dimension 2 IntArrayRef padding{1, 1}; // for senseconv must be dimension 2 IntArrayRef dilation{1, 1}; // for senseconv must be dimension 2 and {1, 1} int64_t groups = 1; Tensor ret = conv2d(input, weight, bias_opt, stride, padding, dilation, groups); std::cout << "Result1: " << std::endl; std::cout << ret << std::endl; } ` The conv2d is from "conv.h" which is from one of my third party libraries. And the following is my cmakelists: ` cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(example) set(CUDA_TOOLKIT_ROOT_DIR cuda11.7) find_package(CUDA REQUIRED) set(root_path /anaconda3/envs/torch2.0.1/lib/python3.10/site-packages/torch) set(Torch_DIR ${root_path}/share/cmake/Torch) find_package(Torch REQUIRED) set(CUDNN_INCLUDE_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/include) include_directories(${CUDA_INCLUDE_DIRS} ${CUDNN_INCLUDE_DIRS}) include_directories(${CMAKE_SOURCE_DIR}/include ${root_path}/include/torch/csrc/api/include/torch) link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib64 ${CMAKE_SOURCE_DIR}/libs) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} -DUSE_CUDNN") add_executable(example example.cpp) add_library(sensetorch SHARED IMPORTED) set_property(TARGET sensetorch PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libs/libtorch.so") add_library(sensednn SHARED IMPORTED) set_property(TARGET sensednn PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libs/libdnn.so") add_library(conv SHARED IMPORTED) set_property(TARGET conv PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libs/libconv.so") target_link_libraries(example "${TORCH_LIBRARIES}") target_link_libraries(example "${CUDA_LIBRARIES}") target_link_libraries(example "${PythonInterp_LIBRARIES}") target_link_libraries(example conv sensednn sensetorch) ` everything goes fine when compiling. However, when I run the example, it occurs errors. The error is : ` free(): invalid pointer Aborted ` Therefore, I consider that there is an incompatability between pytorch and my third party libraries. However, when I modify the torch path(using libtorch C++ with CXX11 ABI version) in cmakelists, everythins is fine. The libtorch version is the following. <img width="671" alt="ζ•θŽ·" src="https://github.com/pytorch/pytorch/assets/45058324/defa24a5-ece8-40b5-b6ea-51baf6120cd2"> I found that my pytorch's CXX11ABI version is pre-CXX11 ABI version. So, how can I solve this as I want to use the libtorch in pytorch not the C++ libtorch. Because I want to extend them into pytorch in the future. ### Versions Collecting environment information... PyTorch version: 1.12.1 Is debug build: False CUDA used to build PyTorch: Could not collect ROCM used to build PyTorch: N/A OS: Ubuntu 18.04.5 LTS (x86_64) GCC version: (GCC) 10.2.0 Clang version: Could not collect CMake version: version 3.26.3 Libc version: glibc-2.27 Python version: 3.10.9 (main, Mar 1 2023, 18:23:06) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.27 Is CUDA available: False CUDA runtime version: 11.7.99 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: GPU 0: NVIDIA A100-SXM4-80GB Nvidia driver version: 470.103.01 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.0.5 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): 128 On-line CPU(s) list: 0-127 Thread(s) per core: 2 Core(s) per socket: 32 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 106 Model name: Intel(R) Xeon(R) Platinum 8369B CPU @ 2.90GHz Stepping: 6 CPU MHz: 3499.859 CPU max MHz: 3500.0000 CPU min MHz: 800.0000 BogoMIPS: 5800.00 Virtualization: VT-x L1d cache: 48K L1i cache: 32K L2 cache: 1280K L3 cache: 49152K NUMA node0 CPU(s): 0-31,64-95 NUMA node1 CPU(s): 32-63,96-127 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 aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 invpcid_single intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq md_clear pconfig spec_ctrl intel_stibp flush_l1d arch_capabilities Versions of relevant libraries: [pip3] flake8==6.0.0 [pip3] mypy-extensions==0.4.3 [pip3] numpy==1.23.5 [pip3] numpydoc==1.5.0 [pip3] torch==1.12.1 [conda] blas 1.0 mkl [conda] mkl 2021.4.0 h06a4308_640 [conda] mkl-service 2.4.0 py310h7f8727e_0 [conda] mkl_fft 1.3.1 py310hd6ae3a3_0 [conda] mkl_random 1.2.2 py310h00e6091_0 [conda] numpy 1.23.5 py310hd5efca6_0 [conda] numpy-base 1.23.5 py310h8e6c178_0 [conda] numpydoc 1.5.0 py310h06a4308_0 [conda] pytorch 1.12.1 cpu_py310hb1f1ab4_1 cc @malfet @seemethere
1
2,512
102,115
DISABLED test_inplace_grad_index_put_cuda_complex128 (__main__.TestBwdGradientsCUDA)
module: autograd, triaged, module: flaky-tests, skipped, oncall: pt2, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_inplace_grad_index_put_cuda_complex128&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 3 workflow(s) with 3 failures and 3 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_inplace_grad_index_put_cuda_complex128` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @aakhundov
4
2,513
102,113
DISABLED test_inplace_grad_div_trunc_rounding_cuda_float64 (__main__.TestBwdGradientsCUDA)
module: autograd, triaged, module: flaky-tests, skipped, oncall: pt2, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_inplace_grad_div_trunc_rounding_cuda_float64&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 3 workflow(s) with 3 failures and 3 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_inplace_grad_div_trunc_rounding_cuda_float64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @aakhundov
3
2,514
102,112
DISABLED test_fn_grad_div_trunc_rounding_cuda_float64 (__main__.TestBwdGradientsCUDA)
module: autograd, triaged, module: flaky-tests, skipped, oncall: pt2, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_fn_grad_div_trunc_rounding_cuda_float64&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 3 workflow(s) with 6 failures and 3 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_fn_grad_div_trunc_rounding_cuda_float64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @aakhundov
2
2,515
102,105
Enable DEBUG asserts for C++ builds
triaged, module: devx
A continuation of https://github.com/pytorch/pytorch/issues/88842 to follow up on https://github.com/pytorch/pytorch/pull/92707 **Goal:** Ensure our debug builds actually trigger on C++ debug level asserts. **Specific Asks** 1. Add a new environment variable (like DEBUG_ASSERT ) to debug builds, and make the debug asserts get run whenever that variable is set 2. Uncomment the code in test.sh added by https://github.com/pytorch/pytorch/pull/92707/files to verify that the debug mode is being respected. cc @kit1980 @huydhn @clee2000
0
2,516
102,085
BatchNorm can't be symbolically traced with torch.fx as a standalone module
triaged, module: functorch
### πŸ› Describe the bug I have been working with torch.fx recently for code generation purposes. I have noticed that BatchNorm cannot be symbolically traced when used outside of a custom nn.Module: ```python import torch import torch.nn as nn bn = nn.BatchNorm2d(64) _ = torch.fx.symbolic_trace(bn) ``` will raise : ```md TraceError: symbolically traced variables cannot be used as inputs to control flow ``` Whereas: ```python class BN(nn.Module): def __init__(self): super().__init__() self.mod = nn.BatchNorm2d(64) def forward(self, x): return self.mod(x) bn = BN() _ = torch.fx.symbolic_trace(bn) ``` will successfully run. This seems to happen for both batchnorm 1d, 2d and 3d. ### Versions <details> <summary>Version</summary> Collecting environment information... PyTorch version: 2.0.0+cu117 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: Debian GNU/Linux 11 (bullseye) (x86_64) GCC version: (Debian 10.2.1-6) 10.2.1 20210110 Clang version: Could not collect CMake version: version 3.26.3 Libc version: glibc-2.31 Python version: 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.10.0-19-amd64-x86_64-with-glibc2.31 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA RTX A5000 GPU 1: NVIDIA RTX A5000 GPU 2: NVIDIA RTX A5000 Nvidia driver version: 510.47.03 cuDNN version: Could not collect 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 Address sizes: 46 bits physical, 48 bits virtual 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) Gold 5220R CPU @ 2.20GHz Stepping: 7 CPU MHz: 1000.307 CPU max MHz: 4000.0000 CPU min MHz: 1000.0000 BogoMIPS: 4400.00 Virtualization: VT-x L1d cache: 1.5 MiB L1i cache: 1.5 MiB L2 cache: 48 MiB L3 cache: 71.5 MiB NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95 Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable Vulnerability Retbleed: Mitigation; Enhanced IBRS Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; TSX disabled 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 smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear flush_l1d arch_capabilities Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.0 [pip3] torchaudio==2.0.1 [pip3] torchinfo==1.7.2 [pip3] torchvision==0.15.1 [pip3] triton==2.0.0 [conda] numpy 1.24.3 pypi_0 pypi [conda] torch 2.0.0 pypi_0 pypi [conda] torchaudio 2.0.1 pypi_0 pypi [conda] torchinfo 1.7.2 pypi_0 pypi [conda] torchvision 0.15.1 pypi_0 pypi [conda] triton 2.0.0 pypi_0 pypi </details> cc @zou3519 @Chillee @samdow @kshitij12345 @janeyx99
2
2,517
102,084
Documentation Error of torch.onnx
module: onnx, module: docs, triaged
### πŸ“š The doc issue https://pytorch.org/docs/stable/onnx.html#limitations says that - Any output that is a dict will be silently replaced with a flattened sequence of its values (keys will be removed). E.g. {"foo": 1, "bar": 2} becomes (1, 2). - Any output that is a str will be silently removed. But I find that str actually triggers error: ``` import torch from torch import nn class MyModule(nn.Module): def __init__(self): super(MyModule, self).__init__() def forward(self, x, y_dict): y = y_dict['value'] output = x + y return 'haha', {'output': output} # Create the module module = MyModule() # Example usage x = torch.tensor(2.0) y = {'value': torch.tensor(3.0)} string, output_dict = module(x, y) print(string) # Prints: haha print(output_dict) # Prints: {'output': tensor(5.)} torch.jit.trace(module, (x,y)) # RuntimeError: Only tensors, lists, tuples of tensors, or dictionary of tensors can be output from traced functions ``` I'm using PyTorch 1.12.0. ### Suggest a potential alternative/fix Remove those two sentences. cc @svekars @carljparker
3
2,518
102,081
CPU Fallback does not convert Tensor?[]
module: internals, triaged
### πŸ› Describe the bug When using `at::native::cpu_fallback`, lists of optional tensors `Tensor?[]` are not converted to CPU during fallback. This can be observed with operations like `aten::index.Tensor`, which takes `Tensor?[] indices`. This results in the following error: ``` RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) ``` ### Versions ``` Collecting environment information... PyTorch version: 2.0.0+cpu Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.2 LTS (x86_64) GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Clang version: 14.0.6 (https://github.com/conda-forge/clangdev-feedstock 28f7809e7f4286b203af212a154f5a8327bd6fd6) CMake version: version 3.23.3 Libc version: glibc-2.35 Python version: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0] (64-bit runtime) Python platform: Linux-5.15.0-71-generic-x86_64-with-glibc2.35 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 Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 60 On-line CPU(s) list: 0-59 Vendor ID: AuthenticAMD Model name: AMD EPYC 7763 64-Core Processor CPU family: 25 Model: 1 Thread(s) per core: 2 Core(s) per socket: 30 Socket(s): 1 Stepping: 1 BogoMIPS: 4890.80 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 rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt nrip_save umip pku ospke vaes vpclmulqdq rdpid arch_capabilities Virtualization: AMD-V Hypervisor vendor: KVM Virtualization type: full L1d cache: 1.9 MiB (30 instances) L1i cache: 1.9 MiB (30 instances) L2 cache: 15 MiB (30 instances) L3 cache: 16 MiB (1 instance) NUMA node(s): 2 NUMA node0 CPU(s): 0-29 NUMA node1 CPU(s): 30-59 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] numpy==1.24.1 [pip3] torch==2.0.0+cpu [pip3] torchvision==0.15.0+cpu [conda] numpy 1.24.1 pypi_0 pypi [conda] torch 2.0.0+cpu pypi_0 pypi [conda] torchvision 0.15.0+cpu pypi_0 pypi ``` cc @ezyang @bhosmer @smessmer @ljk53 @bdhirsh
1
2,519
102,079
add Half support for AdaptiveAvgPool2d and AdaptiveMaxPool2d on CPU
module: cpu, open source, module: half, ciflow/trunk, ciflow/mps
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * __->__ #102079 ### Testing Single core: AdaptiveMaxPool2d: shape | fp32 forward / ms | fp16 forward / ms | bf16 forward / ms | fp32 backward / ms | fp16 backward / ms | bf16 backward / ms -- | -- | -- | -- | -- | -- | -- input size: (2, 56, 264, 264), output size: (100, 100) | 71.5826 | 78.7460 | 85.7195 | 7.3925 | 6.0618 | 6.2596 input size: (2, 56, 264, 264), output size: (50, 50) | 28.122 | 30.8572 | 36.6366 | 6.2645 | 3.4781 | 3.6628 input size: (32, 32, 100, 100), output size: (50, 50) | 109.2978 | 115.0330 | 121.9500 | 13.4329 | 10.2769 | 12.1975 input size: (16, 4, 300, 300), output size: (100, 100) | 34.1849 | 36.5876 | 40.9862 | 4.7719 | 4.3362 | 4.1417 28 cores: AdaptiveMaxPool2d: shape | fp32 forward / ms | fp16 forward / ms | bf16 forward / ms | fp32 backward / ms | fp16 backward / ms | bf16 backward / ms -- | -- | -- | -- | -- | -- | -- input size: (2, 56, 264, 264), output size: (100, 100) | 3.1809 | 3.5057 | 3.6728 | 0.6657 | 0.3138 | 0.2934 input size: (2, 56, 264, 264), output size: (50, 50) | 1.2779 | 1.3869 | 1.5238 | 0.4223 | 0.1775 | 0.1825 input size: (32, 32, 100, 100), output size: (50, 50) | 4.7942 | 4.9670 | 5.2330 | 1.7146 | 0.6477 | 0.7001 input size: (16, 4, 300, 300), output size: (100, 100) | 1.9522 | 2.0879 | 2.3155 | 0.4370 | 0.3175 | 0.2828 cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10
6
2,520
102,078
AddressSanitizer: heap-buffer-overflow in test_comprehensive_nn_functional_embedding_bag_cpu_bfloat16
needs reproduction, module: cpu, triaged, module: embedding, module: decompositions
### πŸ› Describe the bug When running test `test/test_decomp.py::TestDecompCPU::test_comprehensive_nn_functional_embedding_bag_cpu_bfloat16` I'm getting following ASAN error: <details> <summary>ASAN report</summary> ``` ================================================================= ==43274==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60900000586c at pc 0x7f56da7aacd9 bp 0x7ffd155f5940 sp 0x7ffd155f5930 READ of size 2 at 0x60900000586c thread T0 #0 0x7f56da7aacd8 in operator() /home/user/pytorch/aten/src/ATen/native/cpu/BlasKernel.cpp:298 #1 0x7f56da7acaac in operator() /home/user/pytorch/aten/src/ATen/native/cpu/BlasKernel.cpp:298 #2 0x7f56da7ad1f7 in cpublas_axpy_impl /home/user/pytorch/aten/src/ATen/native/cpu/BlasKernel.cpp:298 #3 0x7f56c640d161 in void at::native::DispatchStub<void (*)(c10::ScalarType, long, c10::Scalar const&, void const*, long, void*, long), at::native::cpublas::axpy_stub>::operator()<c10::ScalarType const&, long&, c10::BFloat16&, c10::BFloat16 const*&, long&, c10::BFloat16*&, long&>(c10::DeviceType, c10::ScalarType const&, long&, c10::BFloat16&, c10::BFloat16 const*&, long&, c10::BFloat16*&, long&) /home/user/pytorch/aten/src/ATen/native/DispatchStub.h:160 #4 0x7f56c64094ff in void at::native::cpublas::axpy<c10::BFloat16>(long, c10::BFloat16, c10::BFloat16 const*, long, c10::BFloat16*, long) /home/user/pytorch/aten/src/ATen/native/CPUBlas.h:133 #5 0x7f56c63f6382 in at::native::_embedding_bag_dense_backward_cpu_sum_mean<c10::BFloat16>(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, long, bool, long, at::Tensor const&, at::Tensor&, long)::{lambda()#1}::operator()() const::{lambda()#2}::operator()() const::{lambda(long, long)#1}::operator()(long, long) const /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1547 #6 0x7f56c63f59a5 in at::native::_embedding_bag_dense_backward_cpu_sum_mean<c10::BFloat16>(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, long, bool, long, at::Tensor const&, at::Tensor&, long)::{lambda()#1}::operator()() const::{lambda()#2}::operator()() const /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1547 #7 0x7f56c63f3921 in at::native::_embedding_bag_dense_backward_cpu_sum_mean<c10::BFloat16>(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, long, bool, long, at::Tensor const&, at::Tensor&, long)::{lambda()#1}::operator()() const /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1547 #8 0x7f56c63f6c1c in void at::native::_embedding_bag_dense_backward_cpu_sum_mean<c10::BFloat16>(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, long, bool, long, at::Tensor const&, at::Tensor&, long) /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1547 #9 0x7f56c63a0eac in operator() /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1631 #10 0x7f56c63a208d in operator() /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1631 #11 0x7f56c63a2dbb in at::native::_embedding_bag_dense_backward_cpu(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, long, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1631 #12 0x7f56ca10d278 in wrapper_CPU___embedding_bag_dense_backward /home/user/pytorch/build/aten/src/ATen/RegisterCPU.cpp:5122 #13 0x7f56ca5a9072 in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #14 0x7f56ca5a9072 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:463 #15 0x7f56ca740085 in call_functor_with_args_from_stack_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int), at::(anonymous namespace)::(anonymous namespace)::wrapper_CPU___embedding_bag_dense_backward>, at::Tensor, c10::guts::typelist::typelist<const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int> >, false, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int> /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:501 #16 0x7f56ca6d4cc4 in call_functor_with_args_from_stack<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int), at::(anonymous namespace)::(anonymous namespace)::wrapper_CPU___embedding_bag_dense_backward>, at::Tensor, c10::guts::typelist::typelist<const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int> >, false> /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:513 #17 0x7f56ca5a92be in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:584 #18 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #19 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #20 0x7f5700f7c6f1 in c10::Dispatcher::callBoxedForDispatchKey(c10::OperatorHandle const&, c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f6f1) #21 0x7f5700f7c001 in c10::OperatorHandle::callBoxedForDispatchKey(c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f001) #22 0x7f5700f68a9c in python_dispatcher /home/user/pytorch/torch/csrc/PyInterpreter.cpp:358 #23 0x7f56c5bffbc9 in pythonDispatcherFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:98 #24 0x7f56c5c02991 in make_boxed_function<(anonymous namespace)::pythonDispatcherFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:149 #25 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #26 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #27 0x7f57022d3487 in c10::Dispatcher::callBoxed(c10::OperatorHandle const&, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:696 #28 0x7f56c53e21b4 in c10::OperatorHandle::callBoxed(std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:422 #29 0x7f56d780ad18 in c10::OperatorHandle::callBoxed(std::vector<c10::IValue, std::allocator<c10::IValue> >&) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:426 #30 0x7f56d7807a16 in operator() /home/user/pytorch/torch/csrc/jit/runtime/register_c10_ops.cpp:15 #31 0x7f56d780a944 in __invoke_impl<void, torch::jit::(anonymous namespace)::createOperatorFromC10(const c10::OperatorHandle&)::<lambda(torch::jit::Stack&)>&, std::vector<c10::IValue, std::allocator<c10::IValue> >&> /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/invoke.h:61 #32 0x7f56d780a723 in __invoke_r<void, torch::jit::(anonymous namespace)::createOperatorFromC10(const c10::OperatorHandle&)::<lambda(torch::jit::Stack&)>&, std::vector<c10::IValue, std::allocator<c10::IValue> >&> /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/invoke.h:111 #33 0x7f56d780a3e0 in _M_invoke /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/std_function.h:290 #34 0x7f57017ff99c in std::function<void (std::vector<c10::IValue, std::allocator<c10::IValue> >&)>::operator()(std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x321299c) #35 0x7f57017f1538 in torch::jit::Operation::operator()(std::vector<c10::IValue, std::allocator<c10::IValue> >&) /home/user/pytorch/aten/src/ATen/core/stack.h:41 #36 0x7f57017e27b9 in torch::jit::invokeOperatorFromPython(std::vector<std::shared_ptr<torch::jit::Operator>, std::allocator<std::shared_ptr<torch::jit::Operator> > > const&, pybind11::args, pybind11::kwargs const&, c10::optional<c10::DispatchKey>) /home/user/pytorch/torch/csrc/jit/python/pybind_utils.cpp:764 #37 0x7f57017e3d2b in torch::jit::_get_operation_for_overload_or_packet(std::vector<std::shared_ptr<torch::jit::Operator>, std::allocator<std::shared_ptr<torch::jit::Operator> > > const&, c10::Symbol, pybind11::args, pybind11::kwargs const&, bool, c10::optional<c10::DispatchKey>) /home/user/pytorch/torch/csrc/jit/python/pybind_utils.cpp:829 #38 0x7f570134edb5 in operator() /home/user/pytorch/torch/csrc/jit/python/init.cpp:1551 #39 0x7f570142f32f in call_impl<pybind11::object, torch::jit::initJITBindings(PyObject*)::<lambda(const string&, const string&)>::<lambda(pybind11::args, pybind11::kwargs)>&, 0, 1, pybind11::detail::void_type> /home/user/pytorch/torch/include/pybind11/cast.h:1439 #40 0x7f5701406a6a in call<pybind11::object, pybind11::detail::void_type, torch::jit::initJITBindings(PyObject*)::<lambda(const string&, const string&)>::<lambda(pybind11::args, pybind11::kwargs)>&> /home/user/pytorch/torch/include/pybind11/cast.h:1408 #41 0x7f57013abeac in operator() /home/user/pytorch/torch/include/pybind11/pybind11.h:249 #42 0x7f57013ac04f in _FUN /home/user/pytorch/torch/include/pybind11/pybind11.h:224 #43 0x7f5700381365 in pybind11::cpp_function::dispatcher(_object*, _object*, _object*) /home/user/pytorch/torch/include/pybind11/pybind11.h:929 #44 0x7f57356cdb72 in cfunction_call Objects/methodobject.c:543 #45 0x7f5735678d7a in _PyObject_Call Objects/call.c:305 #46 0x7f5735678dda in PyObject_Call Objects/call.c:317 #47 0x7f5735790f52 in do_call_core Python/ceval.c:5915 #48 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #49 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #50 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #51 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #52 0x7f5735678844 in _PyObject_FastCallDictTstate Objects/call.c:142 #53 0x7f5735679110 in _PyObject_Call_Prepend Objects/call.c:431 #54 0x7f57356f8cad in slot_tp_call Objects/typeobject.c:7494 #55 0x7f5735678d7a in _PyObject_Call Objects/call.c:305 #56 0x7f5735678dda in PyObject_Call Objects/call.c:317 #57 0x7f5735791193 in do_call_core Python/ceval.c:5943 #58 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #59 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #60 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #61 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #62 0x7f573567b939 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #63 0x7f573567bd3b in method_vectorcall Objects/classobject.c:83 #64 0x7f5735678404 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #65 0x7f57356792a2 in _PyObject_CallFunctionVa Objects/call.c:485 #66 0x7f573567966e in callmethod Objects/call.c:557 #67 0x7f5735679797 in PyObject_CallMethod Objects/call.c:577 #68 0x7f570225e0e7 in torch::handle_torch_function_no_python_arg_parser(c10::ArrayRef<pybind11::handle>, _object*, _object*, char const*, _object*, char const*, torch::TorchFunctionName) /home/user/pytorch/torch/csrc/utils/python_arg_parser.cpp:338 #69 0x7f5700f67e93 in dispatch /home/user/pytorch/torch/csrc/PyInterpreter.cpp:322 #70 0x7f56c5bff57d in pythonFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:58 #71 0x7f56c5c028c6 in make_boxed_function<(anonymous namespace)::pythonFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:145 #72 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #73 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #74 0x7f5700f7c6f1 in c10::Dispatcher::callBoxedForDispatchKey(c10::OperatorHandle const&, c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f6f1) #75 0x7f5700f7c001 in c10::OperatorHandle::callBoxedForDispatchKey(c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f001) #76 0x7f5700f68a9c in python_dispatcher /home/user/pytorch/torch/csrc/PyInterpreter.cpp:358 #77 0x7f56c5bffbc9 in pythonDispatcherFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:98 #78 0x7f56c5c02991 in make_boxed_function<(anonymous namespace)::pythonDispatcherFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:149 #79 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #80 0x7f56c85ec079 in c10::impl::BoxedKernelWrapper<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long), void>::call(c10::BoxedKernel const&, c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/aten/src/ATen/core/boxing/impl/boxing.h:227 #81 0x7f56c82d2c4f in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long>(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:112 #82 0x7f56c82d2c4f in at::Tensor c10::Dispatcher::redispatch<at::Tensor, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long)> const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:661 #83 0x7f56c9bd261c in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long)>::redispatch(c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:497 #84 0x7f56c9bd261c in at::_ops::_embedding_bag_dense_backward::redispatch(c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/build/aten/src/ATen/Operators_4.cpp:2145 #85 0x7f56d3816017 in at::redispatch::_embedding_bag_dense_backward_symint(c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/build/aten/src/ATen/RedispatchFunctions.h:2677 #86 0x7f56d34ed0d2 in operator() /home/user/pytorch/torch/csrc/autograd/generated/VariableType_4.cpp:361 #87 0x7f56d34ee173 in _embedding_bag_dense_backward /home/user/pytorch/torch/csrc/autograd/generated/VariableType_4.cpp:363 #88 0x7f56d3759e45 in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #89 0x7f56d3759e45 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:480 #90 0x7f56d37d347c in call_functor_with_args_from_stack_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor(c10::DispatchKeySet, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int), torch::autograd::VariableType::(anonymous namespace)::_embedding_bag_dense_backward>, at::Tensor, c10::guts::typelist::typelist<c10::DispatchKeySet, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int> >, false, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int> /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:501 #91 0x7f56d37bacde in call_functor_with_args_from_stack<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor(c10::DispatchKeySet, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int), torch::autograd::VariableType::(anonymous namespace)::_embedding_bag_dense_backward>, at::Tensor, c10::guts::typelist::typelist<c10::DispatchKeySet, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, const c10::optional<at::Tensor>&, long int> >, false> /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:513 #92 0x7f56d375a0a0 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:584 #93 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #94 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #95 0x7f5700f7c6f1 in c10::Dispatcher::callBoxedForDispatchKey(c10::OperatorHandle const&, c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f6f1) #96 0x7f5700f7c001 in c10::OperatorHandle::callBoxedForDispatchKey(c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f001) #97 0x7f5700f68a9c in python_dispatcher /home/user/pytorch/torch/csrc/PyInterpreter.cpp:358 #98 0x7f56c5bffbc9 in pythonDispatcherFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:98 #99 0x7f56c5c02991 in make_boxed_function<(anonymous namespace)::pythonDispatcherFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:149 #100 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #101 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #102 0x7f56c534c714 in c10::Dispatcher::redispatchBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe1f5714) #103 0x7f56c534c466 in c10::OperatorHandle::redispatchBoxed(c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe1f5466) #104 0x7f56c5bffd62 in pythonTLSSnapshotFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:107 #105 0x7f56c5c02aaf in make_boxed_function<(anonymous namespace)::pythonTLSSnapshotFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:153 #106 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #107 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #108 0x7f5700f7c6f1 in c10::Dispatcher::callBoxedForDispatchKey(c10::OperatorHandle const&, c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f6f1) #109 0x7f5700f7c001 in c10::OperatorHandle::callBoxedForDispatchKey(c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f001) #110 0x7f5700f68a9c in python_dispatcher /home/user/pytorch/torch/csrc/PyInterpreter.cpp:358 #111 0x7f56c5bffbc9 in pythonDispatcherFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:98 #112 0x7f56c5c02991 in make_boxed_function<(anonymous namespace)::pythonDispatcherFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:149 #113 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #114 0x7f56c85ec079 in c10::impl::BoxedKernelWrapper<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long), void>::call(c10::BoxedKernel const&, c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/aten/src/ATen/core/boxing/impl/boxing.h:227 #115 0x7f56c9bd1c62 in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long>(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:112 #116 0x7f56c9bd1c62 in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long)> const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:644 #117 0x7f56c9bd1c62 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long)>::call(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:492 #118 0x7f56c9bd1c62 in at::_ops::_embedding_bag_dense_backward::call(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/build/aten/src/ATen/Operators_4.cpp:2138 #119 0x7f56c63d6233 in at::_embedding_bag_dense_backward_symint(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, c10::optional<at::Tensor> const&, long) /home/user/pytorch/build/aten/src/ATen/ops/_embedding_bag_dense_backward.h:38 #120 0x7f56c639ef48 in at::native::_embedding_bag_backward_symint(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) /home/user/pytorch/aten/src/ATen/native/EmbeddingBag.cpp:1450 #121 0x7f56cb1674ed in wrapper_CompositeImplicitAutograd___embedding_bag_backward /home/user/pytorch/build/aten/src/ATen/RegisterCompositeImplicitAutograd.cpp:2372 #122 0x7f56cb40acd7 in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #123 0x7f56cb40acd7 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:463 #124 0x7f56cb5419de in call_functor_with_args_from_stack_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, bool, const c10::optional<at::Tensor>&, long int), at::(anonymous namespace)::(anonymous namespace)::wrapper_CompositeImplicitAutograd___embedding_bag_backward>, at::Tensor, c10::guts::typelist::typelist<const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, bool, const c10::optional<at::Tensor>&, long int> >, false, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, bool, const c10::optional<at::Tensor>&, long int> /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:501 #125 0x7f56cb4e7258 in call_functor_with_args_from_stack<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, bool, const c10::optional<at::Tensor>&, long int), at::(anonymous namespace)::(anonymous namespace)::wrapper_CompositeImplicitAutograd___embedding_bag_backward>, at::Tensor, c10::guts::typelist::typelist<const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, c10::SymInt, bool, long int, bool, const c10::optional<at::Tensor>&, long int> >, false> /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:513 #126 0x7f56cb40af1f in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:584 #127 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #128 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #129 0x7f5700f7c6f1 in c10::Dispatcher::callBoxedForDispatchKey(c10::OperatorHandle const&, c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f6f1) #130 0x7f5700f7c001 in c10::OperatorHandle::callBoxedForDispatchKey(c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f001) #131 0x7f5700f68a9c in python_dispatcher /home/user/pytorch/torch/csrc/PyInterpreter.cpp:358 #132 0x7f56c5bffbc9 in pythonDispatcherFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:98 #133 0x7f56c5c02991 in make_boxed_function<(anonymous namespace)::pythonDispatcherFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:149 #134 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #135 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #136 0x7f56c534c714 in c10::Dispatcher::redispatchBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe1f5714) #137 0x7f56c534c466 in c10::OperatorHandle::redispatchBoxed(c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe1f5466) #138 0x7f56c5bffd62 in pythonTLSSnapshotFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:107 #139 0x7f56c5c02aaf in make_boxed_function<(anonymous namespace)::pythonTLSSnapshotFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:153 #140 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #141 0x7f5700f7acc8 in c10::KernelFunction::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:43 #142 0x7f5700f7c6f1 in c10::Dispatcher::callBoxedForDispatchKey(c10::OperatorHandle const&, c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f6f1) #143 0x7f5700f7c001 in c10::OperatorHandle::callBoxedForDispatchKey(c10::DispatchKey, std::vector<c10::IValue, std::allocator<c10::IValue> >&) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_python.so+0x298f001) #144 0x7f5700f68a9c in python_dispatcher /home/user/pytorch/torch/csrc/PyInterpreter.cpp:358 #145 0x7f56c5bffbc9 in pythonDispatcherFallback /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:98 #146 0x7f56c5c02991 in make_boxed_function<(anonymous namespace)::pythonDispatcherFallback> /home/user/pytorch/aten/src/ATen/core/PythonFallbackKernel.cpp:149 #147 0x7f5700f7a988 in c10::BoxedKernel::callBoxed(c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const /home/user/pytorch/aten/src/ATen/core/boxing/BoxedKernel_impl.h:41 #148 0x7f56c9f58d91 in c10::impl::BoxedKernelWrapper<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long), void>::call(c10::BoxedKernel const&, c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) /home/user/pytorch/aten/src/ATen/core/boxing/impl/boxing.h:227 #149 0x7f56c9bcf7f4 in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long>(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:112 #150 0x7f56c9bcf7f4 in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long)> const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:644 #151 0x7f56c9bcf7f4 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long)>::call(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:492 #152 0x7f56c9bcf7f4 in at::_ops::_embedding_bag_backward::call(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) /home/user/pytorch/build/aten/src/ATen/Operators_4.cpp:2113 #153 0x7f56d21f8e86 in at::_embedding_bag_backward_symint(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::SymInt, bool, long, bool, c10::optional<at::Tensor> const&, long) /home/user/pytorch/build/aten/src/ATen/ops/_embedding_bag_backward.h:38 #154 0x7f56d210a453 in torch::autograd::generated::EmbeddingBagBackward0::apply(std::vector<at::Tensor, std::allocator<at::Tensor> >&&) /home/user/pytorch/torch/csrc/autograd/generated/Functions.cpp:6307 #155 0x7f56d59276a1 in torch::autograd::Node::operator()(std::vector<at::Tensor, std::allocator<at::Tensor> >&&) /home/user/pytorch/torch/csrc/autograd/function.h:184 #156 0x7f56d5913ae1 in call_function /home/user/pytorch/torch/csrc/autograd/engine.cpp:918 #157 0x7f56d5914d6e in torch::autograd::Engine::evaluate_function(std::shared_ptr<torch::autograd::GraphTask>&, torch::autograd::Node*, torch::autograd::InputBuffer&, std::shared_ptr<torch::autograd::ReadyQueue> const&) /home/user/pytorch/torch/csrc/autograd/engine.cpp:983 #158 0x7f56d590ce36 in torch::autograd::Engine::thread_main(std::shared_ptr<torch::autograd::GraphTask> const&) /home/user/pytorch/torch/csrc/autograd/engine.cpp:545 #159 0x7f56d5919e11 in torch::autograd::Engine::execute_with_graph_task(std::shared_ptr<torch::autograd::GraphTask> const&, std::shared_ptr<torch::autograd::Node>, torch::autograd::InputBuffer&&) /home/user/pytorch/torch/csrc/autograd/engine.cpp:1262 #160 0x7f57011bf875 in torch::autograd::python::PythonEngine::execute_with_graph_task(std::shared_ptr<torch::autograd::GraphTask> const&, std::shared_ptr<torch::autograd::Node>, torch::autograd::InputBuffer&&) /home/user/pytorch/torch/csrc/autograd/python_engine.cpp:152 #161 0x7f56d5918e14 in torch::autograd::Engine::execute(std::vector<torch::autograd::Edge, std::allocator<torch::autograd::Edge> > const&, std::vector<at::Tensor, std::allocator<at::Tensor> > const&, bool, bool, bool, std::vector<torch::autograd::Edge, std::allocator<torch::autograd::Edge> > const&) /home/user/pytorch/torch/csrc/autograd/engine.cpp:1209 #162 0x7f57011bf6c1 in torch::autograd::python::PythonEngine::execute(std::vector<torch::autograd::Edge, std::allocator<torch::autograd::Edge> > const&, std::vector<at::Tensor, std::allocator<at::Tensor> > const&, bool, bool, bool, std::vector<torch::autograd::Edge, std::allocator<torch::autograd::Edge> > const&) /home/user/pytorch/torch/csrc/autograd/python_engine.cpp:139 #163 0x7f57011c1cad in THPEngine_run_backward(_object*, _object*, _object*) /home/user/pytorch/torch/csrc/autograd/python_engine.cpp:333 #164 0x7f57356cdb72 in cfunction_call Objects/methodobject.c:543 #165 0x7f5735678a95 in _PyObject_MakeTpCall Objects/call.c:215 #166 0x7f573577e4eb in _PyObject_VectorcallTstate Include/cpython/abstract.h:112 #167 0x7f573577e566 in PyObject_Vectorcall Include/cpython/abstract.h:123 #168 0x7f5735790d6e in call_function Python/ceval.c:5891 #169 0x7f573578c4ea in _PyEval_EvalFrameDefault Python/ceval.c:4231 #170 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #171 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #172 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #173 0x7f573577e507 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #174 0x7f573577e566 in PyObject_Vectorcall Include/cpython/abstract.h:123 #175 0x7f5735790d6e in call_function Python/ceval.c:5891 #176 0x7f573578c4ea in _PyEval_EvalFrameDefault Python/ceval.c:4231 #177 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #178 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #179 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #180 0x7f573577e507 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #181 0x7f573577e566 in PyObject_Vectorcall Include/cpython/abstract.h:123 #182 0x7f5735790d6e in call_function Python/ceval.c:5891 #183 0x7f573578c4ea in _PyEval_EvalFrameDefault Python/ceval.c:4231 #184 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #185 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #186 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #187 0x7f573577e507 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #188 0x7f573577e566 in PyObject_Vectorcall Include/cpython/abstract.h:123 #189 0x7f5735790d6e in call_function Python/ceval.c:5891 #190 0x7f573578c3a4 in _PyEval_EvalFrameDefault Python/ceval.c:4213 #191 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #192 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #193 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #194 0x7f5735678c5f in PyVectorcall_Call Objects/call.c:267 #195 0x7f5735678ce9 in _PyObject_Call Objects/call.c:290 #196 0x7f5735678dda in PyObject_Call Objects/call.c:317 #197 0x7f5735791193 in do_call_core Python/ceval.c:5943 #198 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #199 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #200 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #201 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #202 0x7f573567b939 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #203 0x7f573567bc2d in method_vectorcall Objects/classobject.c:53 #204 0x7f573577e507 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #205 0x7f573577e566 in PyObject_Vectorcall Include/cpython/abstract.h:123 #206 0x7f5735790d6e in call_function Python/ceval.c:5891 #207 0x7f573578c4ea in _PyEval_EvalFrameDefault Python/ceval.c:4231 #208 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #209 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #210 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #211 0x7f5735678c5f in PyVectorcall_Call Objects/call.c:267 #212 0x7f5735678ce9 in _PyObject_Call Objects/call.c:290 #213 0x7f5735678dda in PyObject_Call Objects/call.c:317 #214 0x7f5735791193 in do_call_core Python/ceval.c:5943 #215 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #216 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #217 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #218 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #219 0x7f5735678c5f in PyVectorcall_Call Objects/call.c:267 #220 0x7f5735678ce9 in _PyObject_Call Objects/call.c:290 #221 0x7f5735678dda in PyObject_Call Objects/call.c:317 #222 0x7f5735791193 in do_call_core Python/ceval.c:5943 #223 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #224 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #225 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #226 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #227 0x7f5735678c5f in PyVectorcall_Call Objects/call.c:267 #228 0x7f5735678ce9 in _PyObject_Call Objects/call.c:290 #229 0x7f5735678dda in PyObject_Call Objects/call.c:317 #230 0x7f5735791193 in do_call_core Python/ceval.c:5943 #231 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #232 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #233 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #234 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #235 0x7f5735678c5f in PyVectorcall_Call Objects/call.c:267 #236 0x7f5735678ce9 in _PyObject_Call Objects/call.c:290 #237 0x7f5735678dda in PyObject_Call Objects/call.c:317 #238 0x7f5735791193 in do_call_core Python/ceval.c:5943 #239 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #240 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #241 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #242 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #243 0x7f5735678c5f in PyVectorcall_Call Objects/call.c:267 #244 0x7f5735678ce9 in _PyObject_Call Objects/call.c:290 #245 0x7f5735678dda in PyObject_Call Objects/call.c:317 #246 0x7f5735791193 in do_call_core Python/ceval.c:5943 #247 0x7f573578c7d0 in _PyEval_EvalFrameDefault Python/ceval.c:4277 #248 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #249 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #250 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #251 0x7f573567b939 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #252 0x7f573567bc2d in method_vectorcall Objects/classobject.c:53 #253 0x7f573577e507 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #254 0x7f573577e566 in PyObject_Vectorcall Include/cpython/abstract.h:123 #255 0x7f5735790d6e in call_function Python/ceval.c:5891 #256 0x7f573578c3a4 in _PyEval_EvalFrameDefault Python/ceval.c:4213 #257 0x7f573577e7ba in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #258 0x7f573578f03f in _PyEval_Vector Python/ceval.c:5065 #259 0x7f5735678e8c in _PyFunction_Vectorcall Objects/call.c:342 #260 0x7f573577e507 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 0x60900000586c is located 20 bytes to the left of 20-byte region [0x609000005880,0x609000005894) allocated by thread T0 here: #0 0x7f5735a8a1ec in __interceptor_posix_memalign (/usr/lib/gcc/x86_64-pc-linux-gnu/11/libasan.so.6+0xb41ec) #1 0x7f56b6f7e74f in c10::alloc_cpu(unsigned long) /home/user/pytorch/c10/core/impl/alloc_cpu.cpp:74 #2 0x7f56b6ed38c4 in c10::DefaultCPUAllocator::allocate(unsigned long) const (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libc10.so+0x818c4) #3 0x7f56c537a2fc in c10::StorageImpl::StorageImpl(c10::StorageImpl::use_byte_size_t, c10::SymInt, c10::Allocator*, bool) (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe2232fc) #4 0x7f56c53888dd in c10::intrusive_ptr<c10::StorageImpl, c10::detail::intrusive_target_default_null_type<c10::StorageImpl> > c10::intrusive_ptr<c10::StorageImpl, c10::detail::intrusive_target_default_null_type<c10::StorageImpl> >::make<c10::StorageImpl::use_byte_size_t, unsigned long&, c10::Allocator*&, bool>(c10::StorageImpl::use_byte_size_t&&, unsigned long&, c10::Allocator*&, bool&&) (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe2318dd) #5 0x7f56c5387618 in c10::intrusive_ptr<c10::StorageImpl, c10::detail::intrusive_target_default_null_type<c10::StorageImpl> > c10::make_intrusive<c10::StorageImpl, c10::detail::intrusive_target_default_null_type<c10::StorageImpl>, c10::StorageImpl::use_byte_size_t, unsigned long&, c10::Allocator*&, bool>(c10::StorageImpl::use_byte_size_t&&, unsigned long&, c10::Allocator*&, bool&&) (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe230618) #6 0x7f56c538484c in at::TensorBase at::detail::_empty_strided_generic<c10::ArrayRef<long> >(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::Allocator*, c10::DispatchKeySet, c10::ScalarType) (/home/user/pytorch/build/lib.linux-x86_64-cpython-310/torch/lib/libtorch_cpu.so+0xe22d84c) #7 0x7f56c5375ab7 in at::detail::empty_strided_generic(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::Allocator*, c10::DispatchKeySet, c10::ScalarType) /home/user/pytorch/aten/src/ATen/EmptyTensor.cpp:220 #8 0x7f56c537668c in at::detail::empty_strided_cpu(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::ScalarType, bool) /home/user/pytorch/aten/src/ATen/EmptyTensor.cpp:270 #9 0x7f56c53769d6 in at::detail::empty_strided_cpu(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) /home/user/pytorch/aten/src/ATen/EmptyTensor.cpp:285 #10 0x7f56c6ec8407 in at::native::empty_strided_cpu(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) /home/user/pytorch/aten/src/ATen/native/TensorFactories.cpp:323 #11 0x7f56ca10ddfb in wrapper_CPU__empty_strided /home/user/pytorch/build/aten/src/ATen/RegisterCPU.cpp:5164 #12 0x7f56ca5ad1ff in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #13 0x7f56ca5ad1ff in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:463 #14 0x7f56c94d244a in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>&&, c10::ArrayRef<c10::SymInt>&&, c10::optional<c10::ScalarType>&&, c10::optional<c10::Layout>&&, c10::optional<c10::Device>&&, c10::optional<bool>&&) /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:50 #15 0x7f56c927b3a1 in at::Tensor c10::KernelFunction::call<at::Tensor, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool> >(c10::OperatorHandle const&, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:91 #16 0x7f56c927b3a1 in at::Tensor c10::Dispatcher::redispatch<at::Tensor, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool> >(c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>)> const&, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:661 #17 0x7f56c8f7d884 in c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>)>::redispatch(c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:497 #18 0x7f56c8f7d884 in at::_ops::empty_strided::redispatch(c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) /home/user/pytorch/build/aten/src/ATen/Operators_2.cpp:3299 #19 0x7f56ca025796 in empty_strided /home/user/pytorch/build/aten/src/ATen/RegisterBackendSelect.cpp:211 #20 0x7f56ca06e958 in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #21 0x7f56ca06e958 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:463 #22 0x7f56c94d244a in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>&&, c10::ArrayRef<c10::SymInt>&&, c10::optional<c10::ScalarType>&&, c10::optional<c10::Layout>&&, c10::optional<c10::Device>&&, c10::optional<bool>&&) /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:50 #23 0x7f56c8f7c4a5 in at::Tensor c10::KernelFunction::call<at::Tensor, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool> >(c10::OperatorHandle const&, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:91 #24 0x7f56c8f7c4a5 in at::Tensor c10::Dispatcher::call<at::Tensor, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool> >(c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>)> const&, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:644 #25 0x7f56c8f7c4a5 in c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>)>::call(c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:492 #26 0x7f56c8f7c4a5 in at::_ops::empty_strided::call(c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) /home/user/pytorch/build/aten/src/ATen/Operators_2.cpp:3292 #27 0x7f56c6f0786b in at::empty_strided_symint(c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::TensorOptions) /home/user/pytorch/build/aten/src/ATen/ops/empty_strided.h:49 #28 0x7f56c6eca0b3 in at::native::empty_like(at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>) /home/user/pytorch/aten/src/ATen/native/TensorFactories.cpp:385 #29 0x7f56ca8f5bf7 in wrapper_CompositeExplicitAutograd__empty_like /home/user/pytorch/build/aten/src/ATen/RegisterCompositeExplicitAutograd.cpp:2151 #30 0x7f56cab9c408 in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #31 0x7f56cab9c408 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:463 #32 0x7f56c8d883fa in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::optional<c10::ScalarType>&&, c10::optional<c10::Layout>&&, c10::optional<c10::Device>&&, c10::optional<bool>&&, c10::optional<c10::MemoryFormat>&&) /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:50 #33 0x7f56c96adcb2 in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat> >(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>) const /home/user/pytorch/aten/src/ATen/core/boxing/KernelFunction_impl.h:103 #34 0x7f56c96adcb2 in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat> >(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>)> const&, at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:644 #35 0x7f56c96adcb2 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>)>::call(at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>) const /home/user/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:492 #36 0x7f56c96adcb2 in at::_ops::empty_like::call(at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>) /home/user/pytorch/build/aten/src/ATen/Operators_3.cpp:2902 #37 0x7f56c55a2ff0 in at::empty_like(at::Tensor const&, c10::TensorOptions, c10::optional<c10::MemoryFormat>) /home/user/pytorch/build/aten/src/ATen/ops/empty_like.h:27 #38 0x7f56c6edc073 in at::native::randn_like(at::Tensor const&, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>, c10::optional<c10::MemoryFormat>) /home/user/pytorch/aten/src/ATen/native/TensorFactories.cpp:983 #39 0x7f56ca903e17 in wrapper_CompositeExplicitAutograd__randn_like /home/user/pytorch/build/aten/src/ATen/RegisterCompositeExplicitAutograd.cpp:3397 #40 0x7f56cabec086 in operator() /home/user/pytorch/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13 #41 0x7f56cabec086 in call /home/user/pytorch/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:463 SUMMARY: AddressSanitizer: heap-buffer-overflow /home/user/pytorch/aten/src/ATen/native/cpu/BlasKernel.cpp:298 in operator() Shadow bytes around the buggy address: 0x0c127fff8ab0: fa fa fa fa fa fa fa fa fd fa fa fa fa fa fa fa 0x0c127fff8ac0: fa fa fa fa fa fa fa fa fd fa fa fa fa fa fa fa 0x0c127fff8ad0: fa fa fa fa fa fa fa fa 00 00 fa fa fa fa fa fa 0x0c127fff8ae0: fa fa fa fa fa fa fa fa fd fd fd fa fa fa fa fa 0x0c127fff8af0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c127fff8b00: fd fd fd fd fd fa fa fa fa fa fa fa fa[fa]fa fa 0x0c127fff8b10: 00 00 04 fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c127fff8b20: fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa 0x0c127fff8b30: fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa 0x0c127fff8b40: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fa fa 0x0c127fff8b50: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==43274==ABORTING ``` </details> My test run command: `ASAN_OPTIONS=halt_on_error=0:detect_leaks=0 LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/11/libasan.so.6 pytest -v test/test_decomp.py -k test_comprehensive_nn_functional_embedding_bag_cpu_bfloat16` Used build options: `CFLAGS='-O0 -g -ggdb' VERBOSE=1 USE_FBGEMM=OFF BUILD_CAFFE2=1 BUILD_LIBTORCH_CPU_WITH_DEBUG=y CMAKE_BUILD_TYPE=Debug DEBUG=1 python3 setup.py build --debug --cmake` Reproduces for me both on x86_64 and s390x. ### Versions PyTorch version: 2.1.0a0+gitab0a821 Is debug build: True CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: Gentoo Linux (x86_64) GCC version: (Gentoo 11.3.1_p20230120-r1 p7) 11.3.1 20230120 Clang version: 16.0.0 CMake version: version 3.25.2 Libc version: glibc-2.36 Python version: 3.10.10 (main, May 22 2023, 23:09:14) [GCC 11.3.1 20230120] (64-bit runtime) Python platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-11th_Gen_Intel-R-_Core-TM-_i7-1165G7_@_2.80GHz-with-glibc2.36 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 Address sizes: 39 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Vendor ID: GenuineIntel Model name: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz CPU family: 6 Model: 140 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 Stepping: 1 CPU(s) scaling MHz: 31% CPU max MHz: 4700.0000 CPU min MHz: 400.0000 BogoMIPS: 5606.40 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 tsc_known_freq 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 cat_l2 invpcid_single cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 192 KiB (4 instances) L1i cache: 128 KiB (4 instances) L2 cache: 5 MiB (4 instances) L3 cache: 12 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-7 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected 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; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] flake8==6.0.0 [pip3] flake8-bugbear==23.3.23 [pip3] flake8-comprehensions==3.11.1 [pip3] flake8-executable==2.1.3 [pip3] flake8-logging-format==0.9.0 [pip3] flake8-pyi==23.3.1 [pip3] flake8-simplify==0.19.3 [pip3] mypy==0.960 [pip3] mypy-extensions==1.0.0 [pip3] numpy==1.23.1 [conda] Could not collect cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @SherlockNoMad @ngimel
8
2,521
102,071
DISABLED test_build_tuple_unpack (__main__.DynamicShapesMiscTests)
triaged, module: flaky-tests, skipped, module: dynamo
Platforms: linux, mac, macos This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_build_tuple_unpack&suite=DynamicShapesMiscTests) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 3 workflow(s) with 3 failures and 3 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_build_tuple_unpack` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `dynamo/test_dynamic_shapes.py` or `dynamo/test_dynamic_shapes.py` cc @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx
62
2,522
102,109
Can't vmap over a slice expression
triaged, module: functorch
Code: ``` def foo(a, ind, len): ind2 = ind + len return a[ind:ind2] torch.vmap(foo, in_dims=(0, 0, None))(a, c, 2) ``` RuntimeError: vmap: It looks like you're calling .item() on a Tensor. We don't support vmap over calling .item() on a Tensor, please try to rewrite what you're doing with other operations. If error is occurring somewhere inside PyTorch internals, please file a bug report. cc @zou3519 @Chillee @samdow @kshitij12345 @janeyx99
5
2,523
102,064
[Inductor] nanogpt_generate failed due to RuntimeError: probability tensor contains either `inf`, `nan` or element < 0
high priority, triaged, module: NaNs and Infs, oncall: pt2, module: inductor
### πŸ› Describe the bug Torchbench model **nanogpt_generate** failure tracked in https://github.com/pytorch/pytorch/issues/93531#issuecomment-1558372237 ```bash cpu eval nanogpt_generate [2023-05-22 04:45:49,942] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_383 [2023-05-22 04:45:49,942] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_382 [2023-05-22 04:45:49,942] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_381 [2023-05-22 04:45:49,942] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_380 [2023-05-22 04:45:49,942] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_379 [2023-05-22 04:45:49,942] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_378 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_377 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_376 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_375 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_374 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_373 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_372 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_371 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_370 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_369 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_368 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_367 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_366 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_365 [2023-05-22 04:45:49,943] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_364 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_363 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_362 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_361 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_360 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_359 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_358 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_357 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_356 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_355 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_354 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_353 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_352 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_351 [2023-05-22 04:45:49,944] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_350 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_349 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_348 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_347 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_346 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_345 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_344 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_343 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_342 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_341 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_340 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_339 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_338 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_337 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_336 [2023-05-22 04:45:49,945] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_335 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_334 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_333 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_332 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_331 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_330 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_329 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_328 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_327 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_326 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_325 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_324 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_323 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_322 [2023-05-22 04:45:49,946] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_321 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_320 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_319 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_318 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_317 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_316 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_315 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_314 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_313 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_312 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_311 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_310 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_309 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_308 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_307 [2023-05-22 04:45:49,947] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_306 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_305 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_304 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_303 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_302 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_301 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_300 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_299 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_298 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_297 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_296 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_295 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_294 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_293 [2023-05-22 04:45:49,948] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_292 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_291 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_290 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_289 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_288 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_287 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_286 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_285 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_284 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_283 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_282 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_281 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_280 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_279 [2023-05-22 04:45:49,949] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_278 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_277 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_276 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_275 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_274 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_273 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_272 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_271 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_270 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_269 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_268 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_267 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_266 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_265 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_264 [2023-05-22 04:45:49,950] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_263 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_262 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_261 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_260 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_259 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_258 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_257 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_256 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_255 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_254 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_253 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_252 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_251 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_250 [2023-05-22 04:45:49,951] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_249 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_248 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_247 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_246 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_245 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_244 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_243 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_242 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_241 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_240 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_239 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_238 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_237 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_236 [2023-05-22 04:45:49,952] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_235 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_234 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_233 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_232 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_231 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_230 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_229 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_228 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_227 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_226 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_225 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_224 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_223 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_222 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_221 [2023-05-22 04:45:49,953] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_220 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_219 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_218 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_217 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_216 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_215 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_214 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_213 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_212 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_211 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_210 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_209 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_208 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_207 [2023-05-22 04:45:49,954] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_206 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_205 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_204 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_203 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_202 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_201 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_200 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_199 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_198 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_197 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_196 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_195 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_194 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_193 [2023-05-22 04:45:49,955] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_192 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_191 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_190 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_189 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_188 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_187 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_186 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_185 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_184 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_183 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_182 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_181 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_180 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_179 [2023-05-22 04:45:49,956] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_178 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_177 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_176 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_175 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_174 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_173 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_172 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_171 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_170 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_169 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_168 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_167 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_166 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_165 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_164 [2023-05-22 04:45:49,957] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_163 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_162 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_161 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_160 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_159 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_158 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_157 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_156 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_155 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_154 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_153 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_152 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_151 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_150 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_149 [2023-05-22 04:45:49,958] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_148 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_147 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_146 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_145 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_144 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_143 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_142 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_141 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_140 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_139 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_138 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_137 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_136 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_135 [2023-05-22 04:45:49,959] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_134 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_133 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_132 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_131 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_130 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_129 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_128 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_127 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_126 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_125 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_124 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_123 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_122 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_121 [2023-05-22 04:45:49,960] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_120 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_119 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_118 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_117 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_116 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_115 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_114 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_113 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_112 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_111 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_110 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_109 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_108 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_107 [2023-05-22 04:45:49,961] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_106 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_105 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_104 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_103 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_102 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_101 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_100 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_99 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_98 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_97 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_96 [2023-05-22 04:45:49,962] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_95 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_94 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_93 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_92 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_91 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_90 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_89 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_88 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_87 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_86 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_85 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_84 [2023-05-22 04:45:49,963] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_83 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_82 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_81 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_80 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_79 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_78 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_77 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_76 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_75 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_74 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_73 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_72 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_71 [2023-05-22 04:45:49,964] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_70 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_69 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_68 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_67 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_66 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_65 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_64 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_63 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_62 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_61 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_60 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_59 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_58 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_57 [2023-05-22 04:45:49,965] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_56 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_55 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_54 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_53 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_52 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_51 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_50 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_49 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_48 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_47 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_46 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_45 [2023-05-22 04:45:49,966] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_44 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_43 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_42 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_41 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_40 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_39 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_38 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_37 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_36 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_35 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_34 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_33 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_32 [2023-05-22 04:45:49,967] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_31 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_30 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_29 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_28 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_27 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_26 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_25 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_24 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_23 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_22 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_21 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_20 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_19 [2023-05-22 04:45:49,968] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_18 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_17 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_16 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_15 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_14 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_13 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_12 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_11 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_10 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_9 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_8 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_7 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_6 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_5 [2023-05-22 04:45:49,969] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_4 [2023-05-22 04:45:49,970] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_3 [2023-05-22 04:45:49,970] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_2 [2023-05-22 04:45:49,970] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split_1 [2023-05-22 04:45:49,970] torch._inductor.fx_passes.split_cat: [WARNING] example value absent for node: split ERROR:common:Backend dynamo failed in warmup() Traceback (most recent call last): File "/workspace/pytorch/benchmarks/dynamo/common.py", line 1551, in warmup fn(model, example_inputs) File "/workspace/pytorch/torch/_dynamo/eval_frame.py", line 287, in _fn return fn(*args, **kwargs) File "benchmarks/dynamo/torchbench.py", line 406, in forward_pass def forward_pass(self, mod, inputs, collect_outputs=True): File "/workspace/pytorch/torch/_dynamo/eval_frame.py", line 287, in _fn return fn(*args, **kwargs) File "/workspace/pytorch/torch/_dynamo/external_utils.py", line 17, in inner return fn(*args, **kwargs) File "/workspace/pytorch/torch/_functorch/aot_autograd.py", line 3714, in forward return compiled_fn(full_args) File "/workspace/pytorch/torch/_functorch/aot_autograd.py", line 1438, in g return f(*args) File "/workspace/pytorch/torch/_functorch/aot_autograd.py", line 2411, in runtime_wrapper all_outs = call_func_with_args( File "/workspace/pytorch/torch/_functorch/aot_autograd.py", line 1463, in call_func_with_args out = normalize_as_list(f(args)) File "/workspace/pytorch/torch/_functorch/aot_autograd.py", line 1556, in rng_functionalization_wrapper return compiled_fw(args) File "/tmp/tmp02tc9psn/uy/cuyyj5fpynwpu76mfolhwnrzqrl5i3ns7yn77huwb4o675qu6vkb.py", line 185819, in call buf302 = torch.ops.aten.multinomial.default(buf301, 1) File "/workspace/pytorch/torch/_ops.py", line 398, in __call__ return self._op(*args, **kwargs or {}) RuntimeError: probability tensor contains either `inf`, `nan` or element < 0 ERROR ``` SW information: SW | Nightly commit | Main commit -- | -- | -- Pytorch|[1c93857](https://github.com/pytorch/pytorch/commit/1c93857)|[9e8da7f](https://github.com/pytorch/pytorch/commit/9e8da7f) Torchbench|/|[987bbec3](https://github.com/pytorch/benchmark/commit/987bbec3) torchaudio|[894388d](https://github.com/pytorch/audio/commit/894388d)|[72d3fe0](https://github.com/pytorch/audio/commit/72d3fe0) torchtext|[3cf1db6](https://github.com/pytorch/text/commit/3cf1db6)| [0dc07eb](https://github.com/pytorch/text/commit/0dc07eb) torchvision|[50fb988](https://github.com/pytorch/vision/commit/50fb988)|[abc40ef](https://github.com/pytorch/vision/commit/abc40ef) torchdata|[a754743](https://github.com/pytorch/data/commit/a754743)|[ba31745](https://github.com/pytorch/data/commit/ba31745) dynamo_benchmarks|[174d01b](https://github.com/pytorch/pytorch/commit/174d01b)|/ ### Versions ```bash python -m torch.backends.xeon.run_cpu --node_id 0 benchmarks/dynamo/torchbench.py --performance --inference --float32 -dcpu -n50 --inductor --no-skip --dashboard --only nanogpt_generate --cold_start_latency ``` cc @ezyang @gchanan @zou3519 @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov
2
2,524
102,063
[dynamo][BE] Revisit call_method of NNModuleVariable
triaged, oncall: pt2, module: dynamo
We have lots of specialization in NNModuleVariable `call_method` here - https://github.com/pytorch/pytorch/blob/main/torch/_dynamo/variables/nn_module.py#L468-L616 This task is to revisit this and cleanup. At the time of writing this code, there were large number of graph breaks and therefore we specialized for these methods. Today, it is possible that Dynamo can trace the innards of these methods and do the right thing! Steps * Take this commit -https://github.com/pytorch/pytorch/commit/f6c97b2b54b44f118c8b671ad982fde27b6f17ca * Run `pytest test/dynamo/test_modules.py`. This is the start. cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx
1
2,525
102,044
DISABLED test_comprehensive_empty_strided_cuda_int64 (__main__.TestInductorOpInfoCUDA)
triaged, module: flaky-tests, skipped, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_comprehensive_empty_strided_cuda_int64&suite=TestInductorOpInfoCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 2 workflow(s) with 2 failures and 2 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_comprehensive_empty_strided_cuda_int64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `inductor/test_torchinductor_opinfo.py` or `inductor/test_torchinductor_opinfo.py` cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10
1
2,526
102,034
DISABLED test_call_parent_non_class_methods_from_child (torch._dynamo.testing.DynamicShapesMiscTests)
triaged, module: flaky-tests, skipped, module: dynamo
Platforms: linux, mac This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_call_parent_non_class_methods_from_child&suite=DynamicShapesMiscTests) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 2 workflow(s) with 2 failures and 2 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_call_parent_non_class_methods_from_child` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `dynamo/test_dynamic_shapes.py` or `dynamo/test_dynamic_shapes.py` cc @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx
6
2,527
102,033
DISABLED test_comprehensive_empty_strided_cuda_float64 (__main__.TestInductorOpInfoCUDA)
triaged, module: flaky-tests, skipped, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_comprehensive_empty_strided_cuda_float64&suite=TestInductorOpInfoCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 3 workflow(s) with 3 failures and 3 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_comprehensive_empty_strided_cuda_float64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `inductor/test_torchinductor_opinfo.py` or `inductor/test_torchinductor_opinfo.py` cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10
3
2,528
102,023
torch.compile FakeTensor tracing fails with foreach ops with multiple devices
module: optimizer, triaged, module: custom-operators, release notes: foreach_frontend, oncall: pt2, module: fakeTensor
### πŸ› Describe the bug Foreach ops support multiple devices in eager, but once we try to compile them they no longer support this behavior. ex. ```py import torch @torch.compile() def test_foreach_add(a0, a1, b0, b1): return torch._foreach_add([a0, a1], [b0, b1]) print( test_foreach_add( torch.ones(10, 10, device="cuda"), torch.ones(20, 20, device="cpu"), torch.zeros(10, 10, device="cuda"), torch.zeros(20, 20, device="cpu"), ) )``` removing compile fixes the issue. ### Error logs `--> python foreach_ex.py Traceback (most recent call last): File "/scratch/mlazos/test/foreach_ex.py", line 10, in <module> test_foreach_add( File "/scratch/mlazos/pytorch/torch/_dynamo/eval_frame.py", line 286, in _fn return fn(*args, **kwargs) File "/scratch/mlazos/pytorch/torch/_dynamo/eval_frame.py", line 439, in catch_errors return callback(frame, cache_size, hooks, frame_state) File "/scratch/mlazos/pytorch/torch/_dynamo/convert_frame.py", line 522, in _convert_frame result = inner_convert(frame, cache_size, hooks, frame_state) File "/scratch/mlazos/pytorch/torch/_dynamo/convert_frame.py", line 125, in _fn return fn(*args, **kwargs) File "/scratch/mlazos/pytorch/torch/_dynamo/convert_frame.py", line 358, in _convert_frame_assert return _compile( File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 177, in time_wrapper r = func(*args, **kwargs) File "/scratch/mlazos/pytorch/torch/_dynamo/convert_frame.py", line 428, in _compile out_code = transform_code_object(code, transform) File "/scratch/mlazos/pytorch/torch/_dynamo/bytecode_transformation.py", line 1000, in transform_code_object transformations(instructions, code_options) File "/scratch/mlazos/pytorch/torch/_dynamo/convert_frame.py", line 413, in transform tracer.run() File "/scratch/mlazos/pytorch/torch/_dynamo/symbolic_convert.py", line 2009, in run super().run() File "/scratch/mlazos/pytorch/torch/_dynamo/symbolic_convert.py", line 703, in run and self.step() File "/scratch/mlazos/pytorch/torch/_dynamo/symbolic_convert.py", line 663, in step getattr(self, inst.opname)(inst) File "/scratch/mlazos/pytorch/torch/_dynamo/symbolic_convert.py", line 385, in wrapper return inner_fn(self, inst) File "/scratch/mlazos/pytorch/torch/_dynamo/symbolic_convert.py", line 1094, in CALL_FUNCTION self.call_function(fn, args, {}) File "/scratch/mlazos/pytorch/torch/_dynamo/symbolic_convert.py", line 554, in call_function self.push(fn.call_function(self, args, kwargs)) File "/scratch/mlazos/pytorch/torch/_dynamo/variables/torch.py", line 565, in call_function tensor_variable = wrap_fx_proxy( File "/scratch/mlazos/pytorch/torch/_dynamo/variables/builder.py", line 1003, in wrap_fx_proxy return wrap_fx_proxy_cls( File "/scratch/mlazos/pytorch/torch/_dynamo/variables/builder.py", line 1038, in wrap_fx_proxy_cls example_value = get_fake_value(proxy.node, tx) File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 1288, in get_fake_value raise TorchRuntimeError(str(e)).with_traceback(e.__traceback__) from None File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 1256, in get_fake_value return wrap_fake_exception( File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 850, in wrap_fake_exception return fn() File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 1257, in <lambda> lambda: run_node(tx.output, node, args, kwargs, nnmodule) File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 1322, in run_node raise RuntimeError(fn_str + str(e)).with_traceback(e.__traceback__) from e File "/scratch/mlazos/pytorch/torch/_dynamo/utils.py", line 1309, in run_node return node.target(*args, **kwargs) File "/scratch/mlazos/pytorch/torch/utils/_stats.py", line 20, in wrapper return fn(*args, **kwargs) File "/scratch/mlazos/pytorch/torch/_subclasses/fake_tensor.py", line 1105, in __torch_dispatch__ return self.dispatch(func, types, args, kwargs) File "/scratch/mlazos/pytorch/torch/_subclasses/fake_tensor.py", line 1321, in dispatch return self.wrap_meta_outputs_with_default_device_logic(r, func, args, kwargs) File "/scratch/mlazos/pytorch/torch/_subclasses/fake_tensor.py", line 1385, in wrap_meta_outputs_with_default_device_logic return tree_map(partial(wrap), r) File "/scratch/mlazos/pytorch/torch/utils/_pytree.py", line 196, in tree_map return tree_unflatten([fn(i) for i in flat_args], spec) File "/scratch/mlazos/pytorch/torch/utils/_pytree.py", line 196, in <listcomp> return tree_unflatten([fn(i) for i in flat_args], spec) File "/scratch/mlazos/pytorch/torch/_subclasses/fake_tensor.py", line 1406, in wrap ) = FakeTensor._find_common_device(func, args, kwargs) File "/scratch/mlazos/pytorch/torch/_subclasses/fake_tensor.py", line 1041, in _find_common_device tree_map(merge_devices, args) File "/scratch/mlazos/pytorch/torch/utils/_pytree.py", line 196, in tree_map return tree_unflatten([fn(i) for i in flat_args], spec) File "/scratch/mlazos/pytorch/torch/utils/_pytree.py", line 196, in <listcomp> return tree_unflatten([fn(i) for i in flat_args], spec) File "/scratch/mlazos/pytorch/torch/_subclasses/fake_tensor.py", line 1037, in merge_devices raise RuntimeError( torch._dynamo.exc.TorchRuntimeError: Failed running call_function <built-in method _foreach_add of type object at 0x7fea51669688>(*([FakeTensor(..., device='cuda:0', size=(10, 10)), FakeTensor(..., size=(20, 20))], [FakeTensor(..., device='cuda:0', size=(10, 10)), FakeTensor(..., size=(20, 20))]), **{}): Unhandled FakeTensor Device Propagation for aten._foreach_add.List, found two different devices cuda:0, cpu from user code: File "/scratch/mlazos/test/foreach_ex.py", line 6, in test_foreach_add return torch._foreach_add([a0, a1], [b0, b1]) Set torch._dynamo.config.verbose=True or TORCHDYNAMO_VERBOSE=1 for more information You can suppress this exception and fall back to eager by setting: import torch._dynamo torch._dynamo.config.suppress_errors = True ### Minified repro _No response_ ### Versions 0a7ea9627f087afef5c59b2500e018abb6c3c1b5 cc @vincentqb @jbschlosser @albanD @janeyx99 @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
5
2,529
101,999
[FSDP] Ensure full precision checkpoints
oncall: distributed, triaged, module: fsdp
### πŸ“š The doc issue The FSDP MixedPrecision API docs say that checkpoint in full precision is only ensured for full_state_dict, let's ensure we have support for sharded_state_dict and update. ### Suggest a potential alternative/fix _No response_ cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @fegin
0
2,530
101,998
[FSDP] Summon buffers in full precision
oncall: distributed, module: fsdp
### πŸ› Describe the bug We should check if we are doing this and fix as needed, and update the mixed precision API documentation. ### Versions main cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
0
2,531
101,995
[PyTorch] Redirect c10::optional to std::optional
module: bc-breaking, module: cpu, NNC, release notes: quantization, release notes: distributed (c10d), topic: bc breaking
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * __->__ #101995 We have C++17 now! I am intentionally dropping the `c10::optional<c10::ArrayRef>` size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use `optional<ArrayRef>` in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) cc @ezyang @gchanan @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @EikanWang
41
2,532
101,984
[dynamo] BackendCompilerFailed: backend='inductor' raised: NetworkXUnbounded: Infinite capacity path, flow unbounded above.
triaged, oncall: pt2
### πŸ› Describe the bug Error with attention mask in torch.nn.TransformerEncoderLayer Easy example: ``` if __name__=="__main__": import torch model = torch.nn.TransformerEncoderLayer( d_model=256, nhead=4, dim_feedforward=1024, dropout=0.1, activation="gelu", batch_first=True, ) model = torch.compile( model, dynamic=True, fullgraph=True, ) device = 'cuda' model = model.cuda() optimizer = torch.optim.AdamW( model.parameters(), lr=1e-4, weight_decay=1e-5, ) model.train() for i in range(10): with torch.cuda.amp.autocast(enabled=False): optimizer.zero_grad() x = torch.randn( 10, 2 + i * 2, 256, ).cuda() memory_mask = torch.zeros( x.size(0), x.size(1), device=x.device, ).bool() res = model( x, src_key_padding_mask=memory_mask, ) loss = ((res - x) ** 2).mean() loss.backward() optimizer.step() print(i) ``` if "src_key_padding_mask is None" than work well. ### Error logs [2023-05-22 23:22:23,642] torch._inductor.utils: [WARNING] using triton random, expect difference from eager 0 Failed to compute min-cut on following graph: source primals_1_in {'capacity': inf} source primals_2_in {'capacity': inf} source primals_3_in {'capacity': inf} source primals_4_in {'capacity': inf} source primals_5_in {'capacity': inf} source primals_6_in {'capacity': inf} source primals_7_in {'capacity': inf} source primals_8_in {'capacity': inf} source primals_9_in {'capacity': inf} source primals_10_in {'capacity': inf} source primals_11_in {'capacity': inf} source primals_12_in {'capacity': inf} source primals_13_in {'capacity': inf} source primals_14_in {'capacity': inf} source primals_15_in {'capacity': inf} source full_like_in {'capacity': inf} source scalar_tensor_in {'capacity': inf} source where_in {'capacity': inf} source permute_1_in {'capacity': inf} source view_in {'capacity': inf} source mm_in {'capacity': inf} source add_in {'capacity': inf} source sym_size_in {'capacity': inf} source view_2_in {'capacity': inf} source unsqueeze_in {'capacity': inf} source permute_2_in {'capacity': inf} source squeeze_in {'capacity': inf} source clone_1_in {'capacity': inf} source permute_3_in {'capacity': inf} source permute_4_in {'capacity': inf} source permute_5_in {'capacity': inf} source view_7_in {'capacity': inf} source expand_1_in {'capacity': inf} source clone_2_in {'capacity': inf} source view_8_in {'capacity': inf} source view_9_in {'capacity': inf} source view_10_in {'capacity': inf} source view_11_in {'capacity': inf} source sym_size_1_in {'capacity': inf} source sym_float_in {'capacity': inf} source mul_1_in {'capacity': inf} source permute_6_in {'capacity': inf} source mul_2_in {'capacity': inf} source view_13_in {'capacity': inf} source sym_size_2_in {'capacity': inf} source view_14_in {'capacity': inf} source bmm_in {'capacity': inf} source view_15_in {'capacity': inf} source add_1_in {'capacity': inf} source view_16_in {'capacity': inf} source view_17_in {'capacity': inf} source amax_in {'capacity': inf} source rand_like_in {'capacity': inf} source mul_3_in {'capacity': inf} source view_19_in {'capacity': inf} source sym_size_3_in {'capacity': inf} source view_20_in {'capacity': inf} source bmm_1_in {'capacity': inf} source view_21_in {'capacity': inf} source view_22_in {'capacity': inf} source permute_8_in {'capacity': inf} source addmm_in {'capacity': inf} source philox_seed_like_in {'capacity': inf} source philox_rand_like_in {'capacity': inf} source gt_1_in {'capacity': inf} source convert_element_type_in {'capacity': inf} source mul_6_in {'capacity': inf} source mul_7_in {'capacity': inf} source var_mean_in {'capacity': inf} source permute_10_in {'capacity': inf} source view_24_in {'capacity': inf} source addmm_1_in {'capacity': inf} source mul_11_in {'capacity': inf} source mul_13_in {'capacity': inf} source sym_size_4_in {'capacity': inf} source add_6_in {'capacity': inf} source philox_rand_like_1_in {'capacity': inf} source gt_2_in {'capacity': inf} source convert_element_type_1_in {'capacity': inf} source permute_11_in {'capacity': inf} source sym_size_5_in {'capacity': inf} source view_26_in {'capacity': inf} source addmm_2_in {'capacity': inf} source view_27_in {'capacity': inf} source add_7_in {'capacity': inf} source philox_rand_like_2_in {'capacity': inf} source gt_3_in {'capacity': inf} source convert_element_type_2_in {'capacity': inf} source mul_21_in {'capacity': inf} source mul_22_in {'capacity': inf} source var_mean_1_in {'capacity': inf} source add_10_in {'capacity': inf} primals_1_in primals_1_out {'capacity': 1266556} primals_1_out permute_1_in {'capacity': inf} permute_1_in permute_1_out {'capacity': 1151415} primals_2_in primals_2_out {'capacity': 7967} primals_2_out add_in {'capacity': inf} add_in add_out {'capacity': 579488} primals_3_in primals_3_out {'capacity': 317194} primals_3_out permute_8_in {'capacity': inf} permute_8_in permute_8_out {'capacity': 288358} primals_4_in primals_4_out {'capacity': 1649} primals_4_out addmm_in {'capacity': inf} addmm_in addmm_out {'capacity': 59969} primals_5_in primals_5_out {'capacity': 1268776} primals_5_out permute_10_in {'capacity': inf} permute_10_in permute_10_out {'capacity': 1153433} primals_6_in primals_6_out {'capacity': 5451} primals_6_out addmm_1_in {'capacity': inf} addmm_1_in addmm_1_out {'capacity': 198246} primals_7_in primals_7_out {'capacity': 1268776} primals_7_out permute_11_in {'capacity': inf} permute_11_in permute_11_out {'capacity': 1153433} primals_8_in primals_8_out {'capacity': 2195} primals_8_out addmm_2_in {'capacity': inf} addmm_2_in addmm_2_out {'capacity': 79819} primals_9_in primals_9_out {'capacity': 1126} primals_9_out mul_9_in {'capacity': inf} primals_9_out mul_44_in {'capacity': inf} mul_9_in mul_9_out {'capacity': 109034} mul_44_in sink {'capacity': inf} primals_10_in primals_10_out {'capacity': 1362} primals_10_out add_4_in {'capacity': inf} add_4_in add_4_out {'capacity': 99122} primals_11_in primals_11_out {'capacity': 1126} primals_11_out mul_24_in {'capacity': inf} primals_11_out mul_26_in {'capacity': inf} mul_24_in mul_24_out {'capacity': 99122} mul_26_in sink {'capacity': inf} primals_12_in primals_12_out {'capacity': 1239} primals_12_out add_10_in {'capacity': inf} add_10_in add_10_out {'capacity': 45056} primals_13_in primals_13_out {'capacity': 1} primals_13_out mul_in {'capacity': inf} primals_13_out view_1_in {'capacity': inf} primals_13_out view_2_in {'capacity': inf} primals_13_out view_3_in {'capacity': inf} primals_13_out view_4_in {'capacity': inf} primals_13_out view_5_in {'capacity': inf} primals_13_out view_7_in {'capacity': inf} primals_13_out view_8_in {'capacity': inf} primals_13_out view_9_in {'capacity': inf} primals_13_out view_10_in {'capacity': inf} primals_13_out view_11_in {'capacity': inf} primals_13_out view_12_in {'capacity': inf} primals_13_out expand_2_in {'capacity': inf} primals_13_out view_13_in {'capacity': inf} primals_13_out expand_3_in {'capacity': inf} primals_13_out view_14_in {'capacity': inf} primals_13_out view_15_in {'capacity': inf} primals_13_out view_16_in {'capacity': inf} primals_13_out view_17_in {'capacity': inf} primals_13_out expand_4_in {'capacity': inf} primals_13_out view_19_in {'capacity': inf} primals_13_out expand_5_in {'capacity': inf} primals_13_out view_20_in {'capacity': inf} primals_13_out view_21_in {'capacity': inf} primals_13_out mul_5_in {'capacity': inf} primals_13_out view_23_in {'capacity': inf} primals_13_out view_25_in {'capacity': inf} primals_13_out mul_14_in {'capacity': inf} primals_13_out view_33_in {'capacity': inf} primals_13_out view_36_in {'capacity': inf} primals_13_out view_37_in {'capacity': inf} primals_13_out view_38_in {'capacity': inf} primals_13_out view_39_in {'capacity': inf} primals_13_out view_40_in {'capacity': inf} primals_13_out view_42_in {'capacity': inf} primals_13_out view_43_in {'capacity': inf} primals_13_out view_45_in {'capacity': inf} primals_13_out view_46_in {'capacity': inf} primals_13_out view_47_in {'capacity': inf} primals_13_out view_48_in {'capacity': inf} primals_13_out view_49_in {'capacity': inf} primals_13_out view_50_in {'capacity': inf} primals_13_out view_51_in {'capacity': inf} primals_13_out view_52_in {'capacity': inf} primals_13_out full_in {'capacity': inf} primals_13_out view_53_in {'capacity': inf} mul_in mul_out {'capacity': 1} view_1_in view_1_out {'capacity': 148684} view_2_in view_2_out {'capacity': 526808} view_3_in view_3_out {'capacity': 49561} view_4_in view_4_out {'capacity': 49561} view_5_in view_5_out {'capacity': 49561} view_7_in view_7_out {'capacity': 912} view_8_in view_8_out {'capacity': 2742} view_9_in view_9_out {'capacity': 2494} view_10_in view_10_out {'capacity': 119938} view_11_in view_11_out {'capacity': 131932} view_12_in view_12_out {'capacity': 109034} expand_2_in expand_2_out {'capacity': 99122} view_13_in view_13_out {'capacity': 45056} expand_3_in expand_3_out {'capacity': 99122} view_14_in view_14_out {'capacity': 45056} view_15_in view_15_out {'capacity': 9976} view_16_in view_16_out {'capacity': 8244} view_17_in view_17_out {'capacity': 7496} expand_4_in expand_4_out {'capacity': 6194} view_19_in view_19_out {'capacity': 2816} expand_5_in expand_5_out {'capacity': 99122} view_20_in view_20_out {'capacity': 45056} view_21_in view_21_out {'capacity': 119938} mul_5_in mul_5_out {'capacity': 1} view_23_in view_23_out {'capacity': 54517} view_25_in view_25_out {'capacity': 180224} mul_14_in mul_14_out {'capacity': 1} view_33_in sink {'capacity': inf} view_36_in sink {'capacity': inf} view_37_in sink {'capacity': inf} view_38_in sink {'capacity': inf} view_39_in sink {'capacity': inf} view_40_in sink {'capacity': inf} view_42_in sink {'capacity': inf} view_43_in sink {'capacity': inf} view_45_in sink {'capacity': inf} view_46_in sink {'capacity': inf} view_47_in sink {'capacity': inf} view_48_in sink {'capacity': inf} view_49_in sink {'capacity': inf} view_50_in sink {'capacity': inf} view_51_in sink {'capacity': inf} view_52_in sink {'capacity': inf} full_in full_out {'capacity': 135168} view_53_in sink {'capacity': inf} primals_14_in primals_14_out {'capacity': 59969} primals_14_out permute_in {'capacity': inf} primals_14_out add_2_in {'capacity': inf} permute_in permute_out {'capacity': 109034} add_2_in add_2_out {'capacity': 109034} primals_15_in primals_15_out {'capacity': 138} primals_15_out full_like_in {'capacity': inf} primals_15_out where_in {'capacity': inf} full_like_in full_like_out {'capacity': 1104} where_in where_out {'capacity': 1004} tangents_1_in sink {'capacity': inf} full_like_out where_in {'capacity': inf} scalar_tensor_in scalar_tensor_out {'capacity': 26} scalar_tensor_out where_in {'capacity': inf} where_out view_7_in {'capacity': inf} permute_out clone_in {'capacity': inf} clone_in clone_out {'capacity': 99122} permute_1_out mm_in {'capacity': inf} mm_in mm_out {'capacity': 163553} clone_out view_in {'capacity': inf} view_in view_out {'capacity': 45056} mul_out view_in {'capacity': inf} view_out mm_in {'capacity': inf} view_out sym_size_10_in {'capacity': inf} view_out mm_7_in {'capacity': inf} sym_size_10_in sym_size_10_out {'capacity': 1} mm_7_in sink {'capacity': inf} mm_out view_1_in {'capacity': inf} view_1_out add_in {'capacity': inf} view_1_out sym_size_in {'capacity': inf} sym_size_in sym_size_out {'capacity': 1} add_out view_2_in {'capacity': inf} sym_size_out view_2_in {'capacity': inf} sym_size_out view_50_in {'capacity': inf} sym_size_out view_51_in {'capacity': inf} sym_size_out view_52_in {'capacity': inf} sym_size_out full_in {'capacity': inf} sym_size_out view_53_in {'capacity': inf} view_2_out unsqueeze_in {'capacity': inf} unsqueeze_in unsqueeze_out {'capacity': 478916} unsqueeze_out permute_2_in {'capacity': inf} permute_2_in permute_2_out {'capacity': 435378} permute_2_out squeeze_in {'capacity': inf} squeeze_in squeeze_out {'capacity': 395798} squeeze_out clone_1_in {'capacity': inf} clone_1_in clone_1_out {'capacity': 359816} clone_1_out select_in {'capacity': inf} clone_1_out select_1_in {'capacity': inf} clone_1_out select_2_in {'capacity': inf} select_in select_out {'capacity': 109034} select_1_in select_1_out {'capacity': 109034} select_2_in select_2_out {'capacity': 109034} select_out view_3_in {'capacity': inf} select_1_out view_4_in {'capacity': inf} select_2_out view_5_in {'capacity': inf} view_3_out permute_3_in {'capacity': inf} view_3_out sym_size_1_in {'capacity': inf} permute_3_in permute_3_out {'capacity': 131932} sym_size_1_in sym_size_1_out {'capacity': 1} permute_3_out view_10_in {'capacity': inf} view_4_out permute_4_in {'capacity': inf} view_4_out sym_size_2_in {'capacity': inf} permute_4_in permute_4_out {'capacity': 145126} sym_size_2_in sym_size_2_out {'capacity': 1} permute_4_out view_11_in {'capacity': inf} view_5_out permute_5_in {'capacity': inf} view_5_out sym_size_3_in {'capacity': inf} permute_5_in permute_5_out {'capacity': 119938} sym_size_3_in sym_size_3_out {'capacity': 1} permute_5_out view_12_in {'capacity': inf} view_7_out expand_1_in {'capacity': inf} expand_1_in expand_1_out {'capacity': 3318} expand_1_out clone_2_in {'capacity': inf} clone_2_in clone_2_out {'capacity': 3018} clone_2_out view_8_in {'capacity': inf} view_8_out view_9_in {'capacity': inf} view_9_out add_1_in {'capacity': inf} add_1_in add_1_out {'capacity': 9070} view_10_out mul_1_in {'capacity': inf} mul_1_in mul_1_out {'capacity': 109034} view_11_out permute_6_in {'capacity': inf} permute_6_in permute_6_out {'capacity': 119938} view_12_out expand_5_in {'capacity': inf} sym_size_1_out sym_float_in {'capacity': inf} sym_size_1_out expand_2_in {'capacity': inf} sym_size_1_out view_13_in {'capacity': inf} sym_size_1_out view_46_in {'capacity': inf} sym_size_1_out view_49_in {'capacity': inf} sym_float_in sym_float_out {'capacity': inf} sym_float_out pow_1_in {'capacity': inf} pow_1_in pow_1_out {'capacity': inf} pow_1_out truediv_in {'capacity': inf} truediv_in truediv_out {'capacity': inf} truediv_out pow_2_in {'capacity': inf} pow_2_in pow_2_out {'capacity': inf} pow_2_out mul_1_in {'capacity': inf} pow_2_out mul_2_in {'capacity': inf} pow_2_out mul_56_in {'capacity': inf} pow_2_out mul_57_in {'capacity': inf} mul_2_in mul_2_out {'capacity': 109034} mul_56_in sink {'capacity': inf} mul_57_in sink {'capacity': inf} mul_1_out expand_2_in {'capacity': inf} permute_6_out mul_2_in {'capacity': inf} mul_2_out expand_3_in {'capacity': inf} expand_2_out view_13_in {'capacity': inf} view_13_out bmm_in {'capacity': inf} view_13_out permute_28_in {'capacity': inf} bmm_in bmm_out {'capacity': 5487} permute_28_in permute_28_out {'capacity': 45056} sym_size_2_out expand_3_in {'capacity': inf} sym_size_2_out view_14_in {'capacity': inf} sym_size_2_out view_45_in {'capacity': inf} sym_size_2_out view_48_in {'capacity': inf} expand_3_out view_14_in {'capacity': inf} view_14_out bmm_in {'capacity': inf} view_14_out permute_29_in {'capacity': inf} permute_29_in permute_29_out {'capacity': 45056} bmm_out view_15_in {'capacity': inf} view_15_out add_1_in {'capacity': inf} add_1_out view_16_in {'capacity': inf} view_16_out view_17_in {'capacity': inf} view_17_out amax_in {'capacity': inf} view_17_out sub_in {'capacity': inf} amax_in amax_out {'capacity': 1874} sub_in sub_out {'capacity': 6814} amax_out sub_in {'capacity': inf} sub_out exp_in {'capacity': inf} exp_in exp_out {'capacity': 6194} exp_out sum_1_in {'capacity': inf} exp_out div_in {'capacity': inf} sum_1_in sum_1_out {'capacity': 1548} div_in div_out {'capacity': 5632} sum_1_out div_in {'capacity': inf} div_out rand_like_in {'capacity': inf} div_out mul_3_in {'capacity': inf} div_out mul_54_in {'capacity': inf} div_out mul_55_in {'capacity': inf} rand_like_in rand_like_out {'capacity': 6194} mul_3_in mul_3_out {'capacity': 7496} mul_54_in sink {'capacity': inf} mul_55_in sink {'capacity': inf} rand_like_out gt_in {'capacity': inf} gt_in gt_out {'capacity': 1408} gt_out mul_3_in {'capacity': inf} gt_out convert_element_type_6_in {'capacity': inf} convert_element_type_6_in convert_element_type_6_out {'capacity': 5632} mul_3_out mul_4_in {'capacity': inf} mul_4_in mul_4_out {'capacity': 6814} mul_4_out expand_4_in {'capacity': inf} expand_4_out view_19_in {'capacity': inf} view_19_out bmm_1_in {'capacity': inf} view_19_out permute_26_in {'capacity': inf} bmm_1_in bmm_1_out {'capacity': 65966} permute_26_in permute_26_out {'capacity': 2816} sym_size_3_out expand_5_in {'capacity': inf} sym_size_3_out view_20_in {'capacity': inf} sym_size_3_out view_21_in {'capacity': inf} sym_size_3_out view_36_in {'capacity': inf} sym_size_3_out view_37_in {'capacity': inf} sym_size_3_out view_38_in {'capacity': inf} sym_size_3_out view_47_in {'capacity': inf} expand_5_out view_20_in {'capacity': inf} view_20_out bmm_1_in {'capacity': inf} view_20_out permute_27_in {'capacity': inf} permute_27_in permute_27_out {'capacity': 45056} bmm_1_out view_21_in {'capacity': inf} view_21_out permute_7_in {'capacity': inf} permute_7_in permute_7_out {'capacity': 109034} permute_7_out clone_3_in {'capacity': inf} clone_3_in clone_3_out {'capacity': 99122} clone_3_out view_22_in {'capacity': inf} view_22_in view_22_out {'capacity': 45056} mul_5_out view_22_in {'capacity': inf} mul_5_out view_24_in {'capacity': inf} view_24_in view_24_out {'capacity': 45056} view_22_out addmm_in {'capacity': inf} view_22_out sym_size_8_in {'capacity': inf} view_22_out mm_6_in {'capacity': inf} sym_size_8_in sym_size_8_out {'capacity': 1} mm_6_in sink {'capacity': inf} permute_8_out addmm_in {'capacity': inf} permute_8_out permute_21_in {'capacity': inf} permute_21_in permute_21_out {'capacity': 288358} addmm_out view_23_in {'capacity': inf} view_23_out permute_9_in {'capacity': inf} view_23_out sym_size_4_in {'capacity': inf} permute_9_in permute_9_out {'capacity': 49561} sym_size_4_in sym_size_4_out {'capacity': 1} permute_9_out philox_seed_like_in {'capacity': inf} permute_9_out philox_rand_like_in {'capacity': inf} permute_9_out mul_6_in {'capacity': inf} philox_seed_like_in philox_seed_like_out {'capacity': 4} philox_rand_like_in philox_rand_like_out {'capacity': 87801} mul_6_in mul_6_out {'capacity': 131932} philox_seed_like_out philox_rand_like_in {'capacity': inf} philox_seed_like_out philox_rand_like_1_in {'capacity': inf} philox_seed_like_out philox_rand_like_2_in {'capacity': inf} philox_seed_like_out philox_rand_like_3_in {'capacity': inf} philox_seed_like_out philox_rand_like_4_in {'capacity': inf} philox_seed_like_out philox_rand_like_5_in {'capacity': inf} philox_rand_like_1_in philox_rand_like_1_out {'capacity': 290252} philox_rand_like_2_in philox_rand_like_2_out {'capacity': 87801} philox_rand_like_3_in sink {'capacity': inf} philox_rand_like_4_in sink {'capacity': inf} philox_rand_like_5_in sink {'capacity': inf} philox_rand_like_out gt_1_in {'capacity': inf} gt_1_in gt_1_out {'capacity': 39908} gt_1_out convert_element_type_in {'capacity': inf} convert_element_type_in convert_element_type_out {'capacity': 145126} convert_element_type_out mul_6_in {'capacity': inf} mul_6_out mul_7_in {'capacity': inf} mul_7_in mul_7_out {'capacity': 119938} mul_7_out add_2_in {'capacity': inf} add_2_out var_mean_in {'capacity': inf} add_2_out sub_1_in {'capacity': inf} var_mean_in var_mean_out {'capacity': inf} sub_1_in sub_1_out {'capacity': 99122} var_mean_out getitem_in {'capacity': inf} var_mean_out getitem_1_in {'capacity': inf} getitem_in getitem_out {'capacity': 424} getitem_1_in getitem_1_out {'capacity': 424} getitem_out add_3_in {'capacity': inf} add_3_in add_3_out {'capacity': 386} getitem_1_out sub_1_in {'capacity': inf} add_3_out rsqrt_in {'capacity': inf} rsqrt_in rsqrt_out {'capacity': 352} rsqrt_out mul_8_in {'capacity': inf} rsqrt_out div_2_in {'capacity': inf} mul_8_in mul_8_out {'capacity': 90112} div_2_in div_2_out {'capacity': 352} sub_1_out mul_8_in {'capacity': inf} mul_8_out mul_9_in {'capacity': inf} mul_8_out mul_46_in {'capacity': inf} mul_8_out mul_47_in {'capacity': inf} mul_8_out mul_49_in {'capacity': inf} mul_46_in sink {'capacity': inf} mul_47_in sink {'capacity': inf} mul_49_in sink {'capacity': inf} mul_9_out add_4_in {'capacity': inf} add_4_out view_24_in {'capacity': inf} add_4_out add_8_in {'capacity': inf} add_8_in add_8_out {'capacity': 109034} permute_10_out addmm_1_in {'capacity': inf} permute_10_out permute_16_in {'capacity': inf} permute_16_in permute_16_out {'capacity': 1153433} view_24_out addmm_1_in {'capacity': inf} view_24_out sym_size_7_in {'capacity': inf} view_24_out mm_4_in {'capacity': inf} sym_size_7_in sym_size_7_out {'capacity': 1} mm_4_in sink {'capacity': inf} addmm_1_out view_25_in {'capacity': inf} view_25_out mul_11_in {'capacity': inf} view_25_out mul_12_in {'capacity': inf} view_25_out sym_size_5_in {'capacity': inf} view_25_out mul_38_in {'capacity': inf} view_25_out mul_41_in {'capacity': inf} mul_11_in mul_11_out {'capacity': 527730} mul_12_in mul_12_out {'capacity': 436142} sym_size_5_in sym_size_5_out {'capacity': 1} mul_38_in mul_38_out {'capacity': 360448} mul_41_in mul_41_out {'capacity': 360448} mul_11_out mul_13_in {'capacity': inf} mul_13_in mul_13_out {'capacity': 239878} mul_12_out erf_in {'capacity': inf} erf_in erf_out {'capacity': 396492} erf_out add_5_in {'capacity': inf} add_5_in add_5_out {'capacity': 360448} add_5_out mul_13_in {'capacity': inf} add_5_out mul_37_in {'capacity': inf} mul_37_in mul_37_out {'capacity': 360448} mul_13_out philox_rand_like_1_in {'capacity': inf} mul_13_out mul_16_in {'capacity': inf} mul_16_in mul_16_out {'capacity': 436142} sym_size_4_out mul_14_in {'capacity': inf} mul_14_out mul_15_in {'capacity': inf} mul_15_in mul_15_out {'capacity': 1} mul_15_out add_6_in {'capacity': inf} add_6_in add_6_out {'capacity': 1} add_6_out philox_rand_like_1_in {'capacity': inf} add_6_out add_7_in {'capacity': inf} add_6_out philox_rand_like_4_in {'capacity': inf} add_7_in add_7_out {'capacity': 1} philox_rand_like_1_out gt_2_in {'capacity': inf} gt_2_in gt_2_out {'capacity': 131932} gt_2_out convert_element_type_1_in {'capacity': inf} convert_element_type_1_in convert_element_type_1_out {'capacity': 479756} convert_element_type_1_out mul_16_in {'capacity': inf} mul_16_out mul_17_in {'capacity': inf} mul_17_in mul_17_out {'capacity': 396492} mul_17_out view_26_in {'capacity': inf} view_26_in view_26_out {'capacity': 180224} permute_11_out addmm_2_in {'capacity': inf} permute_11_out permute_12_in {'capacity': inf} permute_12_in permute_12_out {'capacity': 1153433} sym_size_5_out mul_18_in {'capacity': inf} sym_size_5_out view_27_in {'capacity': inf} sym_size_5_out view_30_in {'capacity': inf} mul_18_in mul_18_out {'capacity': 1} view_27_in view_27_out {'capacity': 72563} view_30_in sink {'capacity': inf} mul_18_out view_26_in {'capacity': inf} mul_18_out mul_20_in {'capacity': inf} mul_20_in mul_20_out {'capacity': 1} view_26_out addmm_2_in {'capacity': inf} view_26_out sym_size_6_in {'capacity': inf} view_26_out mm_2_in {'capacity': inf} sym_size_6_in sym_size_6_out {'capacity': 1} mm_2_in sink {'capacity': inf} addmm_2_out view_27_in {'capacity': inf} view_27_out philox_rand_like_2_in {'capacity': inf} view_27_out mul_21_in {'capacity': inf} mul_21_in mul_21_out {'capacity': 131932} mul_20_out add_7_in {'capacity': inf} add_7_out philox_rand_like_2_in {'capacity': inf} add_7_out philox_rand_like_3_in {'capacity': inf} philox_rand_like_2_out gt_3_in {'capacity': inf} gt_3_in gt_3_out {'capacity': 39908} gt_3_out convert_element_type_2_in {'capacity': inf} convert_element_type_2_in convert_element_type_2_out {'capacity': 145126} convert_element_type_2_out mul_21_in {'capacity': inf} mul_21_out mul_22_in {'capacity': inf} mul_22_in mul_22_out {'capacity': 119938} mul_22_out add_8_in {'capacity': inf} add_8_out var_mean_1_in {'capacity': inf} add_8_out sub_2_in {'capacity': inf} var_mean_1_in var_mean_1_out {'capacity': inf} sub_2_in sub_2_out {'capacity': 99122} var_mean_1_out getitem_2_in {'capacity': inf} var_mean_1_out getitem_3_in {'capacity': inf} getitem_2_in getitem_2_out {'capacity': 424} getitem_3_in getitem_3_out {'capacity': 424} getitem_2_out add_9_in {'capacity': inf} add_9_in add_9_out {'capacity': 386} getitem_3_out sub_2_in {'capacity': inf} add_9_out rsqrt_1_in {'capacity': inf} rsqrt_1_in rsqrt_1_out {'capacity': 352} rsqrt_1_out mul_23_in {'capacity': inf} rsqrt_1_out div_1_in {'capacity': inf} mul_23_in mul_23_out {'capacity': 90112} div_1_in div_1_out {'capacity': 352} sub_2_out mul_23_in {'capacity': inf} mul_23_out mul_24_in {'capacity': inf} mul_23_out mul_28_in {'capacity': inf} mul_23_out mul_29_in {'capacity': inf} mul_23_out mul_31_in {'capacity': inf} mul_28_in sink {'capacity': inf} mul_29_in sink {'capacity': inf} mul_31_in sink {'capacity': inf} mul_24_out add_10_in {'capacity': inf} add_10_out output_in {'capacity': inf} mul_27_in sink {'capacity': inf} sum_2_in sink {'capacity': inf} sum_3_in sink {'capacity': inf} sub_4_in sink {'capacity': inf} sub_5_in sink {'capacity': inf} div_1_out mul_30_in {'capacity': inf} mul_30_in sink {'capacity': inf} sum_4_in sink {'capacity': inf} sum_5_in sink {'capacity': inf} gt_4_in sink {'capacity': inf} convert_element_type_3_in sink {'capacity': inf} mul_32_in sink {'capacity': inf} mul_33_in sink {'capacity': inf} sym_size_6_out view_28_in {'capacity': inf} view_28_in sink {'capacity': inf} permute_12_out mm_1_in {'capacity': inf} mm_1_in sink {'capacity': inf} permute_13_in sink {'capacity': inf} permute_14_in sink {'capacity': inf} sum_6_in sink {'capacity': inf} view_29_in sink {'capacity': inf} permute_15_in sink {'capacity': inf} gt_5_in sink {'capacity': inf} convert_element_type_4_in sink {'capacity': inf} mul_34_in sink {'capacity': inf} mul_35_in sink {'capacity': inf} mul_37_out add_12_in {'capacity': inf} add_12_in add_12_out {'capacity': 360448} mul_38_out mul_39_in {'capacity': inf} mul_39_in mul_39_out {'capacity': 360448} mul_39_out exp_1_in {'capacity': inf} exp_1_in exp_1_out {'capacity': 360448} exp_1_out mul_40_in {'capacity': inf} mul_40_in mul_40_out {'capacity': 360448} mul_40_out mul_41_in {'capacity': inf} mul_41_out add_12_in {'capacity': inf} add_12_out mul_42_in {'capacity': inf} mul_42_in sink {'capacity': inf} sym_size_7_out view_31_in {'capacity': inf} view_31_in sink {'capacity': inf} permute_16_out mm_3_in {'capacity': inf} mm_3_in sink {'capacity': inf} permute_17_in sink {'capacity': inf} permute_18_in sink {'capacity': inf} sum_7_in sink {'capacity': inf} view_32_in sink {'capacity': inf} add_13_in sink {'capacity': inf} permute_19_in sink {'capacity': inf} mul_45_in sink {'capacity': inf} sum_8_in sink {'capacity': inf} sum_9_in sink {'capacity': inf} sub_7_in sink {'capacity': inf} sub_8_in sink {'capacity': inf} div_2_out mul_48_in {'capacity': inf} mul_48_in sink {'capacity': inf} sum_10_in sink {'capacity': inf} sum_11_in sink {'capacity': inf} gt_6_in sink {'capacity': inf} convert_element_type_5_in sink {'capacity': inf} mul_50_in sink {'capacity': inf} mul_51_in sink {'capacity': inf} permute_20_in sink {'capacity': inf} clone_4_in sink {'capacity': inf} sym_size_8_out view_34_in {'capacity': inf} view_34_in sink {'capacity': inf} permute_21_out mm_5_in {'capacity': inf} mm_5_in sink {'capacity': inf} permute_22_in sink {'capacity': inf} permute_23_in sink {'capacity': inf} sum_12_in sink {'capacity': inf} view_35_in sink {'capacity': inf} permute_24_in sink {'capacity': inf} permute_25_in sink {'capacity': inf} permute_26_out bmm_2_in {'capacity': inf} bmm_2_in sink {'capacity': inf} permute_27_out bmm_3_in {'capacity': inf} bmm_3_in sink {'capacity': inf} convert_element_type_6_out mul_52_in {'capacity': inf} mul_52_in mul_52_out {'capacity': 5632} mul_52_out mul_53_in {'capacity': inf} mul_53_in sink {'capacity': inf} clone_5_in sink {'capacity': inf} sum_13_in sink {'capacity': inf} sub_9_in sink {'capacity': inf} clone_6_in sink {'capacity': inf} sym_size_9_in sink {'capacity': inf} permute_28_out bmm_4_in {'capacity': inf} bmm_4_in sink {'capacity': inf} permute_29_out bmm_5_in {'capacity': inf} bmm_5_in sink {'capacity': inf} permute_30_in sink {'capacity': inf} permute_31_in sink {'capacity': inf} clone_7_in sink {'capacity': inf} permute_32_in sink {'capacity': inf} permute_33_in sink {'capacity': inf} clone_8_in sink {'capacity': inf} full_out select_scatter_in {'capacity': inf} full_out select_scatter_1_in {'capacity': inf} full_out select_scatter_2_in {'capacity': inf} select_scatter_in sink {'capacity': inf} select_scatter_1_in sink {'capacity': inf} select_scatter_2_in sink {'capacity': inf} add_14_in sink {'capacity': inf} add_15_in sink {'capacity': inf} unsqueeze_1_in sink {'capacity': inf} permute_34_in sink {'capacity': inf} squeeze_1_in sink {'capacity': inf} clone_9_in sink {'capacity': inf} sum_14_in sink {'capacity': inf} view_54_in sink {'capacity': inf} sym_size_10_out view_55_in {'capacity': inf} view_55_in sink {'capacity': inf} permute_35_in sink {'capacity': inf} permute_36_in sink {'capacity': inf} permute_37_in sink {'capacity': inf} --------------------------------------------------------------------------- BackendCompilerFailed Traceback (most recent call last) Cell In[4], line 43 33 x = torch.randn( 34 10, 35 2 + i*2, 36 256, 37 ).cuda() 38 memory_mask = torch.zeros( 39 x.size(0), 40 x.size(1), 41 device=x.device, 42 ).bool() ---> 43 res = model( 44 x, 45 src_key_padding_mask=memory_mask, 46 ) 47 loss = ((res - x)**2).mean() 49 loss.backward() File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/nn/modules/module.py:1502, in Module._wrapped_call_impl(self, *args, **kwargs) 1500 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc] 1501 else: -> 1502 return self._call_impl(*args, **kwargs) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/nn/modules/module.py:1511, in Module._call_impl(self, *args, **kwargs) 1506 # If we don't have any hooks, we want to skip the rest of the logic in 1507 # this function, and just call forward. 1508 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks 1509 or _global_backward_pre_hooks or _global_backward_hooks 1510 or _global_forward_hooks or _global_forward_pre_hooks): -> 1511 return forward_call(*args, **kwargs) 1512 # Do not call functions when jit is used 1513 full_backward_hooks, non_full_backward_hooks = [], [] File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py:287, in _TorchDynamoContext.__call__.<locals>._fn(*args, **kwargs) 285 dynamic_ctx.__enter__() 286 try: --> 287 return fn(*args, **kwargs) 288 finally: 289 set_eval_frame(prior) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py:440, in catch_errors_wrapper.<locals>.catch_errors(frame, cache_size, frame_state) 437 return hijacked_callback(frame, cache_size, hooks, frame_state) 439 with compile_lock: --> 440 return callback(frame, cache_size, hooks, frame_state) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py:125, in wrap_convert_context.<locals>._fn(*args, **kwargs) 123 cleanup = setup_compile_debug() 124 try: --> 125 return fn(*args, **kwargs) 126 finally: 127 cleanup.close() File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py:358, in convert_frame_assert.<locals>._convert_frame_assert(frame, cache_size, hooks, frame_state) 343 initial_deterministic_algorithms_state = ( 344 torch.are_deterministic_algorithms_enabled() 345 ) 347 signpost_event( 348 "dynamo", 349 "_convert_frame_assert._compile", (...) 355 }, 356 ) --> 358 return _compile( 359 frame.f_code, 360 frame.f_globals, 361 frame.f_locals, 362 frame.f_builtins, 363 compiler_fn, 364 one_graph, 365 export, 366 export_constraints, 367 hooks, 368 frame, 369 frame_state=frame_state, 370 ) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/utils.py:180, in dynamo_timed.<locals>.dynamo_timed_inner.<locals>.time_wrapper(*args, **kwargs) 178 with torch.profiler.record_function(f"{key} (dynamo_timed)"): 179 t0 = time.time() --> 180 r = func(*args, **kwargs) 181 time_spent = time.time() - t0 182 # print(f"Dynamo timer: key={key}, latency={latency:.2f} sec") File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py:428, in _compile(code, globals, locals, builtins, compiler_fn, one_graph, export, export_constraints, hooks, frame, frame_state) 426 for attempt in itertools.count(): 427 try: --> 428 out_code = transform_code_object(code, transform) 429 orig_code_map[out_code] = code 430 break File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/bytecode_transformation.py:1000, in transform_code_object(code, transformations, safe) 997 instructions = cleaned_instructions(code, safe) 998 propagate_line_nums(instructions) -> 1000 transformations(instructions, code_options) 1001 return clean_and_assemble_instructions(instructions, keys, code_options)[1] File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py:413, in _compile.<locals>.transform(instructions, code_options) 398 tracer = InstructionTranslator( 399 instructions, 400 code, (...) 410 frame_state=frame_state, 411 ) 412 with tracing(tracer.output.tracing_context): --> 413 tracer.run() 414 output = tracer.output 415 assert output is not None File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py:2019, in InstructionTranslator.run(self) 2018 def run(self): -> 2019 super().run() File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py:703, in InstructionTranslatorBase.run(self) 698 try: 699 self.output.push_tx(self) 700 while ( 701 self.instruction_pointer is not None 702 and not self.output.should_exit --> 703 and self.step() 704 ): 705 pass 706 except BackendCompilerFailed: File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py:663, in InstructionTranslatorBase.step(self) 659 unimplemented(f"missing: {inst.opname}") 660 TracingContext.set_current_loc( 661 self.f_code.co_filename, self.lineno, self.f_code.co_name 662 ) --> 663 getattr(self, inst.opname)(inst) 665 return inst.opname != "RETURN_VALUE" 666 except BackendCompilerFailed: File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py:2107, in InstructionTranslator.RETURN_VALUE(self, inst) 2102 _step_logger()( 2103 logging.INFO, 2104 f"torchdynamo done tracing {self.f_code.co_name} (RETURN_VALUE)", 2105 ) 2106 log.debug("RETURN_VALUE triggered compile") -> 2107 self.output.compile_subgraph( 2108 self, 2109 reason=GraphCompileReason( 2110 "return_value", [self.frame_summary()], graph_break=False 2111 ), 2112 ) 2113 self.output.add_output_instructions([create_instruction("RETURN_VALUE")]) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/output_graph.py:727, in OutputGraph.compile_subgraph(self, tx, partial_convert, reason) 724 append_prefix_insts() 725 # optimization to generate better code in a common case 726 self.add_output_instructions( --> 727 self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root) 728 + [create_instruction("UNPACK_SEQUENCE", arg=len(stack_values))] 729 ) 730 codegen = PyCodegen(tx) 731 else: File ~/.pyenv/versions/3.9.13/lib/python3.9/contextlib.py:79, in ContextDecorator.__call__.<locals>.inner(*args, **kwds) 76 @wraps(func) 77 def inner(*args, **kwds): 78 with self._recreate_cm(): ---> 79 return func(*args, **kwds) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/output_graph.py:829, in OutputGraph.compile_and_call_fx_graph(self, tx, rv, root) 826 name = unique_id("__compiled_fn") 828 assert_no_fake_params_or_buffers(gm) --> 829 compiled_fn = self.call_user_compiler(gm) 830 compiled_fn = disable(compiled_fn) 832 counters["stats"]["unique_graphs"] += 1 File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/utils.py:180, in dynamo_timed.<locals>.dynamo_timed_inner.<locals>.time_wrapper(*args, **kwargs) 178 with torch.profiler.record_function(f"{key} (dynamo_timed)"): 179 t0 = time.time() --> 180 r = func(*args, **kwargs) 181 time_spent = time.time() - t0 182 # print(f"Dynamo timer: key={key}, latency={latency:.2f} sec") File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/output_graph.py:888, in OutputGraph.call_user_compiler(self, gm) 886 assert callable(compiled_fn), "compiler_fn did not return callable" 887 except Exception as e: --> 888 raise BackendCompilerFailed(self.compiler_fn, e).with_traceback( 889 e.__traceback__ 890 ) from None 891 return compiled_fn File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/output_graph.py:884, in OutputGraph.call_user_compiler(self, gm) 881 if config.verify_correctness: 882 compiler_fn = WrapperBackend(compiler_fn) --> 884 compiled_fn = compiler_fn(gm, self.example_inputs()) 885 _step_logger()(logging.INFO, f"done compiler function {name}") 886 assert callable(compiled_fn), "compiler_fn did not return callable" File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/repro/after_dynamo.py:117, in wrap_backend_debug.<locals>.debug_wrapper(gm, example_inputs, **kwargs) 115 raise 116 else: --> 117 compiled_gm = compiler_fn(gm, example_inputs) 119 return compiled_gm File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/repro/after_dynamo.py:117, in wrap_backend_debug.<locals>.debug_wrapper(gm, example_inputs, **kwargs) 115 raise 116 else: --> 117 compiled_gm = compiler_fn(gm, example_inputs) 119 return compiled_gm File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/__init__.py:1538, in _TorchCompileInductorWrapper.__call__(self, model_, inputs_) 1535 def __call__(self, model_, inputs_): 1536 from torch._inductor.compile_fx import compile_fx -> 1538 return compile_fx(model_, inputs_, config_patches=self.config) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_inductor/compile_fx.py:610, in compile_fx(model_, example_inputs_, inner_compile, config_patches, decompositions) 608 if config_patches: 609 with config.patch(config_patches): --> 610 return compile_fx( 611 model_, 612 example_inputs_, 613 # need extra layer of patching as backwards is compiled out of scope 614 inner_compile=config.patch(config_patches)(inner_compile), 615 decompositions=decompositions, 616 ) 618 if config.cpp_wrapper: 619 with config.patch({"cpp_wrapper": False}): File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_inductor/compile_fx.py:720, in compile_fx(model_, example_inputs_, inner_compile, config_patches, decompositions) 716 decompositions = select_decomp_table() 717 # TODO: can add logging before/after the call to create_aot_dispatcher_function 718 # in torch._functorch/aot_autograd.py::aot_module_simplified::aot_function_simplified::new_func 719 # once torchdynamo is merged into pytorch --> 720 return aot_autograd( 721 fw_compiler=fw_compiler, 722 bw_compiler=bw_compiler, 723 inference_compiler=inference_compiler, 724 decompositions=decompositions, 725 partition_fn=partition_fn, 726 keep_inference_input_mutations=True, 727 )(model_, example_inputs_) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/backends/common.py:55, in aot_autograd.<locals>.compiler_fn(gm, example_inputs) 52 try: 53 # NB: NOT cloned! 54 with enable_aot_logging(), patch_config: ---> 55 cg = aot_module_simplified(gm, example_inputs, **kwargs) 56 counters["aot_autograd"]["ok"] += 1 57 return eval_frame.disable(cg) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_functorch/aot_autograd.py:3686, in aot_module_simplified(mod, args, fw_compiler, bw_compiler, partition_fn, decompositions, keep_inference_input_mutations, inference_compiler) 3669 break 3671 aot_config = AOTConfig( 3672 fw_compiler=fw_compiler, 3673 bw_compiler=bw_compiler, (...) 3683 no_tangents=False, 3684 ) -> 3686 compiled_fn = create_aot_dispatcher_function( 3687 functional_call, 3688 full_args, 3689 aot_config, 3690 ) 3692 # TODO: There is something deeply wrong here; compiled_fn running with 3693 # the boxed calling convention, but aot_module_simplified somehow 3694 # historically returned a function that was not the boxed calling 3695 # convention. This should get fixed... 3696 def forward(*runtime_args): File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_dynamo/utils.py:180, in dynamo_timed.<locals>.dynamo_timed_inner.<locals>.time_wrapper(*args, **kwargs) 178 with torch.profiler.record_function(f"{key} (dynamo_timed)"): 179 t0 = time.time() --> 180 r = func(*args, **kwargs) 181 time_spent = time.time() - t0 182 # print(f"Dynamo timer: key={key}, latency={latency:.2f} sec") File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_functorch/aot_autograd.py:3225, in create_aot_dispatcher_function(flat_fn, flat_args, aot_config) 3222 compiler_fn = partial(aot_wrapper_dedupe, compiler_fn=compiler_fn) 3223 # You can put more passes here -> 3225 compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata) 3226 if aot_config.is_export: 3227 # During export, we don't get back a callable - we get back the raw fx graph 3228 # (either a joint or an inference-only graph) 3229 assert isinstance(compiled_fn, torch.fx.GraphModule) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_functorch/aot_autograd.py:2090, in aot_wrapper_dedupe(flat_fn, flat_args, aot_config, compiler_fn, fw_metadata) 2087 break 2089 if ok: -> 2090 return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata) 2092 # export path: ban duplicate inputs for now, add later if requested. 2093 if aot_config.is_export: File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_functorch/aot_autograd.py:2270, in aot_wrapper_synthetic_base(flat_fn, flat_args, aot_config, fw_metadata, needs_autograd, compiler_fn) 2268 # Happy path: we don't need synthetic bases 2269 if synthetic_base_info is None: -> 2270 return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata) 2272 # export path: ban synthetic bases for now, add later if requested. 2273 if aot_config.is_export: File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_functorch/aot_autograd.py:2698, in aot_dispatch_autograd(flat_fn, flat_args, aot_config, fw_metadata) 2691 with track_graph_compiling(aot_config, "joint"): 2692 num_inner_fwd_outputs = ( 2693 fw_metadata.num_mutated_inputs 2694 + fw_metadata.num_outputs 2695 + fw_metadata.num_intermediate_bases 2696 + fw_metadata.num_outputs_rng_offset 2697 ) -> 2698 fw_module, bw_module = aot_config.partition_fn( 2699 fx_g, joint_inputs, num_fwd_outputs=num_inner_fwd_outputs 2700 ) 2701 fw_outs = [n for n in fw_module.graph.nodes if n.op == "output"][0].args[0] 2702 # we only need to bookkeep the symints that are saved for bw, not any symints 2703 # the user forward might have returned in its own output File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_inductor/compile_fx.py:691, in compile_fx.<locals>.partition_fn(graph, joint_inputs, **kwargs) 689 def partition_fn(graph, joint_inputs, **kwargs): 690 joint_graph_passes(graph) --> 691 return min_cut_rematerialization_partition( 692 graph, joint_inputs, **kwargs, compiler="inductor" 693 ) File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/torch/_functorch/partitioners.py:572, in min_cut_rematerialization_partition(joint_module, _joint_inputs, compiler, recomputable_ops, num_fwd_outputs) 569 nx_graph.add_edge(node.name + "_out", user.name + "_in", capacity=math.inf) 571 try: --> 572 cut_value, partition = nx.minimum_cut(nx_graph, "source", "sink") 573 except Exception: 574 print('Failed to compute min-cut on following graph:') File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/networkx/algorithms/flow/maxflow.py:450, in minimum_cut(flowG, _s, _t, capacity, flow_func, **kwargs) 447 if kwargs.get("cutoff") is not None and flow_func is preflow_push: 448 raise nx.NetworkXError("cutoff should not be specified.") --> 450 R = flow_func(flowG, _s, _t, capacity=capacity, value_only=True, **kwargs) 451 # Remove saturated edges from the residual network 452 cutset = [(u, v, d) for u, v, d in R.edges(data=True) if d["flow"] == d["capacity"]] File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/networkx/algorithms/flow/preflowpush.py:421, in preflow_push(G, s, t, capacity, residual, global_relabel_freq, value_only) 291 def preflow_push( 292 G, s, t, capacity="capacity", residual=None, global_relabel_freq=1, value_only=False 293 ): 294 r"""Find a maximum single-commodity flow using the highest-label 295 preflow-push algorithm. 296 (...) 419 420 """ --> 421 R = preflow_push_impl(G, s, t, capacity, residual, global_relabel_freq, value_only) 422 R.graph["algorithm"] = "preflow_push" 423 return R File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/networkx/algorithms/flow/preflowpush.py:41, in preflow_push_impl(G, s, t, capacity, residual, global_relabel_freq, value_only) 38 else: 39 R = residual ---> 41 detect_unboundedness(R, s, t) 43 R_nodes = R.nodes 44 R_pred = R.pred File ~/.pyenv/versions/3.9.13/envs/speech-synthesis/lib/python3.9/site-packages/networkx/algorithms/flow/utils.py:166, in detect_unboundedness(R, s, t) 164 if attr["capacity"] == inf and v not in seen: 165 if v == t: --> 166 raise nx.NetworkXUnbounded( 167 "Infinite capacity path, flow unbounded above." 168 ) 169 seen.add(v) 170 q.append(v) BackendCompilerFailed: backend='inductor' raised: NetworkXUnbounded: Infinite capacity path, flow unbounded above. You can suppress this exception and fall back to eager by setting: import torch._dynamo torch._dynamo.config.suppress_errors = True ### Minified repro ``` from math import inf import torch from torch import tensor, device import torch.fx as fx import torch._dynamo from torch._dynamo.testing import rand_strided from torch._dynamo.debug_utils import run_fwd_maybe_bwd import torch._dynamo.config import torch._inductor.config import torch._functorch.config torch._dynamo.config.dynamic_shapes = True from torch.nn import * class Repro(torch.nn.Module): def __init__(self): super().__init__() self.fn = TransformerEncoderLayer( (self_attn): MultiheadAttention( (out_proj): NonDynamicallyQuantizableLinear(in_features=256, out_features=256, bias=True) ) (linear1): Linear(in_features=256, out_features=1024, bias=True) (dropout): Dropout(p=0.1, inplace=False) (linear2): Linear(in_features=1024, out_features=256, bias=True) (norm1): LayerNorm((256,), eps=1e-05, elementwise_affine=True) (norm2): LayerNorm((256,), eps=1e-05, elementwise_affine=True) (dropout1): Dropout(p=0.1, inplace=False) (dropout2): Dropout(p=0.1, inplace=False) ).cuda() def forward(self, s0 : torch.SymInt, L_args_0_ : torch.Tensor, L_kwargs_src_key_padding_mask_ : torch.Tensor): l_args_0_ = L_args_0_ l_kwargs_src_key_padding_mask_ = L_kwargs_src_key_padding_mask_ fn = self.fn(l_args_0_, src_key_padding_mask = l_kwargs_src_key_padding_mask_); l_args_0_ = l_kwargs_src_key_padding_mask_ = None return (fn,) mod = Repro() def load_args(reader): reader.symint(4) # s0 buf0 = reader.storage('9f95f7c87f974d44cb26549585199e0822f2f95a', 40960, device=device(type='cuda', index=0)) reader.tensor(buf0, (10, 4, 256)) # L_args_0_ buf1 = reader.storage('b80de5d138758541c5f05265ad144ab9fa86d1db', 40, device=device(type='cuda', index=0), dtype_hint=torch.bool) reader.tensor(buf1, (10, 4), dtype=torch.bool) # L_kwargs_src_key_padding_mask_ load_args._version = 0 if __name__ == '__main__': from torch._dynamo.repro.after_dynamo import run_repro run_repro(mod, load_args, accuracy=False, command='minify', save_dir='/home/model/torch_compile_debug/run_2023_05_22_23_33_18_460611-pid_308743/minifier/checkpoints', autocast=False, backend=None) ``` ### Versions Collecting environment information... PyTorch version: 2.1.0.dev20230519+cu121 Is debug build: False CUDA used to build PyTorch: 12.1 ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.2 LTS (x86_64) GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 Clang version: Could not collect CMake version: version 3.26.0 Libc version: glibc-2.35 Python version: 3.9.13 (main, Sep 6 2022, 01:37:16) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090 Nvidia driver version: 530.30.02 cuDNN version: Could not collect 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: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Vendor ID: GenuineIntel Model name: 13th Gen Intel(R) Core(TM) i9-13900K CPU family: 6 Model: 183 Thread(s) per core: 2 Core(s) per socket: 24 Socket(s): 1 Stepping: 1 CPU max MHz: 5900,0000 CPU min MHz: 800,0000 BogoMIPS: 5990.40 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 tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx 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 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 896 KiB (24 instances) L1i cache: 1,3 MiB (24 instances) L2 cache: 32 MiB (12 instances) L3 cache: 36 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected 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; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] numpy==1.23.5 [pip3] pytorch-triton==2.1.0+7d1a95b046 [pip3] torch==2.1.0.dev20230519+cu121 [pip3] torch-position-embedding==0.8.0 [pip3] torchaudio==2.1.0.dev20230520+cu121 [pip3] triton==2.0.0 [conda] Could not collect cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
0
2,533
101,974
Request for adding support for `torch.rand_like`, `torch.randn_like`, `torch.randint_like` with `torch.Generator`
triaged, module: random
### πŸš€ The feature, motivation and pitch This issue proposes adding support for `torch.rand_like`, `torch.randn_like`, and `torch.randint_like` with the `torch.Generator` parameter in PyTorch. **Motivation** The motivation behind this proposal is to provide users with greater flexibility and control over random number generation when using these functions. Currently, the `torch.rand_like`, `torch.randn_like`, and `torch.randint_like` functions do not support the `torch.Generator` parameter, while their underlying functions, `torch.rand`, `torch.randn`, and `torch.randint`, already do. By adding support for the `torch.Generator` parameter to these functions, users can have consistent control over random number generation across different operations. **Pitch** I suggest updating the function signatures as follows: ```python def rand_like(input, *, generator=None, ...): ... def randn_like(input, *, generator=None, ...): ... def randint_like(input, low, high=None, *, generator=None, ...): ... ``` The `generator` parameter would allow users to pass a `torch.Generator` object, with `None` as the default value. This would enable users to customize the random number generation process according to their specific requirements. ### Alternatives _No response_ ### Additional context _No response_ cc @pbelevich
0
2,534
101,972
No pytorch_android 2.0.x builds
triaged, module: android, oncall: mobile
Hello, PyTorch 2.0.0 was released in March, but there is no official build for Android yet. I was wondering if there is any plan to support this platform in the near future. Thank you for your time and attention.
2
2,535
101,968
CrossEntropyLoss output difference on Windows vs. Linux
module: windows, triaged
### πŸ› Describe the bug When calling `torch.nn.CrossEntropyLoss(reduction="none")` on relatively simple inputs, the computed tensor differs slightly on Windows and Linux, respectively. A minimal example which exhibits this behavior can be seen below. ``` import torch target = torch.arange(10) predictions = torch.tensor([ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 6, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 7, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 8, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 9], ], dtype=torch.float32) print(torch.nn.CrossEntropyLoss(reduction="none")(predictions, target)) ``` On Windows, this program prints: ``` tensor([2.3026e+00, 1.4612e+00, 7.9661e-01, 3.7024e-01, 1.5258e-01, 5.8874e-02, 2.2064e-02, 8.1735e-03, 3.0145e-03, 1.1098e-03]) ``` Whereas on Linux, it prints: ``` tensor([2.3026e+00, 1.4612e+00, 7.9661e-01, 3.7024e-01, 1.5258e-01, 5.8874e-02, 2.2064e-02, 8.1734e-03, 3.0145e-03, 1.1099e-03]) ``` Only a few of the elements differ between the two operating systems, and only by a small margin. This behavior was observed on all tested version of PyTorch on both Windows and Linux, including 1.11.0, 1.13.1 and 2.0.0. All computations were performed on CPU. ### Versions Windows: ``` Collecting environment information... PyTorch version: 1.11.0+cpu Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: Microsoft Windows 11 Pro GCC version: Could not collect Clang version: Could not collect CMake version: Could not collect Libc version: N/A Python version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] (64-bit runtime) Python platform: Windows-10-10.0.22621-SP0 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=9 CurrentClockSpeed=2995 DeviceID=CPU0 Family=198 L2CacheSize=5120 L2CacheSpeed= Manufacturer=GenuineIntel MaxClockSpeed=2995 Name=11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz ProcessorType=3 Revision= Versions of relevant libraries: [pip3] torch==1.11.0 [conda] Could not collect ``` Linux: ``` Collecting environment information... PyTorch version: 1.11.0+cu102 Is debug build: False CUDA used to build PyTorch: 10.2 ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.2 LTS (x86_64) GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Clang version: Could not collect CMake version: version 3.22.1 Libc version: glibc-2.35 Python version: 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (64-bit runtime) Python platform: Linux-5.19.0-35-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1070 Ti Nvidia driver version: 520.61.05 cuDNN version: Could not collect 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: 43 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Vendor ID: AuthenticAMD Model name: AMD Ryzen Threadripper 2950X 16-Core Processor CPU family: 23 Model: 8 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 2 Frequency boost: enabled CPU max MHz: 3500,0000 CPU min MHz: 2200,0000 BogoMIPS: 6986.07 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 amd_dcm aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es Virtualization: AMD-V L1d cache: 512 KiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache: 8 MiB (16 instances) L3 cache: 32 MiB (4 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Mitigation; untrained return thunk; SMT vulnerable 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, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] numpy==1.21.5 [pip3] torch==1.11.0 [pip3] triton==2.0.0 [conda] Could not collect ``` cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht
1
2,536
101,967
scaled_dot_product_attention produces NaN when input has NaN in masked-out positions
triaged, module: NaNs and Infs, module: edge cases, module: multi-headed-attention
### πŸ› Describe the bug NaN values in the input to `torch.nn.functional.scaled_dot_product_attention` result in NaN output, even when input NaN elements are masked out. Expected behaviour: the output of SDPA doesn't depend on masked-out values. In the example below I first change one element of the input to `1e10` and confirm that the output doesn't change. Then I change the same input element to NaN and see that the output did change - to NaN ```python import torch # Create sample input B = 1 L = 2 D = 4 q = torch.arange(8, dtype=torch.float).reshape(B, L, D) k = torch.arange(8, dtype=torch.float).reshape(B, L, D) v = torch.arange(8, dtype=torch.float).reshape(B, L, D) # Use mask of shape (B, L, L) # Mask out second source element for both elements in target attn_mask = torch.tensor([[[True, False], [True, False]]]) res1 = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=attn_mask) # Change masked out element to a very large number - the result doesn't change k[0, 1, 0] = 1e10 res2 = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=attn_mask) # Result didn't change print(f"{res1 - res2 = }") # Change masked out element to NaN - the result becomes NaN k[0, 1, 0] = torch.nan res3 = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=attn_mask) # Result became NaN print(f"{res1 - res3 = }") ``` Output: ```Python res1 - res2 = tensor([[[0., 0., 0., 0.], [0., 0., 0., 0.]]]) res1 - res3 = tensor([[[nan, nan, nan, nan], [nan, nan, nan, nan]]]) ``` One scenario in which this comes up is when I use `torch.empty` to initialize a buffer for processing input of variable length. I can fill the beginning of the buffer with meaningful values and use the mask to tell SDPA to ignore the rest. However, this wouldn't work if masked-out elements of the buffer accidentally contain NaN, because of the described behaviour The reason might be ` nan + x -> nan` in https://github.com/pytorch/pytorch/blob/e9a7115605ee5b6ae38ea5716a4abea5aa415333/aten/src/ATen/native/transformers/attention.cpp#L680 or similar code for other backends. ### Versions PyTorch version: 2.1.0.dev20230520 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: macOS 13.3.1 (arm64) GCC version: Could not collect Clang version: Could not collect CMake version: version 3.24.3 Libc version: N/A Python version: 3.8.13 (default, Oct 19 2022, 17:52:09) [Clang 12.0.0 ] (64-bit runtime) Python platform: macOS-13.3.1-arm64-arm-64bit 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: Apple M1 Pro Versions of relevant libraries: [pip3] mypy-extensions==0.4.3 [pip3] numpy==1.23.4 [pip3] torch==2.1.0.dev20230520 [conda] numpy 1.23.4 pypi_0 pypi [conda] pytorch 2.1.0.dev20230520 py3.8_0 pytorch-nightly
2
2,537
101,962
SummaryWriter background thread holds the GIL for too long
oncall: distributed, module: tensorboard
### πŸ› Describe the bug When doing DDP training with multiple processes and using SummaryWriter to log training information, the training speed drops significantly on some machines due to the extra thread created by the SummaryWriter interfering with the main thread in each process. I don't have a small reproducer yet, but I encounter this behavior on multi-GPU systems. ### Versions Collecting environment information... PyTorch version: 1.13.0a0+08820cb Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: Ubuntu 20.04.4 LTS (x86_64) GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Clang version: Could not collect CMake version: version 3.23.2 Libc version: glibc-2.31 Python version: 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:10) [GCC 10.3.0] (64-bit runtime) Python platform: Linux-5.4.0-146-generic-x86_64-with-glibc2.10 Is CUDA available: True CUDA runtime version: 11.7.99 CUDA_MODULE_LOADING set to: GPU models and configuration: GPU 0: NVIDIA A100-SXM4-40GB GPU 1: NVIDIA A100-SXM4-40GB GPU 2: NVIDIA A100-SXM4-40GB GPU 3: NVIDIA A100-SXM4-40GB GPU 4: NVIDIA A100-SXM4-40GB GPU 5: NVIDIA A100-SXM4-40GB GPU 6: NVIDIA A100-SXM4-40GB GPU 7: NVIDIA A100-SXM4-40GB Nvidia driver version: 525.105.17 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.4.1 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.4.1 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.4.1 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.4.1 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.4.1 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.4.1 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.4.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 Byte Order: Little Endian Address sizes: 43 bits physical, 48 bits virtual CPU(s): 256 On-line CPU(s) list: 0-255 Thread(s) per core: 2 Core(s) per socket: 64 Socket(s): 2 NUMA node(s): 8 Vendor ID: AuthenticAMD CPU family: 23 Model: 49 Model name: AMD EPYC 7742 64-Core Processor Stepping: 0 Frequency boost: enabled CPU MHz: 3317.628 CPU max MHz: 2250.0000 CPU min MHz: 1500.0000 BogoMIPS: 4491.45 Virtualization: AMD-V L1d cache: 4 MiB L1i cache: 4 MiB L2 cache: 64 MiB L3 cache: 512 MiB NUMA node0 CPU(s): 0-15,128-143 NUMA node1 CPU(s): 16-31,144-159 NUMA node2 CPU(s): 32-47,160-175 NUMA node3 CPU(s): 48-63,176-191 NUMA node4 CPU(s): 64-79,192-207 NUMA node5 CPU(s): 80-95,208-223 NUMA node6 CPU(s): 96-111,224-239 NUMA node7 CPU(s): 112-127,240-255 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Vulnerable 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: Vulnerable, IBPB: disabled, STIBP: disabled, PBRSB-eIBRS: Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected 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 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 sme ssbd mba sev ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 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 clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca Versions of relevant libraries: [pip3] numpy==1.22.4 [pip3] pytorch-lightning==1.7.4 [pip3] pytorch-quantization==2.1.2 [pip3] torch==1.13.0a0+08820cb [pip3] torch-tensorrt==1.2.0a0 [pip3] torchmetrics==0.10.2 [pip3] torchtext==0.13.0a0 [pip3] torchvision==0.14.0a0 [conda] mkl 2020.4 h726a3e6_304 conda-forge [conda] mkl-include 2020.4 h726a3e6_304 conda-forge [conda] numpy 1.22.4 py38h99721a1_0 conda-forge [conda] pytorch-lightning 1.7.4 pypi_0 pypi [conda] pytorch-quantization 2.1.2 pypi_0 pypi [conda] torch 1.13.0a0+08820cb pypi_0 pypi [conda] torch-tensorrt 1.2.0a0 pypi_0 pypi [conda] torchmetrics 0.10.2 pypi_0 pypi [conda] torchtext 0.13.0a0 pypi_0 pypi [conda] torchvision 0.14.0a0 pypi_0 pypi cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
0
2,538
101,950
torch.flip is inplaced too aggressively in torch inductor
triaged, oncall: pt2, module: inductor
### πŸ› Describe the bug The operation `a.copy_(torch.flip(a, (0,)))` for `a` a 1D vector generates the following incorrect code ```python @pointwise(size_hints=[1048576], filename=__file__, meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': ['in_ptr0', 'out_ptr1'], 'configs': [instan ce_descriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]}) @triton.jit def triton_(in_ptr0, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): xnumel = 1048576 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x0 = xindex tmp0 = tl.load(in_ptr0 + (1048575 + ((-1)*x0)), None) tl.store(out_ptr0 + (tl.broadcast_to(x0, [XBLOCK])), tmp0, None) tl.store(out_ptr1 + (tl.broadcast_to(x0, [XBLOCK])), tmp0, None) import triton import triton.language as tl from torch._inductor.triton_heuristics import grid, start_graph, end_graph from torch._C import _cuda_getCurrentRawStream as get_cuda_stream async_compile.wait(globals()) del async_compile def call(args): arg0_1, = args args.clear() with torch.cuda._DeviceGuard(0): torch.cuda.set_device(0) # no-op to ensure context buf0 = empty_strided((1048576, ), (1, ), device='cuda', dtype=torch.float32) stream0 = get_cuda_stream(0) triton_poi_fused_copy_flip_0.run(arg0_1, buf0, arg0_1, 1048576, grid=grid(1048576), stream=stream0) del arg0_1 return (buf0, ) ``` This code has two issues: - It is clearly incorrect given aliasing of `in_ptr0` and `out_ptr1` - If it were correct, it's still using an extra buffer that it doesn't return Even more, one could argue that: - If the stride iteration allowed for it, the input should be marked as an `in_out_ptr This last issue is happening because we have two ways of dealing with mutated args. One, at an IR affecting the read-writes level which happens in `Scheduler.compute_dependencies`, and another one that happens at `BaseSchedulerNode.allocate`. The first one does not create an `in_out_ptr`, but simply annotates the mutations in the `mutated_arg_names`. It's not clear to me why wouldn't both of them create `in_out_ptr`s. Perhaps this is an oversight. The easiest fix for this would be to perform the operation out-of-place when the index has negative strides. A better fix (that we'd need to benchmark) would be to perform two loads and two stores per thread, iterating just over half of the dimension that needs to be flipped. Found when looking at https://github.com/pytorch/pytorch/issues/101930 ### Versions master cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10
4
2,539
101,936
mps device bug - a weird inconsistency on tensor indexing operations
triaged, module: mps
### πŸ› Describe the bug With a mps device, there is a weird inconsistency on tensor indexing operations, maybe depending on different python/pytorch combinations. See the example below where I regenerated the issue. ``` >> Testing environment Python 3.8.16 Pytorch 2.0.1 >> Machine info Apple M1 Max OSX 13.4 (22F66) ``` ``` >>> a = torch.tensor([31843, 16644, 31844, 629, 1382, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], device='mps:0', dtype=torch.int32) >>> b = torch.tensor([1568], device='mps:0') >>> a[10] = b # See the weird behavior below, it put 1568 into 0'th element instead of the 10th element. >>> a = torch.tensor([1568, 16644, 31844, 629, 1382, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], device='mps:0', dtype=torch.int32) >>> a[10] = b.item() # However, b.item() behaves normally as expected >>> a = torch.tensor([1568, 16644, 31844, 629, 1382, 322, 0, 0, 0, 0, 1568, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], device='mps:0', dtype=torch.int32) ``` ### Versions PyTorch version: 2.0.1 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: macOS 13.4 (arm64) GCC version: Could not collect Clang version: 14.0.0 (clang-1400.0.29.202) CMake version: version 3.14.3 Libc version: N/A Python version: 3.8.16 (default, Mar 1 2023, 21:18:45) [Clang 14.0.6 ] (64-bit runtime) Python platform: macOS-13.4-arm64-arm-64bit 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: Apple M1 Max Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] pytorch-lightning==2.0.2 [pip3] torch==2.0.1 [pip3] torchmetrics==0.11.4 [conda] numpy 1.24.3 pypi_0 pypi [conda] pytorch-lightning 2.0.2 pypi_0 pypi [conda] torch 2.0.1 pypi_0 pypi [conda] torchmetrics 0.11.4 pypi_0 pypi cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
2
2,540
101,934
Parameter gradient is not moved parameter is moved across devices
module: docs, module: nn, triaged, actionable, module: correctness (silent)
### πŸ› Describe the bug TL;DR: if you initialize a parameter, which then becomes part of a registered buffer (e.g. by concatenation), the parameter correctly moves to the device the model is assigned to, but its gradient doesn't. The following minimal snippet below should reproduce: ```python import torch from torch import nn class LayerWithConcatInConstructor(nn.Module): def __init__(self, previous_weights: torch.Tensor): super().__init__() self.new_weights = nn.parameter.Parameter(torch.randn(1, previous_weights.shape[-1], dtype=previous_weights.dtype)) self.register_buffer('full_weights', torch.cat([previous_weights, self.new_weights], dim=0)) def forward(self, x): return self.full_weights @ x class LayerWithConcatInForwardPass(nn.Module): def __init__(self, previous_weights: torch.Tensor): super().__init__() self.register_buffer('previous_weights', previous_weights) self.new_weights = nn.parameter.Parameter(torch.randn(1, previous_weights.shape[-1], dtype=previous_weights.dtype)) def forward(self, x): return torch.cat([self.previous_weights, self.new_weights], dim=0) @ x # type: ignore # Initialize the two layers prev_weights = torch.randn(1, 10) x = torch.randn(10) concat_in_constructor = LayerWithConcatInConstructor(prev_weights.clone().detach()) concat_in_forward = LayerWithConcatInForwardPass(prev_weights.clone().detach()) device = 'cuda:0' # The version with the concatenation in the forward pass works just fine: model = concat_in_forward.to(device) optim = torch.optim.SGD(model.parameters(), lr=0.1) optim.zero_grad(set_to_none=True) l = model(x.to(device)).sum() l.backward() optim.step() # The version with the concatenation in the constructor throws an error in the optimizer step because the parameter's gradient is on the CPU: model = concat_in_constructor.to(device) optim = torch.optim.SGD(model.parameters(), lr=0.1) optim.zero_grad(set_to_none=True) l = model(x.to(device)).sum() l.backward() optim.step() # This will throw a RuntimeError ``` ### Versions PyTorch version: 1.12.1 Is debug build: False CUDA used to build PyTorch: 11.3 ROCM used to build PyTorch: N/A OS: CentOS Linux release 7.9.2009 (Core) (x86_64) GCC version: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44) Clang version: 3.4.2 (tags/RELEASE_34/dot2-final) CMake version: version 2.8.12.2 Libc version: glibc-2.17 Python version: 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:26:04) [GCC 10.4.0] (64-bit runtime) Python platform: Linux-3.10.0-1160.81.1.el7.x86_64-x86_64-with-glibc2.17 Is CUDA available: True CUDA runtime version: 11.4.120 CUDA_MODULE_LOADING set to: GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti Nvidia driver version: 470.161.03 cuDNN version: Could not collect 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): 44 On-line CPU(s) list: 0-43 Thread(s) per core: 1 Core(s) per socket: 22 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Gold 6152 CPU @ 2.10GHz Stepping: 4 CPU MHz: 1000.012 CPU max MHz: 3700.0000 CPU min MHz: 1000.0000 BogoMIPS: 4200.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 1024K L3 cache: 30976K NUMA node0 CPU(s): 0-21 NUMA node1 CPU(s): 22-43 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 aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single ssbd mba rsb_ctxsw ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities Versions of relevant libraries: [pip3] numpy==1.24.1 [pip3] pytorch-lightning==2.0.2 [pip3] torch==1.12.1 [pip3] torchaudio==0.12.1 [pip3] torchmetrics==0.11.4 [pip3] torchvision==0.14.1 [conda] blas 1.0 mkl [conda] cudatoolkit 11.3.1 h9edb442_11 conda-forge [conda] ffmpeg 4.3 hf484d3e_0 pytorch [conda] mkl 2021.4.0 h06a4308_640 [conda] mkl-service 2.4.0 py310ha2c4b55_0 conda-forge [conda] mkl_fft 1.3.1 py310h2b4bcf5_1 conda-forge [conda] mkl_random 1.2.2 py310h00e6091_0 [conda] numpy 1.24.1 pypi_0 pypi [conda] numpy-base 1.23.5 py310h8e6c178_0 [conda] pytorch 1.12.1 py3.10_cuda11.3_cudnn8.3.2_0 pytorch [conda] pytorch-lightning 2.0.2 pypi_0 pypi [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchaudio 0.12.1 py310_cu113 pytorch [conda] torchmetrics 0.11.4 pypi_0 pypi [conda] torchvision 0.14.1 pypi_0 pypi cc @svekars @carljparker @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki @ezyang @gchanan @zou3519
8
2,541
101,930
[feature request] [minor] Inplace torch.flip_
triaged, enhancement, module: python frontend
### πŸš€ The feature, motivation and pitch Some usecases: littleendian<>bigendian byte-swaps for various dtypes, BGR<>RGB There currently is a specialized flip version in byteswap context, discussed in https://github.com/pytorch/pytorch/pull/101925#issuecomment-1555883474, but it could be useful in other contexts too if integrated into torch.flip_. Also, in that issue is linked a nice article on vectorized array reversal which is useful for torch.flip over the inner-most dim on CPU: https://dev.to/wunk/fast-array-reversal-with-simd-j3p https://github.com/Wunkolo/qreverse Seems mostly useful for very small inner-dim sizes: 2-8, but might also be useful for time series, if need to use some time-reversed representations Another useful thing could be more general value shuffle (including inplace): along a dim, given a permutation (I think this shuffle op exists in SSE/AVX). Is it currently implemented by `index_select`? If so, an inplace version might be nice to have as well ### Alternatives _No response_ ### Additional context _No response_ cc @albanD
5
2,542
101,929
can not find tensorrt
triaged, oncall: pt2
### πŸ› Describe the bug I have tried below code. torch.compile(m, backend="tensorrt") but can not found tensorrt in PyTorch 2.0.1 ### Error logs _No response_ ### Minified repro _No response_ ### Versions 2.0.1 cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
1
2,543
101,918
[compile] Tracker for `torchrec_dlrm` issues
triaged, module: custom-operators, module: functionalization, oncall: pt2
First issue ~~~ import torch from dataclasses import dataclass, field from typing import Any @dataclass class DClass(): sharding_contexts: Any = field(default_factory=list) a: int = 1 def fn(x): return DClass().a * x opt_fn = torch.compile(fn) x = torch.randn(4) opt_fn(x) ~~~ ----------------- Second issue ~~~ from math import inf import torch from torch import tensor, device import torch.fx as fx import torch._dynamo from torch._dynamo.testing import rand_strided from torch._dynamo.debug_utils import run_fwd_maybe_bwd import torch._dynamo.config import torch._inductor.config import torch._functorch.config import fbgemm_gpu torch._inductor.config.fallback_random = True from torch.nn import * class Repro(torch.nn.Module): def __init__(self): super().__init__() def forward(self, L_L_indices_ : torch.Tensor, L_L_offsets_ : torch.Tensor, L_L_self_rows_per_table_ : torch.Tensor, L_L_self_bounds_check_warning_ : torch.Tensor): l_l_indices_ = L_L_indices_ l_l_offsets_ = L_L_offsets_ l_l_self_rows_per_table_ = L_L_self_rows_per_table_ l_l_self_bounds_check_warning_ = L_L_self_bounds_check_warning_ long = l_l_indices_.long(); l_l_indices_ = None long_1 = l_l_offsets_.long(); l_l_offsets_ = None bounds_check_indices = torch.ops.fbgemm.bounds_check_indices(l_l_self_rows_per_table_, long, long_1, 1, l_l_self_bounds_check_warning_, None); l_l_self_rows_per_table_ = long = l_l_self_bounds_check_warning_ = None return [long_1] mod = Repro() def load_args(reader): buf0 = reader.storage('b34ae4d796654d6804a16e92852d0395c29d3ea7', 832, device=device(type='cuda', index=0), dtype_hint=torch.int64) reader.tensor(buf0, (104,), dtype=torch.int64) # L_L_indices_ buf1 = reader.storage('0aca75493e9fed822d70e8524e19324441bfaa4d', 840, device=device(type='cuda', index=0), dtype_hint=torch.int64) reader.tensor(buf1, (105,), dtype=torch.int64) # L_L_offsets_ buf2 = reader.storage('d0cca63d71b4e5a07f9cb3f2fbd5e3aa1c5e4c35', 208, device=device(type='cuda', index=0), dtype_hint=torch.int64) reader.tensor(buf2, (26,), dtype=torch.int64) # L_L_self_rows_per_table_ buf3 = reader.storage('05fe405753166f125559e7c9ac558654f107c7e9', 8, device=device(type='cuda', index=0), dtype_hint=torch.int64) reader.tensor(buf3, (1,), dtype=torch.int64) # L_L_self_bounds_check_warning_ load_args._version = 0 if __name__ == '__main__': from torch._dynamo.repro.after_dynamo import run_repro run_repro(mod, load_args, accuracy=False, command='run', save_dir='/scratch/anijain/work/gcc-10/pytorch/checkpoints', autocast=False, backend='aot_eager') ~~~ ~~~ RuntimeError: Found a custom (non-ATen) operator that either mutates or its inputs: fbgemm::bounds_check_indices.. Getting these operators to work with functionalization requires some extra work. For mutable ops you need to register a corresponding out-of-place variant of the op, and you also need to register a Functionalization kernel that performs some boilerplate, telling functionalization to map from the mutable op to the out-of-place op. See a more complete example of how to do this at https://gist.github.com/bdhirsh/7dadbf6296f8f7d1abcf4c482f438aaa. Please file a GitHub issue if you run into any problems. ~~~ ----------- Third-issue - Bad Fx Graph Repro - `TORCHDYNAMO_DEBUG_FUNCTION="invoke" TORCH_LOGS="+dynamo" python benchmarks/dynamo/torchbench.py --backend=aot_eager --float32 --inference --device cuda --accuracy --only torchrec_dlrm` The `TORCHDYNAMO_DEBUG_FUNCTION` flag calls Dynamo only on the relevant function. --------- cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh
10
2,544
101,890
Can't reproduce/non-deterministic results with CUDA
module: cuda, triaged, module: determinism
### πŸ› Describe the bug Hi! I'm trying to reproduce results with a minimal text classifier using suggestions from [PyTorch β€” Randomness](https://pytorch.org/docs/stable/notes/randomness.html), but I still get different final weights with each launch. Could you please have a look at it? My environment is Python 3.9, torch 2.0.1 with CUDA 18.1 ([this one]( https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp39-cp39-linux_x86_64.whl)), Ubuntu 18.04 (x64, WSL), RTX 2080 Ti. I also set `CUBLAS_WORKSPACE_CONFIG=":4096:8"`. ``` import torch torch.use_deterministic_algorithms(True) torch.backends.cudnn.benchmark = False import random from torch import nn from torch.nn import functional as F import numpy as np from sklearn.utils import gen_batches VOCAB_SIZE = 50000 NUM_CLASSES = 20 NUM_SAMPLES = 1000 DEFAULT_LEN = 64 class CNN(nn.Module): def __init__( self, dim=300, dropout_keep_p=0.9, lr=1e-3, n_filt=64, filt_sizes=[1, 1, 2, 2], ): super().__init__() self.lr = lr self.embedding = nn.Embedding(VOCAB_SIZE, dim, padding_idx=0, max_norm=5.0) self.convs = nn.ModuleList( [ nn.Conv2d( in_channels=1, out_channels=n_filt, kernel_size=(fs, dim), ) for fs in filt_sizes ] ) self.dropout = nn.Dropout(1 - dropout_keep_p) self.fc = nn.Linear(len(filt_sizes) * n_filt, NUM_CLASSES) self.init_weights() def init_weights(self): self.embedding.weight.data.uniform_(-0.5, 0.5) for conv in self.convs: conv.weight.data.uniform_(-0.5, 0.5) self.fc.weight.data.uniform_(-0.5, 0.5) self.fc.bias.data.zero_() def forward(self, input): embedded = self.embedding(input) embedded = embedded.unsqueeze(1) conv_output = [F.silu(conv(embedded)).squeeze(-1) for conv in self.convs] pooled = [F.max_pool1d(conv, conv.shape[2]).squeeze(-1) for conv in conv_output] cat = self.dropout(torch.cat(pooled, dim=1)) logits = self.fc(cat) return logits if __name__ == "__main__": seed = 0 random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) criterion = nn.CrossEntropyLoss(reduction="none") model = CNN() model.to("cuda") optimizer = torch.optim.Adam( model.parameters(), lr=float(model.lr) ) def train(sample_batches, label_batches): for sample_batch, label_batch in zip(sample_batches, label_batches): sample_batch = sample_batch.to("cuda") label_batch = label_batch.to("cuda") optimizer.zero_grad() output = model(sample_batch) loss = criterion(output, label_batch) loss = loss.mean() loss.backward() optimizer.step() gen = np.random.default_rng(seed=0) samples = [ gen.integers(low=0, high=VOCAB_SIZE, size=DEFAULT_LEN) for _ in range(NUM_SAMPLES) ] labels = [gen.integers(low=0, high=NUM_CLASSES) for i in range(NUM_SAMPLES)] print( "init checksum", torch.sum([p.data for n, p in model.named_parameters()][0]).item(), ) slices = list(gen_batches(n=len(samples), batch_size=64, min_batch_size=64)) sample_batches = [torch.as_tensor(samples[slice]) for slice in slices] label_batches = [torch.as_tensor(labels[slice]) for slice in slices] model.train() for i in range(10): train(sample_batches, label_batches) print( "train checksum", torch.sum([p.data for n, p in model.named_parameters()][0]).item(), ) ``` ### Versions ``` PyTorch version: 2.0.1+cu118 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Ubuntu 18.04.6 LTS (x86_64) GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Clang version: Could not collect CMake version: version 3.26.3 Libc version: glibc-2.27 Python version: 3.9.16 (main, Mar 8 2023, 14:00:05) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.27 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti Nvidia driver version: 531.41 cuDNN version: Could not collect 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): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 158 Model name: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz Stepping: 9 CPU MHz: 2998.313 BogoMIPS: 5996.62 Hypervisor vendor: Microsoft Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K 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 cpuid pni pclmulqdq ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves md_clear flush_l1d arch_capabilities Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.1+cu118 [pip3] triton==2.0.0 [conda] numpy 1.24.3 pypi_0 pypi [conda] torch 2.0.1+cu118 pypi_0 pypi [conda] triton 2.0.0 pypi_0 pypi ``` cc @ngimel @mruberry @kurtamohler
3
2,545
101,880
Crash on Python // PyArrow //
needs reproduction, triaged
### πŸ› Describe the bug The program crashes on the launching. More about: [https://gist.github.com/mironkraft/165697b6783f79fb47f8efe703572c41.js](url) <script src="https://gist.github.com/mironkraft/165697b6783f79fb47f8efe703572c41.js"></script> https://github.com/oobabooga/text-generation-webui/issues/2163 ``` (gdb) info registers rax 0x7fffe62135d8 140737054324184 rbx 0x7fffffff02c0 140737488290496 rcx 0xfa7d48 16416072 rdx 0xe6f298 15135384 rsi 0x7fffe62135c0 140737054324160 rdi 0x7fffffff02b8 140737488290488 rbp 0x7fffffff02c8 0x7fffffff02c8 rsp 0x7fffffff0280 0x7fffffff0280 r8 0xfc 252 r9 0x7fffe6205e98 140737054269080 r10 0x0 0 r11 0x7fffe6212760 140737054320480 r12 0x7fffffff02d0 140737488290512 r13 0x7fffffff02b6 140737488290486 r14 0x7fffffff02b7 140737488290487 r15 0x7fffffff02f0 140737488290544 rip 0x7fffe697f278 0x7fffe697f278 <__static_initialization_and_destruction_0(int, int) [clone .constprop.0]+296> eflags 0x10202 [ IF RF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 ``` ### Versions ``` mmikel@mironrkaft-vmware:~/Desarrollos/text-generation-webui$ cd vmmikel@mironrkaft-vmware:~$ wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py --2023-05-19 18:52:05-- https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ... Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[185.199.109.133]:443... conectado. PeticiΓ³n HTTP enviada, esperando respuesta... 200 OK Longitud: 21550 (21K) [text/plain] Guardando como: β€˜collect_env.py’ collect_env.py 100%[==============================================>] 21,04K --.-KB/s en 0,001s 2023-05-19 18:52:06 (22,2 MB/s) - β€˜collect_env.py’ guardado [21550/21550] vmmikel@mironrkaft-vmware:~$ python collect_env.py Orden Β«pythonΒ» no encontrada. QuizΓ‘ quiso decir: la orden Β«python3Β» del paquete deb Β«python3Β» la orden Β«pythonΒ» del paquete deb Β«python-is-python3Β» vmmikel@mironrkaft-vmware:~$ python3 collect_env.py Collecting environment information... PyTorch version: 2.0.1+cu117 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: Ubuntu 23.04 (x86_64) GCC version: (Ubuntu 12.2.0-17ubuntu1) 12.2.0 Clang version: Could not collect CMake version: version 3.26.3 Libc version: glibc-2.37 Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (64-bit runtime) Python platform: Linux-6.2.0-20-generic-x86_64-with-glibc2.37 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: Arquitectura: x86_64 modo(s) de operaciΓ³n de las CPUs: 32-bit, 64-bit Address sizes: 40 bits physical, 48 bits virtual Orden de los bytes: Little Endian CPU(s): 4 Lista de la(s) CPU(s) en lΓ­nea: 0-3 ID de fabricante: AuthenticAMD Nombre del modelo: AMD A6-3620 APU with Radeon(tm) HD Graphics Familia de CPU: 18 Modelo: 1 Hilo(s) de procesamiento por nΓΊcleo: 1 NΓΊcleo(s) por Β«socketΒ»: 1 Β«Socket(s)Β» 4 RevisiΓ³n: 0 BogoMIPS: 4392,01 Indicadores: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid tsc_known_freq pni cx16 popcnt hypervisor lahf_lm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw vmmcall arat Fabricante del hipervisor: VMware Tipo de virtualizaciΓ³n: lleno CachΓ© L1d: 256 KiB (4 instances) CachΓ© L1i: 256 KiB (4 instances) CachΓ© L2: 4 MiB (4 instances) Modo(s) NUMA: 1 CPU(s) del nodo NUMA 0: 0-3 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec store bypass: Not affected Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.1 [pip3] torchaudio==2.0.2 [pip3] torchvision==0.15.2 [pip3] triton==2.0.0 [conda] blas 1.0 mkl [conda] mkl 2023.1.0 h6d00ec8_46342 [conda] mkl-service 2.4.0 py310h5eee18b_1 [conda] mkl_fft 1.3.6 py310h1128e8f_1 [conda] mkl_random 1.2.2 py310h1128e8f_1 [conda] numpy 1.24.3 py310h5f9d8c6_1 [conda] numpy-base 1.24.3 py310hb5e798b_1 vmmikel@mironrkaft-vmware:~$ ``` ```
2
2,546
101,878
torch.quantile on MPS doesn't sort values when dim is not None
high priority, triaged, module: correctness (silent), module: mps
### πŸ› Describe the bug MPS implementation of `torch.quantile` doesn't sort the input when there's the `dim` argument is not `None`, giving nonsense results. ``` import torch device = torch.device("mps") A = torch.randn(1000, 10) #need to use "nearest", "lower", or "higher" interpolation methods #"linear" and "midpoint" fail due to operator `aten::lerp.Tensor_out` not being implemented for MPS #when dim=None, CPU and MPS give same result torch.quantile(A, .5, interpolation = "nearest") torch.quantile(A.to(device), .5, interpolation = "nearest") #when dim is not None, MPS gives nonsense result torch.quantile(A, .5, 0, interpolation = "nearest") torch.quantile(A.to(device), .5, 0, interpolation = "nearest") #MPS output is same as middle row of tensor #so torch.quantile must just be pulling 500th index without sorting first A[500] #inelegant workaround is to sort the tensor before calling quantile torch.quantile(torch.sort(A.to(device), dim = 0).values, .5, 0, interpolation = "nearest") ``` ### Versions PyTorch version: 2.0.1 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: macOS 13.3.1 (x86_64) GCC version: Could not collect Clang version: 14.0.6 CMake version: version 3.22.1 Libc version: N/A Python version: 3.11.3 (main, Apr 19 2023, 18:51:09) [Clang 14.0.6 ] (64-bit runtime) Python platform: macOS-10.16-x86_64-i386-64bit 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: Apple M2 Pro Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.1 [pip3] torchmetrics==0.11.4 [conda] nomkl 3.0 0 [conda] numpy 1.24.3 py311hd0e4f0d_0 [conda] numpy-base 1.24.3 py311h947b413_0 [conda] torch 2.0.1 pypi_0 pypi [conda] torchmetrics 0.11.4 pypi_0 pypi cc @ezyang @gchanan @zou3519 @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
12
2,547
101,871
Can group convolution support other grouping methods?
module: convolution, triaged
### πŸš€ The feature, motivation and pitch I'm using group convolution, but I want to use a new grouping method. For example, I have a tensor called "a" with shape `[b, 256*3, h, w]`. I want to group `a[:, 0, :, :], a[:, 256, :, :], a[:, 256*2, :, :]` into one group, and `a[:, 1, :, :], a[:, 1+256, :, :], a[:, 1+256*2, :, :]` into another group, and so on, ultimately dividing it into 256 groups where each group is a tensor of shape `[b, 3, h, w]`. Then I want to perform group convolution with the number of groups set to 256. In other words, the grouping stride becomes 256. How can I achieve this? Can the nn.conv2D function handle this? By the way, group convolution seems to be slower than regular convolution, which is contrary to theory. Is this due to optimization issues or is my torch version too low? ### Alternatives _No response_ ### Additional context _No response_
0
2,548
101,866
torch.compile makes transformers model (llama) generating different outputs compared with the native
triaged, oncall: pt2, module: cpu inductor
### πŸ› Describe the bug To run bf16 model generating, we found there are difference output sentence after using torch.compile compared with native: Native: Once upon a time, there existed a little girl who liked to have adventures. She wanted to go to places and meet new people, and have fun along the way. One day, the little girl decided to go on an adventure. She packed **up her backpack and set out on her journey.** torch.compile: Once upon a time, there existed a little girl who liked to have adventures. She wanted to go to places and meet new people, and have fun along the way. One day, the little girl decided to go on an adventure. She packed **her backpack and set out on her journey. She** Native code: ``` from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM, LlamaTokenizer import torch model = LlamaForCausalLM.from_pretrained("decapoda-research/llama-7b-hf", low_cpu_mem_usage=True, torch_dtype=torch.bfloat16) tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf") model = model.eval() prompt = "Once upon a time, there existed a little girl who liked to have adventures. She wanted to go to places and meet new people, and have fun" num_iter = 3 with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16): for i in range(num_iter): input_ids = tokenizer(prompt, return_tensors="pt").input_ids output = model.generate(input_ids, max_new_tokens=32, do_sample=False, temperature=0.9, num_beams=4) gen_text = tokenizer.batch_decode(output, skip_special_tokens=True) print(gen_text, flush=True) ``` torch.compile code: ``` from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM, LlamaTokenizer import torch model = LlamaForCausalLM.from_pretrained("decapoda-research/llama-7b-hf", low_cpu_mem_usage=True, torch_dtype=torch.bfloat16) tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf") model = model.eval() prompt = "Once upon a time, there existed a little girl who liked to have adventures. She wanted to go to places and meet new people, and have fun" import torch._inductor.config as config config.cpp.enable_kernel_profile=True config.profiler_mark_wrapper_call=True torch._dynamo.config.suppress_errors = True model.generate = torch.compile(model.generate, backend='inductor', dynamic=True) num_iter = 3 with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16): for i in range(num_iter): input_ids = tokenizer(prompt, return_tensors="pt").input_ids output = model.generate(input_ids, max_new_tokens=32, do_sample=False, temperature=0.9, num_beams=4) gen_text = tokenizer.batch_decode(output, skip_special_tokens=True) print(gen_text, flush=True) ``` ### Versions Collecting environment information... PyTorch version: 2.1.0.dev20230518+cpu Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: CentOS Stream 8 (x86_64) GCC version: (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) Clang version: 14.0.0 (Red Hat 14.0.0-1.module_el8.7.0+1142+5343df54) CMake version: version 3.22.1 Libc version: glibc-2.28 Python version: 3.8.16 (default, Mar 2 2023, 03:21:46) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-4.18.0-365.el8.x86_64-x86_64-with-glibc2.17 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 Versions of relevant libraries: transformers==4.28.1 [pip3] numpy==1.24.3 [pip3] torch==2.1.0.dev20230518+cpu [conda] blas 1.0 mkl [conda] mkl 2023.1.0 h6d00ec8_46342 [conda] mkl-include 2023.1.0 pypi_0 pypi [conda] mkl-service 2.4.0 py38h5eee18b_1 [conda] mkl-static 2023.1.0 pypi_0 pypi [conda] mkl_fft 1.3.6 py38h417a72b_1 [conda] mkl_random 1.2.2 py38h417a72b_1 [conda] numpy 1.24.3 py38hf6e8229_1 [conda] numpy-base 1.24.3 py38h060ed82_1 [conda] torch 2.1.0.dev20230518+cpu pypi_0 pypi cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
7
2,549
101,864
Error, attribute exists on the Python module, but we failed to convert Python type: 'list' to a TorchScript type
oncall: jit, module: onnx
### πŸ› Describe the bug When I use **detectron2** TorchScript to export onnx, the code use python list, will report error, This attribute exists on the Python module, but we failed to convert Python type: 'list' to a TorchScript type ``` RuntimeError: Module 'ResNet' has no attribute 'stages_and_names' (This attribute exists on the Python module, but we failed to convert Python type: 'list' to a TorchScript type.): File "/usr/local/lib/python3.7/dist-packages/detectron2/modeling/backbone/resnet.py", line 435 if "stem" in self._out_features: outputs["stem"] = x for stage, name in self.stages_and_names: ~~~~~~~~~~~~~~~~~~~~~ <--- HERE x = stage(x) if name in self._out_features: ``` https://github.com/facebookresearch/detectron2/issues/2734 has the same error, it suggest to use torch1.8, but not work for me. How to slove it ? Thanks ### Versions ``` torch 1.10.2+cu113 detectron2 0.6 ``` cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel
0
2,550
101,861
Observing negative number in PyTorch profiling
triaged, oncall: profiler
### πŸ› Describe the bug We found there are negative numbers in PyTorch profilings, which is inconvenient for users to get solid profiling for operators: ```python from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM, LlamaTokenizer import torch model = LlamaForCausalLM.from_pretrained("decapoda-research/llama-7b-hf", low_cpu_mem_usage=True, torch_dtype=torch.bfloat16) tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf") model = model.eval() prompt = "Once upon a time, there existed a little girl who liked to have adventures. She wanted to go to places and meet new people, and have fun" input_size = tokenizer(prompt, return_tensors="pt").input_ids.size(dim=1) num_iter = 3 num_warmup = 2 def trace_handler(prof): print(prof.key_averages().table( sort_by="self_cpu_time_total", row_limit=-1)) with torch.profiler.profile( activities=[ torch.profiler.ProfilerActivity.CPU], schedule=torch.profiler.schedule( wait=1, warmup=1, active=1), on_trace_ready=trace_handler ) as prof: with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16): for i in range(num_iter): input_ids = tokenizer(prompt, return_tensors="pt").input_ids output = model.generate(input_ids, max_new_tokens=32, do_sample=False, temperature=0.9, num_beams=4) gen_text = tokenizer.batch_decode(output, skip_special_tokens=True) print(gen_text, flush=True) prof.step() ``` Name Self CPU % Self CPU CPU total % CPU total CPU time avg # of Calls aten::mm 72.77% 2.775s 72.77% 2.775s 385.375us 7200 aten::linear 14.62% 557.318ms 96.82% 3.692s 383.617us 9624 aten::index_select 2.71% 103.334ms 2.73% 103.926ms 49.916us 2082 aten::cat 2.36% 90.020ms 2.56% 97.640ms 20.144us 4847 aten::bmm 2.29% 87.493ms 2.29% 87.493ms 42.721us 2048 aten::mul 1.76% 67.101ms 1.96% 74.875ms 8.068us 9280 aten::matmul 1.46% 55.748ms 77.53% 2.956s 292.904us 10093 aten::add 1.18% 44.884ms 1.32% 50.220ms 6.822us 7362 aten::copy_ 1.07% 40.672ms 1.07% 40.672ms 2.349us 17317 aten::silu 0.86% 32.886ms 0.86% 32.886ms 32.115us 1024 aten::_to_copy 0.73% 27.821ms 1.63% 62.339ms 3.739us 16674 aten::to 0.38% 14.327ms 1.82% 69.255ms 3.472us 19945 aten::topk 0.37% 14.210ms 0.37% 14.210ms 444.062us 32 aten::pow 0.35% 13.345ms 0.35% 13.360ms 6.423us 2080 aten::index 0.31% 12.008ms 0.39% 14.734ms 7.084us 2080 aten::transpose 0.30% 11.467ms 0.31% 11.720ms 0.951us 12320 aten::_softmax 0.27% 10.438ms 0.27% 10.438ms 10.193us 1024 aten::slice 0.25% 9.689ms 0.26% 9.746ms 0.521us 18722 aten::sum 0.25% 9.355ms 0.25% 9.587ms 4.605us 2082 aten::reshape 0.23% 8.724ms 0.34% 12.862ms 0.891us 14434 aten::neg 0.22% 8.420ms 0.22% 8.420ms 4.111us 2048 aten::t 0.21% 8.072ms 0.36% 13.617ms 1.891us 7200 aten::mean 0.18% 6.981ms 0.69% 26.352ms 12.669us 2080 aten::div_ 0.18% 6.962ms 0.28% 10.676ms 4.886us 2185 aten::div 0.17% 6.423ms 0.26% 9.769ms 9.251us 1056 aten::narrow 0.16% 6.030ms 0.17% 6.536ms 0.798us 8192 aten::maximum 0.14% 5.213ms 0.18% 6.820ms 6.660us 1024 aten::expand 0.08% 3.104ms 0.08% 3.121ms 0.750us 4163 aten::squeeze 0.07% 2.580ms 0.07% 2.590ms 0.632us 4096 aten::softmax 0.06% 2.424ms 0.45% 17.091ms 16.690us 1024 aten::rsqrt 0.06% 2.204ms 0.06% 2.204ms 1.060us 2080 aten::max 0.05% 1.842ms 0.21% 8.023ms 7.583us 1058 aten::_unsafe_view 0.05% 1.812ms 0.05% 1.812ms 0.193us 9376 aten::_log_softmax 0.04% 1.636ms 0.04% 1.657ms 51.781us 32 aten::unsqueeze 0.04% 1.384ms 0.04% 1.384ms 0.627us 2209 aten::detach_ 0.04% 1.344ms 0.04% 1.377ms 1.339us 1028 aten::_reshape_alias 0.03% 1.046ms 0.03% 1.046ms 0.348us 3007 aten::select 0.02% 918.000us 0.02% 922.000us 0.154us 6003 aten::unbind 0.02% 766.000us 0.02% 820.000us 8.454us 97 aten::view 0.02% 714.000us 0.02% 714.000us 0.049us 14597 aten::clone 0.02% 700.000us 0.08% 2.887ms 15.036us 192 aten::as_strided 0.01% 521.000us 0.01% 521.000us 0.011us 49595 aten::log_softmax 0.01% 458.000us 0.04% 1.705ms 53.281us 32 aten::sub 0.01% 306.000us 0.01% 367.000us 5.734us 64 aten::empty_strided 0.01% 288.000us 0.01% 288.000us 0.017us 16674 aten::fill_ 0.01% 236.000us 0.01% 236.000us 0.110us 2154 aten::all 0.01% 235.000us 0.01% 335.000us 10.469us 32 aten::remainder 0.01% 227.000us 0.01% 227.000us 7.094us 32 aten::cumsum 0.01% 218.000us 0.01% 218.000us 6.412us 34 aten::embedding 0.01% 212.000us 0.03% 965.000us 30.156us 32 aten::zeros 0.01% 207.000us 0.01% 208.000us 2.122us 98 aten::masked_fill_ 0.01% 198.000us 0.01% 198.000us 3.046us 65 aten::eq 0.00% 166.000us 0.00% 166.000us 4.882us 34 aten::empty_like 0.00% 137.000us 0.00% 164.000us 0.854us 192 aten::new_ones 0.00% 119.000us 0.01% 192.000us 6.000us 32 aten::masked_fill 0.00% 115.000us 0.01% 223.000us 6.969us 32 aten::item 0.00% 102.000us 0.00% 169.000us 0.626us 270 aten::rsub 0.00% 101.000us 0.01% 291.000us 9.094us 32 aten::empty 0.00% 93.000us 0.00% 93.000us 0.027us 3476 aten::is_nonzero 0.00% 90.000us 0.01% 256.000us 2.586us 99 aten::_local_scalar_dense 0.00% 76.000us 0.00% 76.000us 0.281us 270 aten::contiguous 0.00% 70.000us 0.01% 236.000us 7.375us 32 aten::view_as 0.00% 63.000us 0.00% 70.000us 2.188us 32 detach_ 0.00% 51.000us 0.00% 51.000us 0.050us 1028 aten::expand_as 0.00% 46.000us 0.00% 137.000us 4.281us 32 aten::new_empty 0.00% 33.000us 0.00% 40.000us 1.250us 32 aten::repeat_interleave 0.00% 28.000us 0.00% 66.000us 16.500us 4 aten::any 0.00% 11.000us 0.00% 17.000us 17.000us 1 aten::lt 0.00% 11.000us 0.00% 11.000us 5.500us 2 aten::result_type 0.00% 10.000us 0.00% 10.000us 0.005us 2080 aten::arange 0.00% 9.000us 0.00% 15.000us 7.500us 2 aten::resolve_conj 0.00% 8.000us 0.00% 8.000us 0.000us 18497 aten::min 0.00% 7.000us 0.00% 7.000us 7.000us 1 detach 0.00% 5.000us 0.00% 5.000us 5.000us 1 aten::gt 0.00% 4.000us 0.00% 4.000us 4.000us 1 aten::lift_fresh 0.00% 3.000us 0.00% 3.000us 0.003us 1063 aten::ones 0.00% 3.000us 0.00% 4.000us 4.000us 1 aten::full 0.00% 3.000us 0.00% 3.000us 3.000us 1 aten::detach 0.00% 2.000us 0.00% 7.000us 7.000us 1 aten::zero_ 0.00% 0.000us 0.00% 0.000us 0.000us 98 aten::resize_ 0.00% 0.000us 0.00% 0.000us 0.000us 1 aten::resolve_neg 0.00% 0.000us 0.00% 0.000us 0.000us 1 ProfilerStep -6.49% -247365.000us 100.00% 3.813s 3.813s 1 Self CPU time total: 3.813s ### Versions Collecting environment information... PyTorch version: 2.1.0.dev20230518+cpu Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: CentOS Stream 8 (x86_64) GCC version: (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) Clang version: 14.0.0 (Red Hat 14.0.0-1.module_el8.7.0+1142+5343df54) CMake version: version 3.22.1 Libc version: glibc-2.28 Python version: 3.8.16 (default, Mar 2 2023, 03:21:46) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-4.18.0-365.el8.x86_64-x86_64-with-glibc2.17 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 Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.1.0.dev20230518+cpu [conda] blas 1.0 mkl [conda] mkl 2023.1.0 h6d00ec8_46342 [conda] mkl-include 2023.1.0 pypi_0 pypi [conda] mkl-service 2.4.0 py38h5eee18b_1 [conda] mkl-static 2023.1.0 pypi_0 pypi [conda] mkl_fft 1.3.6 py38h417a72b_1 [conda] mkl_random 1.2.2 py38h417a72b_1 [conda] numpy 1.24.3 py38hf6e8229_1 [conda] numpy-base 1.24.3 py38h060ed82_1 [conda] torch 2.1.0.dev20230518+cpu pypi_0 pypi cc @robieta @chaekit @aaronenyeshi @ngimel @nbcsm @guotuofeng @guyang3532 @gaoteng-git @tiffzhaofb @dzhulgakov @davidberard98
1
2,551
101,855
torch.jit.trace() Floating point exception
oncall: jit
### πŸ› Describe the bug When I user torch.jit.trace to turn an existing module into a TorchScript .The following exception occurred: Floating point exception。 The code is as follows: import torch example_input = torch.rand((1, 12, 255, 256)).float().cuda() traced_model = torch.jit.trace(model_bpu.cpu(), example_input.cpu()) The model_bpu is a quant model after quantitative training. I loaded it from a pt file and convert it to quant. ### Versions torch 1.10.2+cu111 torchaudio 0.10.2+cu111 torchvision 0.11.3+cu111 python 3.8.1 Linux version 3.10.0-1160.49.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Nov 30 15:51:32 UTC 2021 cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel
0
2,552
101,850
Unexpected modification to CPU affinity of Dataloader workers
module: multiprocessing, triaged, module: openmp
### πŸ› Describe the bug In certain environments, pytorch (or a dependency) unexpectedly modifies CPU affinity of DataLoader workers. This may result in training/inference throughput reduction. Example script: ```python import os from torch.utils.data import DataLoader, Dataset class TestDataset(Dataset): def __init__(self): print('__init__', os.getpid(), len(os.sched_getaffinity(0))) def __len__(self): return 10 def __getitem__(self, item): print('__getitem__', os.getpid(), len(os.sched_getaffinity(0))) return item if __name__ == '__main__': print('__main__', os.getpid(), len(os.sched_getaffinity(0))) loader = DataLoader(TestDataset(), num_workers=2) for _ in loader: pass ``` ### Environment 1 (expected) `mamba create -n pytorch2 pytorch pytorch-cuda=11.7 -c pytorch -c nvidia` Script output: (numpy warnings removed) ``` __main__ 38262 64 __init__ 38262 64 __getitem__ 38264 64 __getitem__ 38263 64 __getitem__ 38264 64 __getitem__ 38263 64 __getitem__ 38263 64 __getitem__ 38264 64 __getitem__ 38263 64 __getitem__ 38264 64 __getitem__ 38263 64 __getitem__ 38264 64 ``` ### Environment 2 (unexpected) `mamba create -n pytorch2-condaforge pytorch pytorch-cuda=11.7 -c pytorch -c nvidia -c conda-forge` Script output: (numpy warnings removed) ``` __main__ 38397 64 __init__ 38397 64 __getitem__ 38399 2 __getitem__ 38399 2 __getitem__ 38398 2 __getitem__ 38398 2 __getitem__ 38398 2 __getitem__ 38399 2 __getitem__ 38399 2 __getitem__ 38398 2 __getitem__ 38398 2 __getitem__ 38399 2 ``` ### Versions <details> <summary>Environment 1</summary> Collecting environment information... PyTorch version: 2.0.1 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: CentOS Linux 7 (Core) (x86_64) GCC version: (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11) Clang version: Could not collect CMake version: version 3.26.3 Libc version: glibc-2.17 Python version: 3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-3.10.0-1127.8.2.el7.x86_64-x86_64-with-glibc2.17 Is CUDA available: True CUDA runtime version: 11.3.109 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: Tesla V100-SXM2-32GB GPU 1: Tesla V100-SXM2-32GB GPU 2: Tesla V100-SXM2-32GB GPU 3: Tesla V100-SXM2-32GB GPU 4: Tesla V100-SXM2-32GB GPU 5: Tesla V100-SXM2-32GB GPU 6: Tesla V100-SXM2-32GB GPU 7: Tesla V100-SXM2-32GB Nvidia driver version: 460.73.01 cuDNN version: Probably one of the following: /usr/lib64/libcudnn.so.8.9.1 /usr/lib64/libcudnn_adv_infer.so.8.9.1 /usr/lib64/libcudnn_adv_train.so.8.9.1 /usr/lib64/libcudnn_cnn_infer.so.8.9.1 /usr/lib64/libcudnn_cnn_train.so.8.9.1 /usr/lib64/libcudnn_ops_infer.so.8.9.1 /usr/lib64/libcudnn_ops_train.so.8.9.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 Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0-63 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 79 Model name: Intel(R) Xeon(R) CPU E5-2697A v4 @ 2.60GHz Stepping: 1 CPU MHz: 2398.779 CPU max MHz: 3600.0000 CPU min MHz: 1200.0000 BogoMIPS: 5200.24 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 40960K NUMA node0 CPU(s): 0-15,32-47 NUMA node1 CPU(s): 16-31,48-63 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 arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts spec_ctrl intel_stibp Versions of relevant libraries: [pip3] torch==2.0.1 [pip3] triton==2.0.0 [conda] blas 1.0 mkl [conda] mkl 2023.1.0 h6d00ec8_46342 [conda] pytorch 2.0.1 py3.11_cuda11.7_cudnn8.5.0_0 pytorch [conda] pytorch-cuda 11.7 h778d358_5 pytorch [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchtriton 2.0.0 py311 pytorch </details> <details> <summary>Environment 2</summary> Collecting environment information... PyTorch version: 2.0.1 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: CentOS Linux 7 (Core) (x86_64) GCC version: (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11) Clang version: Could not collect CMake version: version 3.26.3 Libc version: glibc-2.17 Python version: 3.11.3 | packaged by conda-forge | (main, Apr 6 2023, 08:57:19) [GCC 11.3.0] (64-bit runtime) Python platform: Linux-3.10.0-1127.8.2.el7.x86_64-x86_64-with-glibc2.17 Is CUDA available: True CUDA runtime version: 11.3.109 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: Tesla V100-SXM2-32GB GPU 1: Tesla V100-SXM2-32GB GPU 2: Tesla V100-SXM2-32GB GPU 3: Tesla V100-SXM2-32GB GPU 4: Tesla V100-SXM2-32GB GPU 5: Tesla V100-SXM2-32GB GPU 6: Tesla V100-SXM2-32GB GPU 7: Tesla V100-SXM2-32GB Nvidia driver version: 460.73.01 cuDNN version: Probably one of the following: /usr/lib64/libcudnn.so.8.9.1 /usr/lib64/libcudnn_adv_infer.so.8.9.1 /usr/lib64/libcudnn_adv_train.so.8.9.1 /usr/lib64/libcudnn_cnn_infer.so.8.9.1 /usr/lib64/libcudnn_cnn_train.so.8.9.1 /usr/lib64/libcudnn_ops_infer.so.8.9.1 /usr/lib64/libcudnn_ops_train.so.8.9.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 Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0-63 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 79 Model name: Intel(R) Xeon(R) CPU E5-2697A v4 @ 2.60GHz Stepping: 1 CPU MHz: 1200.500 CPU max MHz: 3600.0000 CPU min MHz: 1200.0000 BogoMIPS: 5200.24 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 40960K NUMA node0 CPU(s): 0-15,32-47 NUMA node1 CPU(s): 16-31,48-63 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 arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts spec_ctrl intel_stibp Versions of relevant libraries: [pip3] torch==2.0.1 [pip3] triton==2.0.0 [conda] blas 2.116 mkl conda-forge [conda] blas-devel 3.9.0 16_linux64_mkl conda-forge [conda] libblas 3.9.0 16_linux64_mkl conda-forge [conda] libcblas 3.9.0 16_linux64_mkl conda-forge [conda] liblapack 3.9.0 16_linux64_mkl conda-forge [conda] liblapacke 3.9.0 16_linux64_mkl conda-forge [conda] mkl 2022.1.0 h84fe81f_915 conda-forge [conda] mkl-devel 2022.1.0 ha770c72_916 conda-forge [conda] mkl-include 2022.1.0 h84fe81f_915 conda-forge [conda] pytorch 2.0.1 py3.11_cuda11.7_cudnn8.5.0_0 pytorch [conda] pytorch-cuda 11.7 h778d358_5 pytorch [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchtriton 2.0.0 py311 pytorch </details> cc @SsnL @VitalyFedyunin @ejguan @NivekT @dzhulgakov
10
2,553
101,839
Update minimum supported gcc to gcc-9
module: build, triaged, enhancement, module: third_party, actionable
### πŸš€ The feature, motivation and pitch As this is the first compiler that has full support for C++17 features, for example https://en.cppreference.com/w/cpp/header/filesystem or [`std::exclusive_scan`](https://en.cppreference.com/w/cpp/algorithm/exclusive_scan) (for more info, see https://godbolt.org/z/q19MPs1rP ) ### Alternatives Do not use C++17 cc @seemethere
4
2,554
101,820
Fix annotation update code in qat_utils.py
oncall: quantization, triaged
### πŸ› Describe the bug this is used to track this task ### Versions master cc @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel
0
2,555
101,814
[ATen][Sparse] Use Third-Party Eigen for sparse addmm
triaged, open source, ciflow/trunk, release notes: sparse
This pull request adds a functionality for addmm with the following layouts: ```python add(a_csr, b_csr) addmm(c_csr, a_csr, b_csr) addmm(c_csr, a_csr, b_csc) addmm(c_csr, a_csc, b_csc) addmm(c_csr, a_csc, b_csr) ``` using Eigen for non-MKL builds. Edit: thanks to the comment https://github.com/pytorch/pytorch/pull/101814#discussion_r1210569201 the following ops were also added: ```python add(a_csc, b_csc) addmm(c_csc, a_csr, b_csr) addmm(c_csc, a_csr, b_csc) addmm(c_csc, a_csc, b_csc) addmm(c_csc, a_csc, b_csr) ```
25
2,556
101,801
pytorch-nightly not have torch/version.py.tpl:cuda specified
oncall: binaries, module: windows, triaged
### πŸ› Describe the bug When trying to use pytorch-nightly there is no cuda Version in version.py generated file ``` File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\torch\utils\cpp_extension.py", line 382, in _check_cuda_version torch_cuda_version = packaging.version.parse(torch.version.cuda) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 49, in parse return Version(version) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 264, in __init__ match = self._regex.search(version) TypeError: expected string or bytes-like object [end of output] ``` more stacktrace ``` Successfully installed accelerate-0.18.0 datasets-2.10.1 safetensors-0.3.0 transformers-4.28.0 Processing g:\git-jv\ai\oobabooga_one-click-installersk-installers\text-generation-webui\repositories\gptq-for-llama Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Building wheels for collected packages: quant-cuda Building wheel for quant-cuda (setup.py): started Building wheel for quant-cuda (setup.py): finished with status 'error' error: subprocess-exited-with-error python setup.py bdist_wheel did not run successfully. exit code: 1 [50 lines of output] No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1' running bdist_wheel running build running build_ext Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\text-generation-webui\repositories\GPTQ-for-LLaMa\setup.py", line 4, in <module> setup( File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup return run_commands(dist) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands dist.run_commands() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands self.run_command(cmd) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\wheel\bdist_wheel.py", line 325, in run self.run_command("build") File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command self.distribution.run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run self.run_command(cmd_name) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command self.distribution.run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\command\build_ext.py", line 84, in run _build_ext.run(self) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run self.build_extensions() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\torch\utils\cpp_extension.py", line 500, in build_extensions _check_cuda_version(compiler_name, compiler_version) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\torch\utils\cpp_extension.py", line 382, in _check_cuda_version torch_cuda_version = packaging.version.parse(torch.version.cuda) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 49, in parse return Version(version) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 264, in __init__ match = self._regex.search(version) TypeError: expected string or bytes-like object [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for quant-cuda Running setup.py clean for quant-cuda Failed to build quant-cuda Installing collected packages: quant-cuda Attempting uninstall: quant-cuda Found existing installation: quant-cuda 0.0.0 Uninstalling quant-cuda-0.0.0: Successfully uninstalled quant-cuda-0.0.0 Running setup.py install for quant-cuda: started Running setup.py install for quant-cuda: finished with status 'error' error: subprocess-exited-with-error Running setup.py install for quant-cuda did not run successfully. exit code: 1 [54 lines of output] No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1' running install G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_ext Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\text-generation-webui\repositories\GPTQ-for-LLaMa\setup.py", line 4, in <module> setup( File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup return run_commands(dist) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands dist.run_commands() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands self.run_command(cmd) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\command\install.py", line 68, in run return orig.install.run(self) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run self.run_command('build') File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command self.distribution.run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run self.run_command(cmd_name) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command self.distribution.run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\command\build_ext.py", line 84, in run _build_ext.run(self) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run self.build_extensions() File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\torch\utils\cpp_extension.py", line 500, in build_extensions _check_cuda_version(compiler_name, compiler_version) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\torch\utils\cpp_extension.py", line 382, in _check_cuda_version torch_cuda_version = packaging.version.parse(torch.version.cuda) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 49, in parse return Version(version) File "G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 264, in __init__ match = self._regex.search(version) TypeError: expected string or bytes-like object [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. Rolling back uninstall of quant-cuda Moving to g:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\quant_cuda-0.0.0.dist-info\ from G:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\Lib\site-packages\~uant_cuda-0.0.0.dist-info Moving to g:\git-jv\ai\oobabooga_one-click-installersk-installers\installer_files\env\lib\site-packages\quant_cuda.cp310-win_amd64.pyd from C:\Users\b1tche5this15myusernamecensored\AppData\Local\Temp\pip-uninstall-zprl3o0n\quant_cuda.cp310-win_amd64.pyd error: legacy-install-failure Encountered error while trying to install package. quant-cuda note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. ``` ### Versions I install pytorch like this: `conda install -y -k pytorch torchvision torchaudio pytorch-cuda=12.1 cuda-toolkit ninja git -c pytorch-nightly -c nvidia` outpu of collect_env.py from conda env in oobabooga/one_click_installers's created env: ``` G:\git-jv\ai\oobabooga_one-click-installersk-installers>"installer_files\conda\condabin\conda.bat" activate ".\installer_files\env" >nul && python collect_env.py Collecting environment information... PyTorch version: N/A Is debug build: N/A CUDA used to build PyTorch: N/A ROCM used to build PyTorch: N/A OS: Microsoft Windows 11 Pro GCC version: Could not collect Clang version: Could not collect CMake version: Could not collect Libc version: N/A Python version: 3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)] (64-bit runtime) Python platform: Windows-10-10.0.22623-SP0 Is CUDA available: N/A CUDA runtime version: 12.1.105 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3080 Nvidia driver version: 531.79 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: N/A CPU: Architecture=9 CurrentClockSpeed=3401 DeviceID=CPU0 Family=107 L2CacheSize=8192 L2CacheSpeed= Manufacturer=AuthenticAMD MaxClockSpeed=3401 Name=AMD Ryzen 9 5950X 16-Core Processor ProcessorType=3 Revision=8448 Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.1.0.dev20230518 [pip3] torchaudio==2.1.0.dev20230518 [pip3] torchvision==0.16.0.dev20230518 [conda] blas 1.0 mkl [conda] mkl 2023.1.0 h8bd8f75_46356 [conda] mkl-service 2.4.0 py310h2bbff1b_1 [conda] mkl_fft 1.3.6 py310h4ed8f06_1 [conda] mkl_random 1.2.2 py310h4ed8f06_1 [conda] numpy 1.24.3 py310h055cbcc_1 [conda] numpy-base 1.24.3 py310h65a83cf_1 [conda] pytorch 2.1.0.dev20230518 py3.10_cpu_0 pytorch-nightly [conda] pytorch-cuda 12.1 hde6ce7c_5 pytorch-nightly [conda] pytorch-mutex 1.0 cpu pytorch-nightly [conda] torchaudio 2.1.0.dev20230518 py310_cpu pytorch-nightly [conda] torchvision 0.16.0.dev20230518 py310_cpu pytorch-nightly ``` cc @seemethere @malfet @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht
7
2,557
101,798
Fix absolute links in pytorch repository and allow it to be proxied
oncall: releng, triaged
### πŸ› Describe the bug The pip repositories like `https://download.pytorch.org/whl/cu118` do not follow common standards like PEP503. While for itself pip this is not an issue, we are having trouble proxying the repository using Sonatype Nexus. When looking at the actual location of the wheels, `https://download.pytorch.org/whl/torch/` the links to the wheel files use absolute paths like that: `<a href="/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl">torch-2.0.1+cu117-cp310-cp310-linux_x86_64.whl</a>` So far so good. Now I am proxying the pytorch repo to make use of caching and faster downloads in our corporate network. Additionally direct internet access is not allowed. We are using a so-called "raw repository" inside Sonatype Nexus. We cannot use their "PyPI" repository feature, because the pytorch repository does not follow PEP503 standard. But that is a separate issue. Our cached repository ends up at `https://nexus.corporate.info/repository/pytorch-raw/` with the wheels ending up at `https://nexus.corporate.info/repository/pytorch-raw/whl/torch/`. The page shows links the same way as the original repo. `<a href="/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl">torch-2.0.1+cu117-cp310-cp310-linux_x86_64.whl</a>` But a link like `/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl` ends up being resolved to `https://nexus.corporate.info/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl` The correct URL should be `https://nexus.corporate.info/repository/pytorch-raw/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl` Could you please fix the absolute links and use relative ones if possible? Alternatively, can you implement a PEP503 simple repository? What is the issue with that? ### Versions 2.0.1
4
2,558
101,795
Implement `to_numpy` method to speed up matplotlib with PyTorch arrays
triaged, enhancement, module: numpy, needs research
### πŸš€ The feature, motivation and pitch Hi, As discussed in [this issue](https://github.com/matplotlib/matplotlib/issues/25882) and [corresponding PR](https://github.com/matplotlib/matplotlib/pull/25887) on `matplotlib`, PyTorch arrays can be significantly slow when used directly with `matplotlib`. This is because `matplotlib` has no easy way to convert PyTorch arrays to NumPy arrays before plotting and thus it expects other libraries to have `to_numpy()` method. I think `to_numpy()` implementation in PyTorch would be useful for the PyTorch users who might be using PyTorch arrays directly with `matplotlib` without knowing that it can be too slow. ### Alternatives * As discussed in [the `matplotlib` PR](https://github.com/matplotlib/matplotlib/pull/25887), we considered adding a specific check for inputs of type `torch.Tensor` and then convert it to numpy using `.numpy()` method but adding a string based check does not seem a good idea. * We tried using `__array__` method to convert both JAX and PyTorch arrays to NumPy but it does not work well with some other objects having `__array__` method. ### Additional context Here is the code to reproduce the plotting delay issue: ```py from time import time import numpy as np import matplotlib.pyplot as plt import torch torch_array = torch.randn(1000, 150) def plot_hist(array): init = time() plt.figure() plt.hist(array) print(f"Time to plot: {time() - init:.2f} s") plt.show() plot_hist(torch_array.ravel()) # Takes around 2 seconds plot_hist(np.array(torch_array.ravel())) # Takes around 0.04 seconds ``` I am open to a diverse set of suggestions to fix this issue. cc @mruberry @rgommers
5
2,559
101,787
DISABLED test_decoder_padding_and_src_mask_bool_cpu (__main__.TestTransformersCPU)
module: nn, triaged, module: flaky-tests, skipped, oncall: transformer/mha
Platforms: dynamo This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_decoder_padding_and_src_mask_bool_cpu&suite=TestTransformersCPU) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 2 workflow(s) with 2 failures and 2 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_decoder_padding_and_src_mask_bool_cpu` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_transformers.py` cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki @bhosmer @cpuhrsch @erichan1 @drisspg
1
2,560
101,785
DISABLED test_encoder_padding_and_src_mask_bool_cpu (__main__.TestTransformersCPU)
module: nn, triaged, module: flaky-tests, skipped
Platforms: dynamo This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_encoder_padding_and_src_mask_bool_cpu&suite=TestTransformersCPU) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 2 workflow(s) with 2 failures and 2 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_encoder_padding_and_src_mask_bool_cpu` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_transformers.py` cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
14
2,561
101,781
Add support for bfloat16 in torch.from_numpy()
triaged, module: numpy, module: bfloat16
### πŸš€ The feature, motivation and pitch Currently, torch.from_numpy() doesn't support torch.bfloat16 data type. Adding this would allow users to copy bfloat16 numpy arrays back to Torch tensors. ### Alternatives _No response_ ### Additional context _No response_ cc @mruberry @rgommers
0
2,562
101,771
DISABLED test_fn_grad_remainder_cuda_float64 (__main__.TestBwdGradientsCUDA)
triaged, module: flaky-tests, skipped, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_fn_grad_remainder_cuda_float64&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 7 workflow(s) with 7 failures and 7 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_fn_grad_remainder_cuda_float64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire
1
2,563
101,770
DISABLED test_fn_grad___rmod___cuda_float64 (__main__.TestBwdGradientsCUDA)
triaged, module: flaky-tests, skipped, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_fn_grad___rmod___cuda_float64&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 7 workflow(s) with 14 failures and 7 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_fn_grad___rmod___cuda_float64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire
1
2,564
101,757
DISABLED test_fn_gradgrad_remainder_cuda_float64 (__main__.TestBwdGradientsCUDA)
triaged, module: flaky-tests, skipped, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_fn_gradgrad_remainder_cuda_float64&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 6 workflow(s) with 6 failures and 6 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_fn_gradgrad_remainder_cuda_float64` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire
1
2,565
101,755
DISABLED test_fn_grad_index_put_cuda_complex128 (__main__.TestBwdGradientsCUDA)
triaged, module: flaky-tests, skipped, module: inductor
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_fn_grad_index_put_cuda_complex128&suite=TestBwdGradientsCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 11 workflow(s) with 22 failures and 11 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_fn_grad_index_put_cuda_complex128` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops_gradients.py` cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire
1
2,566
101,716
[TorchScript] aten::__and__ with argument types: Tensor, bool not supported
oncall: jit, triaged
### πŸ› Describe the bug My repro: ``` import torch def func(): a = torch.tensor([2,1]) b = True return a + b # This runs fine with b cast as int func() # This failed torch.jit.trace(func, example_inputs=[]) ``` With torch eager, the boolean value just got cast into int. But Torchscript seems to not support this semantics. ### Versions PyTorch version: 2.0.0a0+gitc263bd4 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Ubuntu 20.04.5 LTS (x86_64) GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Clang version: Could not collect CMake version: version 3.25.0 Libc version: glibc-2.31 Python version: 3.8.15 (default, Nov 24 2022, 15:19:38) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.15.0-69-generic-x86_64-with-glibc2.17 Is CUDA available: True CUDA runtime version: 11.8.89 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3070 Nvidia driver version: 520.61.05 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.6.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.6.0 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.6.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.6.0 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.6.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.6.0 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.6.0 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 Address sizes: 48 bits physical, 48 bits virtual CPU(s): 24 On-line CPU(s) list: 0-23 Thread(s) per core: 2 Core(s) per socket: 12 Socket(s): 1 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 25 Model: 33 Model name: AMD Ryzen 9 5900X 12-Core Processor Stepping: 0 Frequency boost: enabled CPU MHz: 2419.685 CPU max MHz: 3700.0000 CPU min MHz: 2200.0000 BogoMIPS: 7399.70 Virtualization: AMD-V L1d cache: 384 KiB L1i cache: 384 KiB L2 cache: 6 MiB L3 cache: 64 MiB NUMA node0 CPU(s): 0-23 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp 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 Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel
0
2,567
101,699
[discussion] [feature request] Native tensor-backed string array and basic string processing functions for addition into core + discussion of extremely basic data frames (also for reducing python object heap pressure)
feature, triaged, needs research
### πŸš€ The feature, motivation and pitch This is useful to avoid copies related to copy-on-write (actually copy-on-read because of python's finicky ref-counters) problems with DataLoader: https://github.com/pytorch/pytorch/issues/13246. A typical application: list of file names or file paths in a dataset (avoiding creating hundreds of thousands/millions of python string objects on the heap), string<>token lookup tables. For fixed-size-characters (ascii: uint8 / utf_16: int16 / utf_32: int32) there is my prototype in https://gist.github.com/vadimkantorov/86c3a46bf25bed3ad45d043ae86fff57 , but some other designs can be considered. In essence, initially this means some fast parallelized APIs for conversion from python string lists and accessing individual elements / sub-lists (maybe parallelized string encoding/decoding). Different storage formats can be envisaged: e.g. fixed-length string array (with some null-byte padding) or no-padding packed format as in the gist above. I think for practical use in compaction of strings in datasets, the no-padding format is needed (although for parallelized hashing the fixed-length strings may be easier). Also should be decided if (stable) hashes can be precomputed/cached/stored along with the strings. This would be useful for some fast column-based string processing or mmap'ing some dataset files . Probably NumPy / HDF5 / Apache Arrow / parquet / data frame libraries have also some support along these lines. It seems that torcharrow.StringColumn might implement this. I think it's worth moving a string list class like this in core. Maybe even more lightweight - a Tensor subclass or even just methods for working with string-array holding uint8/int16/int32 tensors, because it's very useful for working around https://github.com/pytorch/pytorch/issues/13246 and otherwise more economic/parallelized basic string/file paths manipulation. A useful string function to include is some parallelized string hashing methods that are stable (e.g. hash all of the strings in the array at once). Then this could be used for fast hashtable construction / keys hash computation. Another useful concept can be "string lists" that allow appends (with some exponential storage reallocation): https://github.com/pytorch/pytorch/issues/64359 Related issues on "zero-copy": https://github.com/pytorch/pytorch/issues/43949, https://github.com/pytorch/pytorch/issues/33041, https://github.com/pytorch/pytorch/issues/34651 (about getting a `bytes` view over a sub-tensor - can be useful as an ascii string substitute, and in general for zero-copy pytorch interop. i wonder if python has some native string views over utf-8 strings?) It may seem that there's even an option to hack around CPython PyUnicode structure and create a "view" over char bytes (stored in tensor) without any char byte copies (although it's maybe not very safe): https://github.com/python/cpython/issues/104689 https://stackoverflow.com/questions/76291943/create-a-python-string-from-a-native-pointer-without-char-buffer-copy <hr> Going further, maybe some simplistic dataframe class can be added to PyTorch (being a tuple of tensors with having equal leftmost dim). These dataframes would primarily be used for some simple dataset serialization/deserialization / filtering and transformation. Ideally, a dataframe should support two modes of serialization: array-of-structs and column-based. Imagine, having a list of COCO per-image annotation objects and just giving it to some sort of dataframe constructor (maybe along with some schema/spec) and getting back a set of column tensors (with some helper accessor methods). This dataframe could be scattered without copies to DataLoader workers. Native CUDA-accelerated basic CSV-parsing could also be nice (especially if combined with mmap-based file reading?). I can see that this is implemented by [torcharrow](https://pytorch.org/torcharrow/beta/dataframe.html), maybe time to move some of its core structures to core? Discussion of conversion of nested structures to columns: - https://github.com/julienledem/redelm/wiki/The-striping-and-assembly-algorithms-from-the-Dremel-paper - https://research.google/pubs/pub36632/ Maybe some simple nested schemas can be supported first: - array of dicts of primitive types - array of dicts with nested arrays of dicts of primitive types These might be enough to represent data annotation schemas of common datasets (?)
11
2,568
101,679
[inductor][cpu] Cache for VecISA compilation results
triaged, open source, Stale, intel, module: inductor, ciflow/inductor, release notes: inductor
Fixes #100378 VecISA requires compiling a testing cpp program on every new process invocation, costing nearly 1 second on startup. Here we cache for VecISA compilation results and could directly read from cache next time if it exists. cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @voznesenskym @penguinwu @EikanWang @Guobing-Chen @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler @ngimel @desertfire
3
2,569
101,669
[refs] inplace references resize the input to match the broadcasted input shape
triaged, module: primTorch
### πŸ› Describe the bug From a quick check, the inplace references have incorrect behaviour when other arguments have higher rank than the input being inplaced into. ```python import torch torch.manual_seed(42) def f(x, y): return x.add_(y) x = torch.randn(3, 3) y = torch.randn(3, 3, 3) # output with shape [3, 3] doesn't match the broadcast shape [3, 3, 3] # x.add_(y) from torch._refs import add_ # Resizes `x` to the broadcasted shape of inputs add_(x, y) print(x.shape) # [3, 3, 3] ``` Inplace references created with `_make_inplace` seem to have this problem. Ref: https://github.com/pytorch/pytorch/blob/88b6a4577bad670c608424018caeba8698ad5f97/torch/_refs/__init__.py#L431 cc: @lezcano ### Versions master cc @ezyang @mruberry @ngimel @Lezcano @peterbell10
1
2,570
101,666
Unexpected behavior of fmod op in some float32 input
module: numerical-stability, triaged
### πŸ› Describe the bug import torch a = torch.tensor([0.84]) b = torch.tensor([0.02]) c = torch.fmod(a, b) d = a - a.div(b, rounding_mode="trunc") * b print(c) print(d) ### tensor([0.0200]) tensor([0.])
4
2,571
101,653
Unexpected behavior comparing uint8 tensor to value greater than 255
triaged, module: type promotion, module: edge cases
### πŸ› Describe the bug Unexpected behavior comparing uint8 tensor to value greater than 255. This appears to be an overflow issue. Behavior is not consistent with how numpy addresses this issue. I would expect it to be consistent with numpy or throw a runtime error (it actually does throw a runtime error with my install of pytorch==1.0.0 but not in recent versions of pytorch). ``` tensor_float = torch.tensor([1.0]) tensor_uint8 = tensor_float.type(torch.uint8) print(f"tensor_float < 256: {tensor_float < 256}") print(f"tensor_uint8 < 256: {tensor_uint8 < 256}") print(f"tensor_float.numpy() < 256: {tensor_float.numpy() < 256}") print(f"tensor_uint8.numpy() < 256: {tensor_uint8.numpy() < 256}") print(f"tensor_float > 256: {tensor_float > 256}") print(f"tensor_uint8 > 256: {tensor_uint8 > 256}") print(f"tensor_float.numpy() > 256: {tensor_float.numpy() > 256}") print(f"tensor_uint8.numpy() > 256: {tensor_uint8.numpy() > 256}") ``` Output in 1.13.1 and 2.0.1: ``` tensor_float < 256: tensor([True]) tensor_uint8 < 256: tensor([False]) tensor_float.numpy() < 256: [ True] tensor_uint8.numpy() < 256: [ True] tensor_float > 256: tensor([False]) tensor_uint8 > 256: tensor([True]) tensor_float.numpy() > 256: [False] tensor_uint8.numpy() > 256: [False] ``` Output in 1.0.0 ``` tensor_float < 256: tensor([1], dtype=torch.uint8) Traceback (most recent call last): File "/home/xsy/code/torchcloud/minimum_example.py", line 7, in <module> print(f"tensor_uint8 < 256: {tensor_uint8 < 256}") RuntimeError: value cannot be converted to type uint8_t without overflow: 256 ``` ### Versions Collecting environment information... PyTorch version: 2.0.1 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.2 LTS (x86_64) GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Clang version: Could not collect CMake version: version 3.18.2 Libc version: glibc-2.35 Python version: 3.11.3 | packaged by conda-forge | (main, Apr 6 2023, 08:57:19) [GCC 11.3.0] (64-bit runtime) Python platform: Linux-5.15.0-71-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: 12.1.105 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA TITAN V GPU 1: NVIDIA TITAN V Nvidia driver version: 530.30.02 cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.0 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: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: GenuineIntel Model name: Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz CPU family: 6 Model: 85 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 1 Stepping: 4 CPU max MHz: 4500.0000 CPU min MHz: 1200.0000 BogoMIPS: 7200.00 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 est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti ssbd mba ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req md_clear flush_l1d arch_capabilities L1d cache: 256 KiB (8 instances) L1i cache: 256 KiB (8 instances) L2 cache: 8 MiB (8 instances) L3 cache: 11 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-15 Vulnerability Itlb multihit: KVM: Mitigation: VMX unsupported Vulnerability L1tf: Mitigation; PTE Inversion 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 and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.1 [pip3] torchaudio==2.0.2 [pip3] torchvision==0.15.2 [pip3] triton==2.0.0 [conda] blas 2.116 mkl conda-forge [conda] blas-devel 3.9.0 16_linux64_mkl conda-forge [conda] ffmpeg 4.3 hf484d3e_0 pytorch [conda] libblas 3.9.0 16_linux64_mkl conda-forge [conda] libcblas 3.9.0 16_linux64_mkl conda-forge [conda] liblapack 3.9.0 16_linux64_mkl conda-forge [conda] liblapacke 3.9.0 16_linux64_mkl conda-forge [conda] mkl 2022.1.0 h84fe81f_915 conda-forge [conda] mkl-devel 2022.1.0 ha770c72_916 conda-forge [conda] mkl-include 2022.1.0 h84fe81f_915 conda-forge [conda] numpy 1.24.3 py311h64a7726_0 conda-forge [conda] pytorch 2.0.1 py3.11_cuda11.8_cudnn8.7.0_0 pytorch [conda] pytorch-cuda 11.8 h7e8668a_5 pytorch [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchaudio 2.0.2 py311_cu118 pytorch [conda] torchtriton 2.0.0 py311 pytorch [conda] torchvision 0.15.2 py311_cu118 pytorch cc @nairbv @mruberry
6
2,572
101,632
torch.profiler.profile has an empty python replay stack under certain circumstances
triaged, oncall: profiler
### πŸ› Describe the bug Under certain circumstances, the `torch.profiler.profile` will crash with the following error message: ``` RuntimeError: stack.size() INTERNAL ASSERT FAILED at "/opt/conda/conda-bld/pytorch_1682343967769/work/torch/csrc/autograd/profiler_python.cpp":963, please report a bug to PyTorch. Python replay stack is empty ``` It seems related to the usage of the `profile` object when wrapped in a function decorated by `@contextlib.contextmanager`. _However_, substituting such a function with a custom class that implements `__enter__` and `__exit__` does _**NOT**_ lead to errors. Similarly, foregoing this function entirely, and manually calling `profile.step()`, does not lead to errors. It also does not fail for all parameterizations of `wait`, `warmup`, `active`, `repeat`, and `skip_first`. ## Minimal repro example ```python import contextlib import torch def main( wait: int = 0, warmup: int = 0, active: int = 1, repeat: int = 2, skip_first: int = 0, ): """Main.""" steps_per_cycle = wait + warmup + active # times 2 for testing extra steps. inner_steps = skip_first + steps_per_cycle * repeat * 2 with _get_torch_profiler( wait=wait, warmup=warmup, active=active, repeat=repeat, skip_first=skip_first ) as p: for _ in range(inner_steps): # with _OnStep(p): with on_step(p): dummy_func() # p.step() @contextlib.contextmanager def on_step(profile): """On step context manager.""" yield profile.step() class _OnStep: def __init__(self, profile): self._profile = profile def __enter__(self): return None def __exit__(self, *args, **kwargs): self._profile.step() def dummy_func(): """A dummy function to be profiled.""" model = torch.nn.Linear(1, 1) model.forward(torch.zeros(1)) def _get_schedule(wait, warmup, active, repeat, skip_first): return torch.profiler.schedule( wait=wait, warmup=warmup, active=active, repeat=repeat, skip_first=skip_first ) def _get_torch_profiler(wait, warmup, active, repeat, skip_first): activities = [ torch.profiler.ProfilerActivity.CPU, ] return torch.profiler.profile( activities=activities, schedule=_get_schedule( wait=wait, warmup=warmup, active=active, repeat=repeat, skip_first=skip_first, ), record_shapes=True, with_stack=True, with_flops=True, profile_memory=False, ) if __name__ == "__main__": main() ``` In the above example, both of these changes will make the script pass: * uncommenting line 22's `with _OnStep(p)`, and commenting out the line below it. * commenting out line 23's `on_step(p)`, and uncommenting line 25's `p.step()`. ## Other notes The above is a stripped version of a unit test suite where many more parameterizations of the arguments passed to `schedule` are tested. About a quarter of them fail; however, while some fail with same error as above, others that follow it will fail with: ``` def __exit__(self, exc_type, exc_val, exc_tb): if not self.enabled: return if self.use_cuda: torch.cuda.synchronize() > self.kineto_results = _disable_profiler() E RuntimeError: Can't disable Kineto profiler when it's not running 3rdparty/bazel/pip/torch_cuda11/lib/torch/autograd/profiler.py:231: RuntimeError ``` Running the parameterizations that fail with the above in isolation will **PASS**, implying some global state not being cleaned up when exceptions are raised. ### Versions Note that I tested this script in both of the following docker containers (both found [here](https://hub.docker.com/r/pytorch/pytorch)): * `docker.io/pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime` * `docker.io/pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime` Output of the `collect_env.py` script in the latter: ``` PyTorch version: 2.0.1 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: Ubuntu 20.04.6 LTS (x86_64) GCC version: Could not collect Clang version: Could not collect CMake version: version 3.22.1 Libc version: glibc-2.31 Python version: 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.4.0-66-generic-x86_64-with-glibc2.31 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 Address sizes: 46 bits physical, 48 bits virtual CPU(s): 16 On-line CPU(s) list: 0-15 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Core(TM) i7-9800X CPU @ 3.80GHz Stepping: 4 CPU MHz: 1200.350 CPU max MHz: 4500.0000 CPU min MHz: 1200.0000 BogoMIPS: 7599.80 Virtualization: VT-x L1d cache: 256 KiB L1i cache: 256 KiB L2 cache: 8 MiB L3 cache: 16.5 MiB NUMA node0 CPU(s): 0-15 Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Meltdown: Mitigation; PTI Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable 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 dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req md_clear flush_l1d Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.1 [pip3] torchaudio==2.0.2 [pip3] torchdata==0.6.1 [pip3] torchelastic==0.2.2 [pip3] torchtext==0.15.2 [pip3] torchvision==0.15.2 [pip3] triton==2.0.0 [conda] blas 1.0 mkl [conda] ffmpeg 4.3 hf484d3e_0 pytorch [conda] mkl 2023.1.0 h6d00ec8_46342 [conda] mkl-service 2.4.0 py310h5eee18b_1 [conda] mkl_fft 1.3.6 py310h1128e8f_1 [conda] mkl_random 1.2.2 py310h1128e8f_1 [conda] numpy 1.24.3 py310h5f9d8c6_1 [conda] numpy-base 1.24.3 py310hb5e798b_1 [conda] pytorch 2.0.1 py3.10_cuda11.7_cudnn8.5.0_0 pytorch [conda] pytorch-cuda 11.7 h778d358_5 pytorch [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchaudio 2.0.2 py310_cu117 pytorch [conda] torchdata 0.6.1 py310 pytorch [conda] torchelastic 0.2.2 pypi_0 pypi [conda] torchtext 0.15.2 py310 pytorch [conda] torchtriton 2.0.0 py310 pytorch [conda] torchvision 0.15.2 py310_cu117 pytorch ``` cc @robieta @chaekit @aaronenyeshi @ngimel @nbcsm @guotuofeng @guyang3532 @gaoteng-git @tiffzhaofb @dzhulgakov @davidberard98
3
2,573
101,628
Fake Tensor multithreading
Stale, ciflow/inductor
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * #101778 * #101656 * #101629 * __->__ #101628
4
2,574
101,625
DISABLED test_compare_cpu__refs_empty_strided_cuda_float32 (__main__.TestCommonCUDA)
module: cuda, triaged, skipped
Platforms: rocm This test was disabled because it is failing on master ([recent examples](http://torch-ci.com/failure/test_ops.py%3A%3ATestCommonCUDA%3A%3Atest_compare_cpu__refs_empty_strided_cuda_float32)). cc @ngimel @jaglinux @arindamroy-eng
1
2,575
101,624
[Dynamo + DDP] If DDP partitions FX graph generated by Dynamo correctly
triaged, oncall: pt2, module: dynamo
### πŸ› Describe the bug Repro: ``` import torch import logging import torch._dynamo torch._logging.set_logs(dynamo=logging.DEBUG, bytecode=True) import torch.nn as nn import torch.nn.functional as F torch.manual_seed(420) class MyModel(nn.Module): def __init__(self): super(MyModel, self).__init__() self.linear = torch.nn.Linear(5, 5) def forward(self, x): x = x + 1 with torch.cuda.amp.autocast(dtype=torch.float16): x = self.linear(x) x = torch.sin(x) x = torch.cos(x) x = x - 1 return x x = torch.randn(5, 5, device="cuda") m = MyModel().to("cuda") print(m(x)) opt_m = torch.compile(backend="eager")(m) print(opt_m(x)) ``` Generated FX graph: ``` ===== __compiled_fn_0 ===== <eval_with_key>.0 class GraphModule(torch.nn.Module): def forward(self, L_x_ : torch.Tensor): l_x_ = L_x_ # File: /scratch/ybliang/work/repos/debug/debug6.py:19, code: x = x + 1 add = l_x_ + 1; l_x_ = None # No stacktrace found for following nodes enter_functional_autocast = torch__dynamo_variables_ctx_manager_enter_functional_autocast('cuda', torch.float16, True, True) # File: /scratch/ybliang/work/repos/debug/debug6.py:21, code: x = self.linear(x) l__self___linear = self.L__self___linear(add); add = None # File: /scratch/ybliang/work/repos/debug/debug6.py:22, code: x = torch.sin(x) sin = torch.sin(l__self___linear); l__self___linear = None # No stacktrace found for following nodes exit_functional_autocast = torch__dynamo_variables_ctx_manager_exit_functional_autocast(enter_functional_autocast); enter_functional_autocast = None # File: /scratch/ybliang/work/repos/debug/debug6.py:23, code: x = torch.cos(x) cos = torch.cos(sin); sin = None # File: /scratch/ybliang/work/repos/debug/debug6.py:24, code: x = x - 1 sub = cos - 1; cos = None return (sub,) ``` Generated compiled function: ``` __compiled_fn_0 <eval_with_key>.0 opcode name target args kwargs ------------- ------------------------- ------------------------------------------------------ ----------------------------------- -------- placeholder l_x_ L_x_ () {} call_function add <built-in function add> (l_x_, 1) {} call_function enter_functional_autocast <function enter_functional_autocast at 0x7f7594c66550> ('cuda', torch.float16, True, True) {} call_module l__self___linear L__self___linear (add,) {} call_function sin <built-in method sin of type object at 0x7f798f3f19e0> (l__self___linear,) {} call_function exit_functional_autocast <function exit_functional_autocast at 0x7f7594c74d30> (enter_functional_autocast,) {} call_function cos <built-in method cos of type object at 0x7f798f3f19e0> (sin,) {} call_function sub <built-in function sub> (cos, 1) {} output output output ((sub,),) {} ``` ### Versions N/A cc @ezyang @gchanan @zou3519 @msaroufim @wconstab @ngimel @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire
12
2,576
101,609
[Dynamo] Can't inline functions under torch.nn.parallel
triaged, oncall: pt2, module: dynamo
### πŸ› Describe the bug Actually for functions/modules under ```torch.nn```, we put a ```call_module``` in FX graph rather than inlining them. https://github.com/pytorch/pytorch/blob/cb734123e2e1c533a72032fb63a6083f0eedb817/torch/_dynamo/variables/functions.py#L306-L320 This is because we assume modules under ```torch.nn``` are allowed modules, which is safely to be traced through AOT autograd. However, ```torch.nn.parallel``` is under this folder but with different semantics. I think we should have a better way to detect and distinguish them. Quickly workaround to unblock: ``` --- a/torch/_dynamo/variables/functions.py +++ b/torch/_dynamo/variables/functions.py @@ -313,6 +313,7 @@ class UserMethodVariable(UserFunctionVariable): if ( module_attr is not None and module_attr.startswith("torch.nn.") + and not module_attr.startswith("torch.nn.parallel") or self.is_constant ): return self.obj.call_method( ``` ### Versions N/A cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire
4
2,577
101,606
[BE]: pyupgrade Python to 3.8 - remove extraneous parentheses only
triaged, open source, Stale, release notes: mobile, release notes: quantization, ciflow/mps, module: inductor, module: dynamo, ciflow/inductor
This change removes all redundant/extraneous parentheses. It was done by running: ```bash ruff check --target-version=py38 --select=UP034 --fix --verbose benchmarks/ caffe/ test/ tools/ torch/ ``` I reviewed them all and they make sense to me. cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @desertfire @anijain2305
27
2,578
101,603
multiple values for argument `softmax_scale`
triaged, module: fsdp, oncall: pt2
### πŸ› Describe the bug Posting this on behalf of Mosaic ``` pip install --no-cache-dir --find-links https://download.pytorch.org/whl/torch_stable.html torch==2.0.0+cu117 torchvision torchtext pip install einops ``` `python attention.py` https://raw.githubusercontent.com/sashaDoubov/llm-foundry/sasha/repro-issue/llmfoundry/models/layers/attention.py ### Error logs Not an error but instead seeing this scary warning ``` [2023-05-15 23:04:35,681] torch._dynamo.symbolic_convert: [WARNING] /llm-foundry/llmfoundry/models/layers/attention.py <function xformers_attn_fn at 0x7f2a6834ed40> [UnspecializedNNModuleVariable(MultiheadAttention), TensorVariable(), TensorVariable(), TensorVariable(), ConstantVariable(int)] {'softmax_scale': ConstantVariable(float), 'attn_bias': TensorVariable(), 'key_padding_mask': ConstantVariable(NoneType), 'is_causal': ConstantVariable(bool), 'dropout_p': ConstantVariable(float), 'training': ConstantVariable(bool), 'needs_weights': ConstantVariable(bool)} multiple values for argument 'softmax_scale' [2023-05-15 23:04:35,707] torch._dynamo.symbolic_convert: [WARNING] /llm-foundry/llmfoundry/models/layers/attention.py <function xformers_attn_fn at 0x7f2a6834ed40> [UnspecializedNNModuleVariable(MultiheadAttention), TensorVariable(), TensorVariable(), TensorVariable(), ConstantVariable(int)] {'softmax_scale': ConstantVariable(float), 'attn_bias': TensorVariable(), 'key_padding_mask': ConstantVariable(NoneType), 'is_causal': ConstantVariable(bool), 'dropout_p': ConstantVariable(float), 'training': ConstantVariable(bool), 'needs_weights': ConstantVariable(bool)} multiple values for argument 'softmax_scale' ``` ## How to remove the error As a workaround you can comment out softmax_scale and the code then works https://gist.github.com/msaroufim/5fe1a5cf745e31baabeb62b8dce10c82 but that's not a real solution ### Versions n cc @zhaojuanmao @mrshenli @rohan-varma @awgu @ezyang @wconstab @ngimel @bdhirsh @anijain2305
4
2,579
101,586
/Users/davidlaxer/pytorch/third_party/tensorpipe/third_party/libuv/src/unix/getaddrinfo.c:165:10: error: implicit declaration of function 'uv__idna_toascii' [-Werror,-Wimplicit-function-declaration] rc = uv__idna_toascii(hostname,
oncall: distributed, triaged
### πŸ› Describe the bug Building PyTorch from source with 'USE_DISTRIBUTED=ON' had a problem in thirdparty tensorpipe with uv.h. /Users/davidlaxer/pytorch/third_party/tensorpipe/third_party/libuv/include/uv.h uv__idna_toascii was not declared in uv.h I'm on MacOS 13.3.1 using this version of clang: ``` CC=/usr/bin/clang CXX=/usr/bin/clang++ % /usr/bin/clang++ --version Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: x86_64-apple-darwin22.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin ``` Build commands: ``` export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} CC=/usr/bin/clang CXX=/usr/bin/clang++ python setup.py build --cmake-only ccmake build # or cmake-gui build % export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} CC=/usr/bin/clang CXX=/usr/bin/clang++ python setup.py install ``` PyTorch builds properly with USE_DISTRIBUTED=OFF ### Versions ``` % python collect_env.py Collecting environment information... PyTorch version: 2.1.0a0+git6bc0f4a Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: macOS 13.3.1 (x86_64) GCC version: Could not collect Clang version: 14.0.6 CMake version: version 3.22.1 Libc version: N/A Python version: 3.10.11 (main, Apr 20 2023, 13:59:00) [Clang 14.0.6 ] (64-bit runtime) Python platform: macOS-10.16-x86_64-i386-64bit 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: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz Versions of relevant libraries: [pip3] audiolm-pytorch==0.0.1 [pip3] mypy-extensions==0.4.3 [pip3] numpy==1.24.3 [pip3] pytorch-transformers==1.1.0 [pip3] torch==2.1.0a0+gita941356 [pip3] torch-struct==0.5 [pip3] torch-summary==1.4.5 [pip3] torch-utils==0.1.2 [pip3] torchaudio==2.0.0.dev20230313 [pip3] torchtraining-nightly==1604016577 [pip3] torchvision==0.16.0.dev20230428 [pip3] vector-quantize-pytorch==0.9.2 [conda] nomkl 3.0 0 [conda] numpy 1.24.3 py310he50c29a_0 [conda] numpy-base 1.24.3 py310h992e150_0 [conda] pytorch-transformers 1.1.0 pypi_0 pypi [conda] torch 2.1.0a0+git6bc0f4a pypi_0 pypi [conda] torch-struct 0.5 pypi_0 pypi [conda] torch-summary 1.4.5 pypi_0 pypi [conda] torch-utils 0.1.2 pypi_0 pypi [conda] torchaudio 2.0.0.dev20230313 pypi_0 pypi [conda] torchtraining-nightly 1604016577 pypi_0 pypi [conda] torchvision 0.16.0.dev20230428 pypi_0 pypi [conda] vector-quantize-pytorch 0.9.2 pypi_0 pypi (AI-Feynman) davidlaxer@bluediamond pytorch % ``` cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
0
2,580
101,566
Unable to do tensor comparison on Metal Performance Shaders (MPS)
triaged, module: mps
### πŸ› Describe the bug Using the official [PyTorch example for MNIST](https://github.com/pytorch/examples/blob/main/mnist/main.py), I am unable to compute a[ tensor element-wise equality](https://pytorch.org/docs/stable/generated/torch.eq.html) on the [MPS backend](https://developer.apple.com/metal/pytorch/), supported by Apple Metal. The problem happens in line 64, where the amount of correct predictions is computed: `correct += pred.eq(target.view_as(pred)).sum().item()` So, the accuracy appears always to be 0, in line 68 to 70: ``` print('\nTest set: Average loss: {:.4f}, Accuracy: {}/{} ({:.0f}%)\n'.format( test_loss, correct, len(test_loader.dataset), 100. * correct / len(test_loader.dataset))) ``` That is, because the eq comparison evaluates everything to `False`. However, when I turn MPS off, by switching the `--no-mps` flag to True, I do obtain accuracies and the network trains as expected on CPU. Why is that the case? Am I missing here something within my configuration or is this a bug? I would really love to use the AMD GPU of my Intel-powered MacBook Pro. ### Versions PyTorch version: 2.0.0 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A OS: macOS 13.3.1 (x86_64) GCC version: Could not collect Clang version: 14.0.3 (clang-1403.0.22.14.1) CMake version: version 3.26.3 Libc version: N/A Python version: 3.10.11 | packaged by conda-forge | (main, May 10 2023, 19:07:22) [Clang 14.0.6 ] (64-bit runtime) Python platform: macOS-13.3.1-x86_64-i386-64bit 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: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.0 [pip3] torchaudio==2.0.0 [pip3] torchvision==0.15.1a0 [conda] mkl 2022.2.1 h44ed08c_16952 conda-forge [conda] numpy 1.24.3 py310h7451ae0_0 conda-forge [conda] pytorch 2.0.0 cpu_py310h2bbf33f_0 conda-forge [conda] torchaudio 2.0.0 py310_cpu pytorch [conda] torchvision 0.15.1 cpu_py310hfdc6817_0 conda-forge cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
0
2,581
101,536
torch.cuda.set_device cannot use to set cpu device, but give an ambiguity hint
triaged
### πŸ› Describe the bug when give the string parameter as input to set the device torch use,the hint shows that cpu is allow ``` python import torch torch.cuda.set_device("gpu:0") # it should be torch.cuda.set_device("cuda:0") but this is to get the hint # RuntimeError: Expected one of cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, ort, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone device type at start of device string: gpu ``` but if I follow the hint, and try to use torch.cuda.set_device to set cpu as target device ``` python import torch torch.cuda.set_device("cpu") # ValueError: Expected a cuda device, but got: cpu device = torch.device("cpu") torch.cuda.set_device(device) # ValueError: Expected a cuda device, but got: cpu ``` in neither way, the api won't allow me to do so, so the hint is pretty ambiguity. I went to look at the torch.cuda.set_device source code and found the torch.cuda.set_device use _get_device_index and the default parameter is ``` python def _get_device_index(device: Any, optional: bool = False, allow_cpu: bool = False) -> int: ... ``` and actually won't allow the cpu set. if `device = _get_device_index(device,allow_cpu = True)` is more reasonable in the `torch.cuda.set_device` call, considering the hint and user can use the function to set the global device as cpu. ### Versions pytorch 2.1.0 and the latest version
2
2,582
101,535
Exporting the operator 'aten::scatter_reduce' to ONNX opset version 15 is not supported
module: onnx, triaged
### πŸ› Describe the bug ``` dst = dst.scatter_reduce(-2, dst_idx.expand(n, r, c), src, reduce="mean") ``` ### Versions pytorch version 2.0.1
8
2,583
101,531
torch.nn.functional.scaled_dot_product_attention() : support both attn_mask and is_causal
triaged, module: multi-headed-attention
### πŸš€ The feature, motivation and pitch It would still be great if `torch.nn.functional.scaled_dot_product_attention()` supported setting both `attn_mask` and `is_causal=True`. In which case it ignores the upper triangular part of `attn_mask` and implicitly assumes it's either set to False or -inf. This would allow us to do some sort of relative positional encoding and causal masking at the same time while saving compute and memory. ### Alternatives At the moment you set `is_causal=False` and make sure `attn_mask` is inherently causal. That's fine, but we're missing an optimization. ### Additional context Mentioned in #100709
2
2,584
101,529
Inconsistent performance degradation of 3x3 convolution (torch 2.0.1+cu118)
module: performance, module: cudnn, module: cuda, triaged, module: regression
### πŸ› Describe the bug When using `torch 2.0.1+cu118`, nn.Conv2d` slows down significantly compare to previous versions when, - `in_channels` is around 5 ~ 6, - `out_channels` is less than 5, and - `kernel_size` is 3. Here is an example snippet. I also posted a full benchmark script to my gist ([torch_conv_bench.py](https://gist.github.com/daitakahashi/3796d2f9ef8d9976b66fe28a2f73aec4)). (note: following the reply, I updated both gist and this snipped to use `torch.cuda.synchronize()` instead of implicit synchronization. All benchmark values are also updated) ```python import torch import time def bench(t, net): s = 0 _tm = 0 for _ in range(1000): tcuda = t.to('cuda') torch.cuda.synchronize(device='cuda') t0 = time.time() output = net(tcuda) torch.cuda.synchronize(device='cuda') _tm += time.time() - t0 del tcuda, output return _tm t = torch.rand((32, 5, 256, 256), dtype=torch.float32) net = torch.nn.Conv2d(in_channels=5, out_channels=3, kernel_size=3) net.to('cuda', dtype=torch.float32) t33 = bench(t, net) net = torch.nn.Conv2d(in_channels=5, out_channels=3, kernel_size=5) net.to('cuda', dtype=torch.float32) t55 = bench(t, net) print(f'3x3 conv: {t33} sec') print(f'5x5 conv: {t55} sec') ``` Here, I got following output from the above snippet. I expected that 3x3 convolution is slightly faster than 5x5 convolution, but it wasn't. ``` 3x3 conv: 2.52791428565979 sec 5x5 conv: 0.48103857040405273 sec ``` Further investigation shows large performance drop of particular combinations of `input_channels`, `output_channels`, `kernel_size`, and sizes of input images (using the benchmark script mentioned above). ``` ksize = 3 32x32 64x64 128x128 256x256 512x512 ------------------- -------- -------- --------- --------- --------- input channels = 1 33182.78 44201.75 24545.32 10968.94 3123.48 input channels = 2 20744.37 31105.78 26677.93 17649.08 5557.87 input channels = 3 33778.72 29220.45 22613.24 11869.78 3426.66 input channels = 4 5601.89 36399.41 1635.79 424.04 107.14 input channels = 5 13535.69 33803.22 1605.76 407.32 101.99 input channels = 6 13487.81 32671.01 1604.28 405.84 101.73 input channels = 7 12630.02 31555.10 1603.55 404.17 101.31 input channels = 8 24448.03 25338.63 15652.72 5564.58 1603.36 input channels = 9 23494.87 24206.75 14651.05 4750.06 1449.85 input channels = 10 23030.44 23641.87 13704.64 4347.19 1322.83 ksize = 5 32x32 64x64 128x128 256x256 512x512 ------------------- -------- -------- --------- --------- --------- input channels = 1 41266.27 43873.47 27887.66 17051.40 5940.69 input channels = 2 38550.59 32192.06 22522.17 11380.56 3265.98 input channels = 3 35037.21 29987.16 19737.90 8577.48 2358.35 input channels = 4 32110.73 27921.08 17161.64 6840.58 1846.33 input channels = 5 30548.46 26225.87 15369.94 5661.70 1509.87 input channels = 6 28692.73 25061.57 13826.16 4838.33 1285.15 input channels = 7 23937.36 23960.61 12576.25 4184.26 1118.09 input channels = 8 22090.40 22103.20 11404.07 3707.90 987.81 input channels = 9 21284.40 21384.24 10553.04 3186.89 885.77 input channels = 10 20585.54 20573.42 9701.63 2919.36 802.35 Varying the number of input/output channels (iter/sec): ksize = 3, image size = 128 #in \ #out 1 2 3 4 5 6 7 8 9 10 ------------ -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- 1 28311.20 27228.67 23465.95 25141.19 19142.46 9680.35 17146.20 17596.51 17885.40 17655.02 2 40591.35 22569.44 16899.57 17445.74 12961.38 16267.71 16226.80 16005.13 16102.21 16021.64 3 31669.47 17316.09 14334.11 11955.72 10367.31 14547.39 14746.87 14420.35 14772.32 14643.89 4 1649.70 1634.17 1630.71 1662.88 1623.31 13391.78 13476.54 13190.05 13540.06 13503.01 5 1619.71 1601.55 1600.76 1636.16 1588.84 12037.38 12226.87 12189.20 12336.55 12262.25 6 1618.65 1601.30 1601.04 1636.97 1584.05 11234.84 11405.93 11334.43 11519.65 11478.35 7 1617.09 1599.51 1598.28 1633.56 1581.09 10471.88 10646.52 10653.28 10765.11 10696.75 8 19439.67 10382.97 7811.06 6283.41 5261.95 9858.05 10022.47 9893.39 10066.49 9971.72 9 18115.60 9504.00 7176.25 5720.23 4805.52 7349.27 7364.63 7387.59 7478.74 7464.10 10 16871.02 8906.05 6638.66 5267.31 4401.30 7418.03 7424.47 7338.60 7425.12 7443.31 ``` I observed the performance degradation on RTX 4090 and 4080. So far I only see the issue when I use `torch 2.0.1+cu118`. Both `torch 2.0.1` from pypi.org (using cuda 11.7) and `torch 1.13.1` (also from pypi.org) do not show this issue. Thank you very much in advance. ### Versions Collecting environment information... PyTorch version: 2.0.1+cu118 Is debug build: False CUDA used to build PyTorch: 11.8 ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.2 LTS (x86_64) GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Clang version: Could not collect CMake version: version 3.25.0 Libc version: glibc-2.35 Python version: 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (64-bit runtime) Python platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090 Nvidia driver version: 530.30.02 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.1 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.1 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.1 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.1 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.1 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.1 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Vendor ID: AuthenticAMD Model name: AMD Ryzen 9 7950X 16-Core Processor CPU family: 25 Model: 97 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 2 Frequency boost: enabled CPU max MHz: 5879.8818 CPU min MHz: 3000.0000 BogoMIPS: 8983.28 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 perfmon_v2 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d Virtualization: AMD-V L1d cache: 512 KiB (16 instances) L1i cache: 512 KiB (16 instances) L2 cache: 16 MiB (16 instances) L3 cache: 64 MiB (2 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected 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 Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] numpy==1.24.3 [pip3] torch==2.0.1+cu118 [pip3] torchaudio==2.0.2+cu118 [pip3] torchinfo==1.7.2 [pip3] torchvision==0.15.2+cu118 [pip3] triton==2.0.0 [conda] Could not collect cc @ngimel @csarofeen @ptrblck @xwang233
4
2,585
101,525
DISABLED test_noncontiguous_samples_matmul_cuda_float32 (__main__.TestCommonCUDA)
module: cuda, triaged, module: flaky-tests, skipped
Platforms: inductor This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_noncontiguous_samples_matmul_cuda_float32&suite=TestCommonCUDA) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/undefined). Over the past 3 hours, it has been determined flaky in 13 workflow(s) with 13 failures and 13 successes. **Debugging instructions (after clicking on the recent samples link):** DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets: 1. Click on the workflow logs linked above 2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work. 3. Grep for `test_noncontiguous_samples_matmul_cuda_float32` 4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs. Test file path: `test_ops.py` cc @ptrblck
53
2,586
101,506
Support pipeline parallelism with PyG
oncall: distributed, triaged, topic: new features
### πŸš€ The feature, motivation and pitch I would like to request support for pipeline parallelism for data constructed by PyG (PyTorch Geometric). Currently, PyG provides excellent capabilities for GNN modeling and processing, our teams use PyG to construct graph data for the drug field. However, there is a lack of native support for pipeline parallelism, which can significantly improve the performance and scalability of GNN training on large-scale graphs. However, PyTorch does not support pipeline parallelism through the torch.distributed.pipeline.sync.Pipe modules, these modules are not directly compatible with PyG's graph-specific dataset. As a result, users currently need to implement custom solutions or workarounds to enable pipeline parallelism in PyG, which can be challenging and error-prone, our team has tried, but there have been no results. Therefore, I kindly request that the PyTorch development team consider adding native support for pipeline parallelism. Such support would greatly benefit the PyG community, enabling faster and more efficient training of GNN models on large-scale graphs. Thank you for considering this request. Please let me know if there are any questions or if I can provide further assistance in this matter. ### Alternatives The main reason PyG data cannot be used with Pipeline is the inability to locate and correctly split the tensors within the data when dividing the minibatch into microbatches. PyG's tensors are wrapped within a dictionary-like data structure and are not directly exposed. Our team has attempted two approaches to address this issue. The first approach involved manually splitting and recombining PyG data, but it was challenging to ensure the preservation of the graph topology within each data instance. The second approach attempted to load a certain number of minibatches (chunks) in dataloder first, combine them, and pass them into the Pipeline for internal microbatch splitting. However, this method encountered issues when invoking checkpoints during subsequent stages. Regrettably, neither of these methods proved effective. It seems that microbatch requires specific handling of tensors. ### Additional context _No response_ cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
0
2,587
101,505
Investigate random sequence number broadcast initially incorrect
oncall: distributed, triaged
### πŸ› Describe the bug https://github.com/pytorch/pytorch/pull/101422 removes an implementation of generating a random sequence number and communicating it via the store, instead opting to start off groups at a sequence number of 0. However, using a random initial sequence number is better for debugging UX as it allows users to easily tell the difference between different collectives corresponding to different subgroups. We should root cause and fix the store issue and re-enable. ### Versions main cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
0
2,588
101,502
onnx runtime error
module: onnx, triaged
### πŸ› Describe the bug I have already converted my pytorch model to onnx, but I encountered new bugs when converting onnx to engine and using onnxruntime to infer onnx model. When I do onnx inference: `onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Expand node. Name:'/encoder/node_encoder/Expand' Status Message: /encoder/node_encoder/Expand: left operand cannot broadcast on dim 1 LeftShape: {1,6,32}, RightShape: {1,33,32}` Even if I fix the code concerning the shape error, and convert the model to onnx once more, the onnx inference would report new bugs concerning the shape in following calculations in the model: `onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Add node. Name:'/aggregator/Add_80' Status Message: /aggregator/Add_80: right operand cannot broadcast on dim 0 LeftShape: {162,15}, RightShape: {152,15} ` Seems the bug fixing has no end. Is there any efficient way to solve the problem, thank you. ### Versions 1st error related codes in the model: ``` feat_embedding_packed = pack_padded_sequence(feat_embedding_batched, seq_lens_batched, batch_first=True, enforce_sorted=False) ``` 2ed error related codes in the model: ``` # Dummy encodings for goal nodes dummy_enc = torch.zeros_like(node_encodings) node_encodings = torch.cat((node_encodings, dummy_enc), dim=1) # Gather node encodings along traversed paths node_enc_selected = node_encodings[batch_idcs, traversals_batched] ```
2
2,589
101,470
[bazel] add inductor to bazel build
module: build, triaged, module: bazel
### πŸš€ The feature, motivation and pitch We should work towards allowing torch.compile() to be run from the bazel build. After https://github.com/pytorch/pytorch/issues/101469 The next step would be enabling inductor backend in the bazel build. ### Alternatives _No response_ ### Additional context _No response_ cc @malfet @seemethere
0
2,590
101,463
Regression in NCCL error handling
oncall: distributed
### πŸ› Describe the bug There is a regression in NCCL error handling after https://github.com/pytorch/pytorch/pull/97066 on PyTorch master. If one rank of a training job is killed/dies, some ranks of a training job get stuck with this traceback of the workCleanupLoop: ``` Thread 9 (Thread 0x1554539fc700 (LWP 153338)): #0 0x0000155520c47cdc in ?? () from lib/libcudart.so.11.0 #1 0x0000155520c14bde in ?? () from lib/libcudart.so.11.0 #2 0x0000155520c4a915 in cudaGetLastError () from lib/libcudart.so.11.0 #3 0x00001555097933b5 in c10d::ProcessGroupNCCL::WorkNCCL::finishedGPUExecutionInternal() const () from lib/python3.8/site-packages/torch/lib/libtorch_cuda.so #4 0x0000155509794008 in c10d::ProcessGroupNCCL::WorkNCCL::isCompleted() () from lib/python3.8/site-packages/torch/lib/libtorch_cuda.so #5 0x0000155509793a25 in c10d::ProcessGroupNCCL::workCleanupLoop() () from lib/python3.8/site-packages/torch/lib/libtorch_cuda.so #6 0x000015552081aa93 in std::execute_native_thread_routine (__p=<optimized out>) at ../../../../../libstdc++-v3/src/c++11/thread.cc:82 #7 0x00001555554f5609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #8 0x00001555552b4133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ``` Basically the `workCleanupLoop` is stuck on `cudaGetLastError` which is blocked since NCCL kernels are locking up the GPU. As a result, `workCleanupLoop` never gets a chance to `abort` the communicators and recover. This is essentially the potential issue reported in https://github.com/pytorch/pytorch/pull/97066#discussion_r1164692531. I was able to reliably reproduce the issue on a job with 24 ranks and manually killing one rank. After this 9 ranks did not exit and were stuck with the traceback above. As mentioned in https://github.com/pytorch/pytorch/pull/97066#discussion_r1164692531, we should probably add a separate lightweight thread whose sole responsibility is to abort NCCL kernels that run into errors. ### Versions PyTorch: master CUDA: 12.0 NCCL: 2.17.1 cc @mrshenli @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
10
2,591
101,458
Do automatic replacement of scaled dot product with fast sdpa implementation in HF models.
triaged, module: fsdp, oncall: pt2, module: inductor
#100609 adds sdpa patterns to pattern matcher that are seen in models from HF suite. The status of the benchmarked models is as follows: - [x] Albert - [ ] AllenAILongformer broken on master - [x] Bart - [x] Bert - [ ] BlenderBot - has a different pattern - [x] CamemBert - [ ] Deberta custom autograd functions - [x] DistilBert - works, but will need a different pattern for const folding - [ ] DistillGPT - has causal mask, hard to match - [x] Electra - works - [ ] GPT2 - has causal mask - [x] LayoutLM - [ ] M2M100 has a different pattern - [ ] MBart has a different pattern - [ ] MT5 - non-zero (maybe causal) bias - [x] Megatron - [x] MobileBert - [ ] OPT - does additional clipping, different math from _sfdp_params_check - [ ] PLBart - non-0 attn mask - [ ] Pegasus - causal mask, can't pattern match - [x] Roberta - [ ] T5 - non-zero mask - [ ] TrOCR - non-zero (possibly causal) mask - [ ] XGLM - additional clipping, different math - [ ] XLNet - different formulas - [x] YituTechConvBert However, to make this actually show up in the benchmarks we need to 1) do constant folding to get rid of all-zero mask that's getting added to attention scores and forces sdpa to go on a slow path cc @zhaojuanmao @mrshenli @rohan-varma @awgu @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire @eellison 2) figure out either a way to pattern match with lowmem dropout, or run pattern-matching pass without lowmem dropout off, and if no match encountered, switch to lowmem dropout cc @jancel 3) dynamic shapes present additional complications. During tracing, either memory efficient or flash or slow math implementation will be picked depending on the parameters, and, since (I think) we don't generate any guards for it, it will be used for other sizes that are later encountered, which will either lead to suboptimal performance or even runtime crashes, if fast implementation from trace cannot be used, cc @voznesenskym
2
2,592
101,444
RuntimeError: Triton Error [CUDA]: device-side assert triggered when trying torch.compile max-autotune on nanoGPT
triaged, oncall: pt2
### πŸ› Describe the bug Tried to run `torch.compile(model, mode='max-autotune')` on nanoGPT, got some cuda errors such as `Triton Error [CUDA]: device-side assert triggered` when doing inference. I originally found this when experimenting with quantization, but it reproduces without quantization. Repro script (requires nanoGPT repo): https://gist.github.com/vkuzo/7352cf7b18fd2602668fb3d43ad9467a Stack trace: https://gist.github.com/vkuzo/57225adfacd7779309fd5444a5f80bcf ### Versions https://gist.github.com/vkuzo/a5fbfc5905f9bd33732f4f73ec6ce0f4 cc @ezyang @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
0
2,593
101,443
Enhance FSDP debugability
oncall: distributed, triaged, module: fsdp
### πŸš€ The feature, motivation and pitch Some items we can add under torch_distributed_debug mode to improve debugability of FSDP: - Shared parameter detection - Logging when backward hooks are fired (per parameter or per individually wrapped FSDP unit), to debug convergence / parity with DDP issues - These should also work with the composable API. ### Alternatives _No response_ ### Additional context _No response_ cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
2
2,594
101,564
not yet implemented the batching rule for torchaudio::_lfilter
triaged, module: batching, module: functorch
[W BatchedFallback.cpp:82] Warning: There is a performance drop because we have not yet implemented the batching rule for torchaudio::_lfilter. Please file us an issue on GitHub so that we can prioritize its implementation. (function warnFallback) cc @zou3519 @Chillee @samdow @kshitij12345 @janeyx99
0
2,595
101,428
2D inputs to linear layers run up to 25% slower than 4D ones on some Nvidia GPUs
triaged, module: cublas
### πŸ› Describe the bug On an Nvidia RTX 3090 GPU, 2D inputs to linear layers result in up to 25% slower performance than 4D inputs -- even though the number of elements in the input is the same (e.g. input shapes `[B, C]` vs `[B, 1, 1, C]`). The difference is smaller on an RTX A5000 GPU, and almost disappears on an A100 80GB GPU. Averages of 100 runs: | Input shape | RTX 3090 | RTX A5000 | A100 80GB | | -------- | ------- | ------- | ------- | | [524288, 256] | 51.9 ms | 59.0 ms | 35.1 ms | | [524288, 1, 256] | 51.4 ms | 59.3 ms | 34.9 ms | | [524288, 1, 1, 256] | 40.1 ms | 54.8 ms | 34.5 ms | The numbers above are for Pytorch 2.0.1 with CUDA 11.7; for RTX 3090, the same behavior was observed for Pytorch 1.13.1, both with CUDA 11.7 and CUDA 11.8. Benchmark code: ``` import torch from torch.utils import benchmark def main(): torch.manual_seed(1) device = torch.device('cuda') print(torch.__version__, torch.version.cuda, torch.cuda.get_device_name(device)) net = torch.nn.Sequential(*[torch.nn.Linear(256, 256) for _ in range(8)]) net = net.to(device) x = torch.rand(2 ** 19, 256, device=device) for _ in range(3): print(f'\n{x.shape=}, {x.is_contiguous()=}') tmr = benchmark.Timer('net(x)', globals={'net': net, 'x': x}) print(tmr.timeit(100)) x = x.unsqueeze(1) if __name__ == '__main__': main() ``` ### Versions ``` Collecting environment information... PyTorch version: 2.0.1+cu117 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A OS: Debian GNU/Linux 11 (bullseye) (x86_64) GCC version: (Debian 10.2.1-6) 10.2.1 20210110 Clang version: Could not collect CMake version: version 3.18.4 Libc version: glibc-2.31 Python version: 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.10.0-21-amd64-x86_64-with-glibc2.31 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090 Nvidia driver version: 470.129.06 cuDNN version: Could not collect 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 Address sizes: 46 bits physical, 48 bits virtual CPU(s): 24 On-line CPU(s) list: 0-23 Thread(s) per core: 2 Core(s) per socket: 12 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz Stepping: 7 CPU MHz: 1278.993 CPU max MHz: 4800.0000 CPU min MHz: 1200.0000 BogoMIPS: 6999.82 Virtualization: VT-x L1d cache: 384 KiB L1i cache: 384 KiB L2 cache: 12 MiB L3 cache: 19.3 MiB NUMA node0 CPU(s): 0-23 Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Retbleed: Mitigation; Enhanced IBRS Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; TSX disabled 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 dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512_vnni md_clear flush_l1d arch_capabilities Versions of relevant libraries: [pip3] numpy==1.24.2 [pip3] torch==2.0.1 [pip3] torch-tb-profiler==0.4.1 [pip3] triton==2.0.0 [conda] Could not collect ``` cc @csarofeen @ptrblck @xwang233
1
2,596
101,415
import functorch.dim monkeypatches torch
triaged, module: functorch
### πŸ› Describe the bug Since it's in core now, we can just upstream the necessary changes into the main implementations themselves. While we still monkeypatch, there is a risk the monkeypatches are not exactly semantics preserving. However, I took a quick look and they seem relatively benign (they only trigger alternate behavior when first class dims are involved.) cc @zou3519 @Chillee @samdow @kshitij12345 @janeyx99 @zdevito ### Versions master
1
2,597
101,413
SymIntify first class dims
topic: not user facing
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * __->__ #101413 * #101409 To get pybind translation for SymInt, I just use the stock pybind11 from PyTorch proper. This is kind of annoying but since first class dims are now in tree I don't think there is too much benefit in forcing us to stay this way. Signed-off-by: Edward Z. Yang <ezyang@meta.com>
4
2,598
101,407
Delete old vmap prototype
triaged, better-engineering, module: functorch
We have an old vmap prototype (basically, all of the `LegacyBatched*` or `LegacyVmap*` files (see image). We should delete it, because it continues to confuse people at a rate of 1-2 people per month. ![image](https://github.com/pytorch/pytorch/assets/5652049/91b2a2ea-7686-47c2-b0f1-90a0eab70773) ## Plan of action torch.autograd.functional still uses the old vmap prototype. In general we're moving away from torch.autograd.functional, but it still needs vmap. We should attempt to replace torch.autograd.functional's usage of vmap with the new torch.vmap, verify that it passes all tests, and finally delete the old vmap prototype. cc @Chillee @samdow @soumith @kshitij12345 @janeyx99
0
2,599
101,404
problem of compilation for torch2.0
needs reproduction, module: build, triaged, module: third_party
### πŸ› Describe the bug Hello, I want to compile torch2.0 with -D_GLIBCXX_USE_CXX11_ABI=1, However, I met some problems. <img width="755" alt="ζ•θŽ·" src="https://github.com/pytorch/pytorch/assets/45058324/b9ffb0ed-e627-4a8d-a15f-1f9a9ab51bd1"> How can I solve this? ### Versions cuda:11.7 driver version: 470.103.01 gcc: 10.2 cc @malfet @seemethere @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh @anijain2305
3
2,600
101,402
DataParallel for nested modules
oncall: distributed
### πŸ› Describe the bug My module is not on the same devices ` class ImageEncoder(nn.Module): def __init__(self): super(ImageEncoder, self).__init__() resnet_model = torchvision.models.resnet18() self.model = torch.nn.Sequential(*(list(resnet_model.children())[:-1])) def forward(self, x): print('x', x.device) x = x.float() print('x.float', x.device) print('model', self.model[4][0].conv1.weight.device) output = self.model(x).squeeze(-1).squeeze(-1) print('output', output.device) return output class VideoEncoder(nn.Module): def __init__(self): super(VideoEncoder, self).__init__() self.model = ImageEncoder() def forward(self, x): x = self.model(x.flat(0,1)) return x class FinalModel(nn.Module): def __init__(self): supe(FinalModel, self).__init__() self.model = VideoEncoder() def forward(self, x): return self.model(x) def data_to_cuda(data): for d in data: if(type(data[d]) == dict): for p in data[d]: data[d][p] = data[d][p].cuda() else: data[d] = data[d].cuda() return data model = FinalModel() model= nn.DataParallel(model, device_ids=[0,1]) model = model.cuda() loss = torch.tensor(0.0).cuda() losses = [] optimizer = Adam(model.parameters(), lr = 0.0001) for data in train_data: data = data_to_cuda(data) predicted_labels = model(data) loss_i = compute_loss(data['labels'], predicted_labels) loss = loss + loss_i if(self.steps % backprop_every == 0): loss = loss / self.backprop_every loss.backward() optimizer.step() optimizer.zero_grad() loss = torch.tensor(0.0).cuda() losses.append(loss.item()) steps += 1 ` For this I am getting following result: ` x cuda:0 x cuda:1 x.float cuda:1 model cuda:0 x.float cuda:0 model cuda:0 output cuda:0 return F.conv2d(input, weight, bias, self.stride, RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! ` ### Versions pytorch 1.10.1 gpu V100 cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu
1