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
|
---|---|---|---|---|---|
201 | 111,453 |
Turn keep_inference_input_mutations on in aot_eager
|
ciflow/trunk, module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111453
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 1 |
202 | 111,450 |
[FX Quant] operator.matmul (@ operator ) is not converted to torch.ops.quantized.matmul
|
oncall: quantization, triaged
|
### 🐛 Describe the bug
Maybe, this line? only torch.matmul is included here.
https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/fx/_lower_to_native_backend.py#L359
### Versions
main branch
cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel
| 4 |
203 | 111,448 |
DISABLED test_compile_dtensor_redistribute_backward (__main__.TestDTensorCompileE2E)
|
oncall: distributed, triaged, skipped
|
Platforms: linux
This test was disabled because it is failing on main branch ([recent examples](http://torch-ci.com/failure/distributed%2F_tensor%2Ftest_dtensor_compile.py%3A%3ATestDTensorCompileE2E%3A%3Atest_compile_dtensor_redistribute_backward)).
This starts to fail on periodic multigpu job https://hud.pytorch.org/pytorch/pytorch/commit/6f06832219e1059ea794c9e1a57a81ed9448a7a1. The root cause is unclear
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu
| 1 |
204 | 111,447 |
Nvfuser code base nuke
|
open source, ciflow/trunk
|
removing nvfuser code base.
| 3 |
205 | 111,444 |
[vision hash update] update the pinned vision hash
|
open source, ciflow/trunk, topic: not user facing, ciflow/inductor
|
This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/main/.github/workflows/_update-commit-hash.yml).
Update the pinned vision hash.
| 4 |
206 | 111,443 |
[MPS] Add torch.cummin and torch.cummax
|
triaged, open source, release notes: mps, ciflow/mps
|
Adds support for torch.cummin and torch.cummax to the MPS backend.
| 1 |
207 | 111,441 |
torch.compile of simple loop takes 34 seconds
|
oncall: pt2, module: higher order operators
|
### 🐛 Describe the bug
I'm converting some numpy code, basically it's this for loop. It takes 30 seconds to compile.
Is it too much to ask to make it faster? :)
Works great otherwise!
```
for step_idx in range(num_steps):
X = hsqrt * np.random.randn(B, d)
losses = np.einsum("BD,BD->B", E, X)
E -= alpha * np.einsum("BD,B->BD", X, losses)
traj[step_idx] = E
return np.sum(traj * traj, axis=2)
```
### Error logs
_No response_
### Minified repro
```
import time
import torch
import numpy as np
class timeit:
def __init__(self, tag=""):
self.tag = tag
def __enter__(self):
if torch.cuda.is_available():
torch.cuda.synchronize()
self.start = time.perf_counter()
return self
def __exit__(self, *args):
if torch.cuda.is_available():
torch.cuda.synchronize()
self.end = time.perf_counter()
interval_ms = 1000 * (self.end - self.start)
print(f"{interval_ms:8.2f} {self.tag}")
@torch.compile
def getNormsSq0(errors):
return (errors*errors).sum(axis=1)
@torch.compile
def trajH0(h, B, alpha, num_steps):
"""(normalize for total(h)=1)
Simulate trajectories of fixed point equation
e=e-alpha x <e, x>
where x is a Gaussian RV with diagonal covariance entries h
p: power-law decay constant of covariance eigenvalues
d: number of dimensions
B: batch size (number of trajectories to sample)
alpha: step size
num_steps: how many steps to run for
Returns (num_steps, B) vector of ||e||^2
"""
# h = h / np.sum(h)
hsqrt = np.sqrt(h)
E = np.ones((B, d))
E = np.random.randn(B, d)
traj = np.zeros((num_steps, B, d))
for step_idx in range(num_steps):
X = hsqrt * np.random.randn(B, d)
losses = np.einsum("BD,BD->B", E, X)
E -= alpha * np.einsum("BD,B->BD", X, losses)
traj[step_idx] = E
return np.sum(traj * traj, axis=2)
d = 1000
h = np.arange(1, d + 1)
h = h ** -1.1
num_steps=100
d = h.shape[0]
a = 2/(2*h.max() + h.sum())
#with timeit("regular"):
# means = getNormsSq0(trajH(h, B=1000, alpha=a, num_steps=num_steps))
with timeit("compiled"):
means = getNormsSq0(trajH0(h, B=1000, alpha=a, num_steps=num_steps))
with timeit("compiled+cuda"):
with torch.device("cuda"):
means = getNormsSq0(trajH0(h, B=1000, alpha=a, num_steps=num_steps))
```
### Versions
This is on Google Colab and PyTorch nightly
```
PyTorch version: 2.2.0.dev20231017+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.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 14.0.0-1ubuntu1.1
CMake version: version 3.27.6
Libc version: glibc-2.35
Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.120+-x86_64-with-glibc2.35
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-40GB
Nvidia driver version: 525.105.17
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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): 12
On-line CPU(s) list: 0-11
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) CPU @ 2.20GHz
CPU family: 6
Model: 85
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
Stepping: 7
BogoMIPS: 4400.41
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 ibrs_enhanced fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512_vnni md_clear arch_capabilities
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 192 KiB (6 instances)
L1i cache: 192 KiB (6 instances)
L2 cache: 6 MiB (6 instances)
L3 cache: 38.5 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-11
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Vulnerable; SMT Host state unknown
Vulnerability Meltdown: Not affected
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: Vulnerable
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Vulnerable
Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] pytorch-triton==2.1.0+6e4932cda8
[pip3] torch==2.2.0.dev20231017+cu121
[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 @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @zou3519
| 3 |
208 | 111,440 |
Add support for sym_ite
|
ciflow/trunk, release notes: fx, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111440
This PR supports sym_ite. This is useful for converting SymBool to SymInt in e.g. #109916. Internally, it uses sympy.Piecewise. We cannot use sympy.ITE because it expects the arguments and output all to be boolean type but we want return SymInt type when converting a SymBool to SymInt. So we use sympy.Piecewise to denote the symbolic relationship.
Note that this pr uses the range analysis for sympy.Piecewise implemented in https://github.com/pytorch/pytorch/blob/main/torch/utils/_sympy/value_ranges.py.
Test Plan:
See added test.
| 1 |
209 | 111,438 |
Avoid c++ exception and stack trace
|
fb-exported, release notes: jit
|
Summary:
When raising an exception here this causes pybind11's dispatcher to kick in, which causes aiplatform's logic to kick in (aiplatform::error_reporting::util::printAddressesWithBestEffortLocationInfo), which ultimately uses `folly::symbolizer::Symbolizer::symbolize` for building up the stack trace. In 3.8 this uses about 3.62% of the CPU time per pyperf (https://fburl.com/scuba/pyperf_experimental/on_demand/oi554uvy). In Cinder 3.8 for some reason this is worse - using 5.94% of the CPU.
This exception is happening when doing a hasattr() on `prims` for things like `bitwise_left_shift` which don't exist: https://www.internalfb.com/code/fbsource/[2d695f650d00]/fbcode/caffe2/torch/_inductor/lowering.py?lines=590
That exception is ultimately going to be swallowed anyway, and the stack trace has no meaningful value. Furthermore because this is kind of an expected outcome in the code versus some random C++ exception the stack trace is less valuable as well.
This changes this to return a (None, None) on the failure case instead of returning a valid op/overload list, avoiding the exception, and reclaiming the 3.62%-5.94% of time.
Test Plan: Existing CI and perf run: https://fburl.com/scuba/pyperf_experimental/on_demand/oi554uvy
Differential Revision: D50018789
| 3 |
210 | 111,436 |
[dynamo] Inlining Translator will compile partial subgraphs
|
open source, module: dynamo, ciflow/inductor, release notes: dynamo
|
Reduce number of backend compiler invocations and number of compiled artifacts
Fixes: https://github.com/pytorch/pytorch/issues/111003
TODO:
1. Handle backedges in nested graph breaks properly (now we just killswitch to eager as long as one of the outer functions has a backedge. Might be a little too strict - let's try to accomodate backedges in outer functions if possible).
2. May not handle certain edge-cases properly, need to scrutinize.
- [ ] Test for bad interaction with generator - e.g. generator calling into function with graph breaks.
cc @voznesenskym @jansel @yanboliang
| 5 |
211 | 111,434 |
[Inductor] Support user defined triton kernels in inductor
|
ciflow/trunk, module: inductor, module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111627
* __->__ #111434
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 3 |
212 | 111,429 |
[vision hash update] update the pinned vision hash
|
open source, ciflow/trunk, topic: not user facing, ciflow/inductor
|
This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/main/.github/workflows/_update-commit-hash.yml).
Update the pinned vision hash.
| 4 |
213 | 111,427 |
[fix] accounting for dilation in pool padding assertion
|
module: nn, triaged, open source
|
Fixes #7541
cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
| 3 |
214 | 111,426 |
HSTU large model loading using in-tensor multi-threading
|
caffe2, fb-exported, topic: not user facing
|
Summary:
Zion-4s core has poor perf when it comes to reading the large tensor (e.g. 300G), no matter for manifold downloading or reading from files. In this diff, I changed the getRecord function from single thread to multiple threads by passing multiple readers to getRecord function and access the same record at different chunks with different readers.
We control the number of additional reader with the`sigrid_model_manager_additional_reader` flag. The default value is 0. When `additional_reader=2`, we allocate `2` extra read client threads.
Profiler Results:
**multi readers**
ods counter:
https://fburl.com/ods/s12q1t6j
strobelight:
https://fburl.com/strobelight/r1jj17qs
https://fburl.com/strobelight/702j72k8
download:
https://fburl.com/scuba/download_client_stats/5fh7nlu7
{F1118644555}
**single reader**
ods counter:
https://fburl.com/ods/m9sv2sp0
strobelight:
https://fburl.com/strobelight/emc9q6z0
https://fburl.com/strobelight/mn23ctda
download:
https://fburl.com/scuba/download_client_stats/xsl3pq8y
{F1118644696}
Test Plan:
**unit test**
```
buck2 run @//mode/dev //caffe2/caffe2/serialize:inline_container_test
```
**Local model loading**
```
SIGRID_ADDITIONAL_READER=4 SIGRID_MAX_RSS_SIZE_BYTES=751619276800 PYTORCH_PREDICTOR_ENABLE_XL_FORMAT_V2=true PYTORCH_PREDICTOR_ENABLE_XL_FORMAT_V2_INPLACE_LOADING=true GIF_LOAD_LOCAL_NET=true RUN_D2H_TOGETHER_WITH_EXECUTION_STREAM=true EVENT_POOL_ENABLE_BLOCKING_SYNC=false ENABLE_DEPLOY_INPLACE_LOADING=true TGIF_REPLICATE_MERGE_BY_TEMPFILE=true USE_STATIC_PATH=1 USE_ALL_TO_ONE_OP=false MAX_NUM_ADS=10240 REQUEST_BATCHING_PARAM_OVERRIDE="max_batch_size|${MAX_NUM_ADS};batch_time_us|50000" NUM_DEPLOY_INTERPRETER=32 NUM_DESER_AND_REMOTE_RO_CPU_WORKERS=20 MODULE_NUM_WORKERS_PER_GPU='merge|8;remote|0' MODEL_ID=962580335 SNAPSHOT_ID=0 SERVER_PORT=7456 CUDA_VISIBLE_DEVICES_FOR_PREDICTOR="4,5,6,7" CPU_NUMA_NODES_FOR_PREDICTOR="2,3" ENABLE_THRIFT_WARMUP=false hpc/inference/scripts/gif/prospector/1_cards/launch_gpu_sigrid_predictor_task_0.sh 2>&1 | tee predictor.txt
```
Load from local: P850152856
Load from manifold: P850716434
**Vanguard model loading**
```
VANGUARD_ENV=dev vg serving-test -m 959387101 -s 0 --spec ~/fbsource/fbcode/feed_ranking_infra/vanguard/specs/umia_hstu_dev_xlv2.yaml 2>&1 | tee tmp.txt
```
1TB model 959387101
baseline: 25min, P844194768
pkg a44e273: 9min, P848107231
Prod model 960881812
baseline: 15min
pkg a44e273: 5min, P850724551
**Inference eval**
```
VANGUARD_ENV=dev vg predictor launch -m 960881812 -s 602 --spec ~/fbsource/fbcode/feed_ranking_infra/vanguard/specs/umia_hstu_dev_xlv2.yaml 2>&1 | tee tmp.txt
pkg_version: a44e273
## mvai_umia_hstu_fbr:recurring_eval
hg checkout 1df2db0a09e755e80e7b3a7943f49c1f5e71567b
light -d ~/fbsource/fbcode/minimal_viable_ai -d ~/fbsource/fbcode/hpc/ ~/fbsource/fbcode/minimal_viable_ai/sandbox/eval/predictor_eval.py --model-entity-id 960881812 --snapshot 602 --eval-config umia/fbr_hstu_gif_ts_sampling_diversity_disable_both --tier feed.sigrid.predictor.benchmark.vg_tissue030_dev --num-requests 100000 --eval-ts 2023-10-10+11:00:99 2>&1 | tee eval.txt
```
baseline: https://fburl.com/mlhub/yvmx9ald
> I1010 09:11:52.131 4846 predictor_eval.py:558 [Rank 0] ## Eval Results: {"recall@1/vvp100": 0.013800769113004208, "recall@5/vvp100": 0.049447201192379, "recall@20/vvp100": 0.11355383694171906, "recall@100/vvp100": 0.17039309442043304, "recall@200/vvp100": 0.25405290722846985, "recall@500/vvp100": 0.4610816240310669, "recall@1000/vvp100": 0.637019693851471, "recall@1250/vvp100": 0.6741645932197571, "num_interactions/vvp100": 83826.0}
pkg: a44e273 with multi-thread: P850634507
> I1010 11:15:36.873 4038353 predictor_eval.py:558 [Rank 0] ## Eval Results: {"recall@1/vvp100": 0.01417488232254982, "recall@5/vvp100": 0.050109997391700745, "recall@20/vvp100": 0.1138257384300232, "recall@100/vvp100": 0.17026753723621368, "recall@200/vvp100": 0.25343313813209534, "recall@500/vvp100": 0.4619934856891632, "recall@1000/vvp100": 0.6371392011642456, "recall@1250/vvp100": 0.6746780872344971, "num_interactions/vvp100": 93684.0}
Differential Revision: D49969050
| 3 |
215 | 111,424 |
Multi-node torchrun training job does not use IB Network
|
oncall: distributed
|
### 🐛 Describe the bug
I am running a slurm job that runs on 2 nodes connected with Infini-Band. I have added below configs to the slurm batchf file:
export HYDRA_FULL_ERROR=1
export NCCL_DEBUG=INFO
#export NCCL_SOCKET_IFNAME=ibp60s0
export NCCL_IB_DISABLE=0
export NCCL_IB_CUDA_SUPPORT=1
#export NCCL_SHM_DISABLE=1
#export GLOO_SOCKET_IFNAME=ib0,ib1,ib2,ib3,ib4,ib5,ib6,ib7
export CUDA_DEVICE_MAX_CONNECTIONS=1
export NCCL_SOCKET_IFNAME=^lo,docker,virbr,vmnet,vboxnet,wl,ww,ppp,eth,bond
export MASTER_PORT=$(expr 10000 + $(echo -n $SLURM_JOBID | tail -c 4))
export WORLD_SIZE=$(($SLURM_NNODES * $SLURM_NTASKS_PER_NODE))
echo "WORLD_SIZE="$WORLD_SIZE
master_addr=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n 1)
export MASTER_ADDR=$master_addr
echo "MASTER_ADDR="$MASTER_ADDR
module load cuda-dcgm/3.1.3.1
module load cuda12.1
module load docker
module load openmpi/gcc/64/4.1.2
module load openmpi4/gcc/4.1.2
module load ucx/1.10.1
module load gcc/11.2.0
**Error:** In the logs the job fails to use the Net/IB but instead relies on NET/SOCKET. The traffic should pass through the Infiniband. Is there any specific config I'm missing here?
**Logs:**
node013:37715:38896 [0] NCCL INFO NET/IB : No device found.
node013:37715:38896 [0] NCCL INFO NCCL_IB_DISABLE set by environment to 0.
node013:37715:38896 [0] NCCL INFO NCCL_SOCKET_IFNAME set by environment to ^lo,docker,virbr,vmnet,vboxnet,wl,ww,ppp,eth,bond
**node013:37715:38896 [0] NCCL INFO NET/IB : No device found.**
node013:37715:38896 [0] NCCL INFO NCCL_SOCKET_IFNAME set by environment to ^lo,docker,virbr,vmnet,vboxnet,wl,ww,ppp,eth,bond
node013:37715:38896 [0] NCCL INFO NET/Socket : Using [0]ib0:10.22.0.13<0> [1]ib1:10.22.1.13<0> [2]ib2:10.22.2.13<0> [3]ib3:10.22.3.13<0> [4] ib4:10.22.4.13<0> [5]ib5:10.22.5.13<0> [6]ib6:10.22.6.13<0> [7]ib7:10.22.7.13<0>
node013:37715:38896 [0] NCCL INFO Using network Socket
### Versions
Collecting environment information...
PyTorch version: 2.1.0a0+29c30b1
Is debug build: False
CUDA used to build PyTorch: 12.2
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.27.1
Libc version: glibc-2.35
Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-6.2.0-34-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.2.128
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA H100 80GB HBM3
GPU 1: NVIDIA H100 80GB HBM3
GPU 2: NVIDIA H100 80GB HBM3
GPU 3: NVIDIA H100 80GB HBM3
GPU 4: NVIDIA H100 80GB HBM3
GPU 5: NVIDIA H100 80GB HBM3
GPU 6: NVIDIA H100 80GB HBM3
GPU 7: NVIDIA H100 80GB HBM3
Nvidia driver version: 535.104.12
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.4
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, 57 bits virtual
Byte Order: Little Endian
CPU(s): 224
On-line CPU(s) list: 0-223
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Platinum 8480+
CPU family: 6
Model: 143
Thread(s) per core: 2
Core(s) per socket: 56
Socket(s): 2
Stepping: 6
CPU max MHz: 3800.0000
CPU min MHz: 800.0000
BogoMIPS: 4000.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 ss e2 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 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 cat_l2 cdp_l3 invpcid_single cdp_l2 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 avx512 f 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 avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke wait pkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b e nqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 5.3 MiB (112 instances)
L1i cache: 3.5 MiB (112 instances)
L2 cache: 224 MiB (112 instances)
L3 cache: 210 MiB (2 instances)
NUMA node(s): 2
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,7 2,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148 ,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218 ,220,222
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,7 3,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149 ,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219 ,221,223
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: 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] mypy-extensions==1.0.0
[pip3] numpy==1.22.2
[pip3] nvidia-pytriton==0.3.1
[pip3] pytorch-lightning==2.0.7
[pip3] pytorch-quantization==2.1.2
[pip3] torch==2.1.0a0+29c30b1
[pip3] torch-tensorrt==2.0.0.dev0
[pip3] torchdata==0.7.0a0
[pip3] torchmetrics==0.9.1
[pip3] torchtext==0.16.0a0
[pip3] torchvision==0.16.0a0
[pip3] triton==2.1.0+440fd1b
[pip3] tritonclient==2.38.0.69485441
[conda] Could not collect
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu
| 1 |
216 | 111,423 |
torch.compile x autograd.Function: Make the backward strict mode less srict
|
module: autograd, oncall: pt2, module: dynamo
|
## Issue description
Today, when Dynamo sees an autograd.Function, it traces both the forward() and backward(). Once it has proved safety for both of these APIs, we put a call to the autograd.Function.apply into the generated FX graph.
We trace the backward() underneath a "strict mode". That is, we ban accesses to Tensor.stride() (and a number of other APIs). This is because we don't actually know many properties of the gradients at the time of the forward pass.
We should lift some of these restrictions. For example:
- we should only ban accesses to .stride() on the gradients (I think we ban this on all tensors)
- we should only ban control flow on the .stride(). Things like assertions seem fine.
cc @ezyang @albanD @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 0 |
217 | 111,421 |
[RFC][inductor] FX graph cache: Add support for symbolic shapes
|
release notes: fx, topic: not user facing, module: inductor, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111421
Summary: Add support for caching graphs that have tensor args with symbolic shapes. The high-level appraoch is to serialize guards with the on-disk cached object and validating those guards pass before serving a cached object.
Test Plan: New unit tests
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 3 |
218 | 111,420 |
wrong dependency version required
|
needs reproduction
|
### 🐛 Describe the bug
update nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvtx-cu12 to latest version, ignore dependency break warning by pip
### Versions
PyTorch version: 2.1.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: EndeavourOS Linux (x86_64)
GCC version: (GCC) 13.2.1 20230801
Clang version: Could not collect
CMake version: version 3.27.7
Libc version: glibc-2.38
Python version: 3.11.5 (main, Oct 1 2023, 22:37:52) [GCC 13.2.1 20230801] (64-bit runtime)
Python platform: Linux-6.5.7-arch1-1-x86_64-with-glibc2.38
Is CUDA available: True
CUDA runtime version: 12.2.91
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1050
Nvidia driver version: 535.113.01
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: 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: Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
CPU family: 6
Model: 158
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
Stepping: 10
CPU(s) scaling MHz: 20%
CPU max MHz: 4000.0000
CPU min MHz: 800.0000
BogoMIPS: 4601.60
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 128 KiB (4 instances)
L1i cache: 128 KiB (4 instances)
L2 cache: 1 MiB (4 instances)
L3 cache: 8 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-7
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: 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; IBRS, IBPB conditional, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Mitigation; Microcode
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] lion-pytorch==0.1.2
[pip3] numpy==1.26.1
[pip3] onnx==1.14.1
[pip3] onnxconverter-common==1.14.0
[pip3] onnxruntime==1.16.1
[pip3] onnxruntime-gpu==1.16.1
[pip3] onnxsim==0.4.33
[pip3] torch==2.1.0
[pip3] torchvision==0.16.0
[pip3] triton==2.1.0
[conda] Could not collect
| 1 |
219 | 111,419 |
nonnull error
|
triage review, needs reproduction, module: build
|
### 🐛 Describe the bug
It is impossible to identify the error, it is only known that it is a very serious error that prevents compilation.
```
[ 95%] Building CXX object test_api/CMakeFiles/test_api.dir/dataloader.cpp.o
En el fichero incluido desde /usr/include/c++/12.1.0/memory:63,
desde $DIRTORCH/third_party/googletest/googletest/include/gtest/gtest.h:57,
desde $DIRTORCH/test/cpp/api/dataloader.cpp:1:
En la función miembro static ‘static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*) [with _Tp = unsigned int; bool _IsMove = false]’,
incluido en línea de ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const unsigned int*; _OI = unsigned int*]’ en /usr/include/c++/12.1.0/bits/stl_algobase.h:495:30,
incluido en línea de ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const unsigned int*; _OI = unsigned int*]’ en /usr/include/c++/12.1.0/bits/stl_algobase.h:522:42,
incluido en línea de ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<const unsigned int*, vector<unsigned int> >; _OI = __gnu_cxx::__normal_iterator<unsigned int*, vector<unsigned int> >]’ en /usr/include/c++/12.1.0/bits/stl_algobase.h:529:31,
incluido en línea de ‘_OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<const unsigned int*, vector<unsigned int> >; _OI = __gnu_cxx::__normal_iterator<unsigned int*, vector<unsigned int> >]’ en /usr/include/c++/12.1.0/bits/stl_algobase.h:620:7,
incluido en línea de ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]’ en /usr/include/c++/12.1.0/bits/vector.tcc:244:21:
/usr/include/c++/12.1.0/bits/stl_algobase.h:431:30: error: argument 1 null where non-null expected [-Werror=nonnull]
431 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12.1.0/bits/stl_algobase.h:431:30: nota: en una llamada a la función interna ‘void* __builtin_memmove(void*, const void*, unsigned int)’
cc1plus: algunos avisos se tratan como errores
make[2]: *** [test_api/CMakeFiles/test_api.dir/build.make:118: test_api/CMakeFiles/test_api.dir/dataloader.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8822: test_api/CMakeFiles/test_api.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
```
### Versions
linux
cc @malfet @seemethere
| 1 |
220 | 111,417 |
AOTAutograd generates wrong strides for view+inplace op
|
ezyang's list, oncall: pt2, module: aotdispatch
|
### 🐛 Describe the bug
There is strides mismatch between eager and custom compiler backend like Habana HPU which produce contiguous strides. Here is an example to demonstrate the issue.
```python
import torch
def transpose_inplace_mul(x):
y = x.t()
y.mul_(2)
return y
x = torch.arange(6, dtype=torch.float32).reshape([2, 3])
ref_res = transpose_inplace_mul(x)
print('ref_cpu_x.stride: ', x.stride())
print('ref_cpu_x: ', x.cpu())
print('ref_cpu_res.stride: ', ref_res.stride())
print('ref_cpu_res: ', ref_res.cpu())
x = torch.arange(6, dtype=torch.float32).reshape([2, 3]).to(device='hpu')
compiled_fn = torch.compile(transpose_inplace_mul, backend='aot_hpu_training_backend')
res = compiled_fn(x)
print('hpu_x.strdides:', x.stride())
print('hpu_x: ', x.cpu())
print('hpu_res.strdides:', res.stride())
print('hpu_res: ', res.cpu())
```
Outputs is like below:
```
ref_cpu_x.stride: (3, 1)
ref_cpu_x: tensor([[ 0., 2., 4.],
[ 6., 8., 10.]])
ref_cpu_res.stride: (1, 3)
ref_cpu_res: tensor([[ 0., 6.],
[ 2., 8.],
[ 4., 10.]])
hpu_x.strdides: (3, 1)
hpu_x: tensor([[ 0., 2., 4.],
[ 6., 8., 10.]])
hpu_res.strdides: (2, 1)
hpu_res: tensor([[ 0., 2.],
[ 4., 6.],
[ 8., 10.]])
```
We can see that **hpu_res.strides** is different from the referenced **cpu_res.strides**. And hence output results is different with CPU reference result. For Habana HPU, currently it produces contiguous strides, hence there is a handling (https://github.com/pytorch/pytorch/blob/main/torch/_refs/__init__.py#L466) for non-contiguous output.
We expect AOTAutograd can also handle this. Previously in another issue thread, stride-agnostic mode was mentioned.
The generated functional FX graph as below:
```
class <lambda>(torch.nn.Module):
def forward(self, arg0_1: f32[2, 3]):
t: f32[3, 2] = torch.ops.aten.t.default(arg0_1); arg0_1 = None
mul: f32[3, 2] = torch.ops.aten.mul.Tensor(t, 2); t = None
t_1: f32[2, 3] = torch.ops.aten.t.default(mul); mul = None
t_2: f32[3, 2] = torch.ops.aten.t.default(t_1)
return (t_1, t_2)
```
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @zou3519
### Error logs
_No response_
### Minified repro
_No response_
### Versions
Collecting environment information...
PyTorch version: 2.1.0a0+gitf8b6084
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
CMake version: version 3.27.4
Libc version: glibc-2.31
Python version: 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-163-generic-x86_64-with-glibc2.29
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
| 2 |
221 | 111,416 |
The results of masked.log_softmax on MPS are inconsistent with those on CPU
|
high priority, triage review, module: correctness (silent), module: mps
|
### 🐛 Describe the bug
The output of `masked.log_softmax` on CPU with inputs of cpu_args: [tensor(-8.4844, dtype=torch.float16, requires_grad=True), 0] and cpu_kwargs: {'mask': tensor(False)}, i.e., the masked element, is nan. While the result on MPS is 0. https://github.com/pytorch/pytorch/actions/runs/6542102776/job/17764726988.
`masked.softmax` and `masked.softmin` should have the same issue.
### Versions
PyTorch: main branch.
cc @ezyang @gchanan @zou3519 @kadeng @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
| 0 |
222 | 111,415 |
[dynamo] Eagerly install guards
|
topic: not user facing, module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111726
* #111725
* __->__ #111415
* #111614
* #111717
* #111306
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 2 |
223 | 111,414 |
Minifier doesn't transfer execution states like @torch.no_grad to repro
|
oncall: pt2
|
### 🐛 Describe the bug
if you use something like torch.no_grad or inference_mode in a script you are trying to minify, the minifier reproduces a repro that won't have such context included.
As an example why this is a problem: in any situation involving pattern matching, without torch.no_grad, the graph will try to record gradients making almost all the node values get passed to the output. If you have something like (node1, node2) -> fused_node1and2, if node1 has a gradient then the pattern won't match because it would destroy the output of node 1.
### Error logs
n/a
### Minified repro
if you run the minifier on:
```
import torch
with torch.no_grad():
def do_an_int_mm(x):
x = torch._int_mm(x, x)
return x
x = torch.randint(-128,127, (16,16), dtype=torch.int8)
comp_fn = torch.compile(do_an_int_mm, mode='max-autotune')
print(comp_fn(x).sum())
```
you will get the minified repro without torch.no_grad
```
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
from torch.nn import *
class Repro(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, L_x_ : torch.Tensor):
l_x_ = L_x_
x = torch._int_mm(l_x_, l_x_); l_x_ = None
return (x,)
mod = Repro()
def load_args(reader):
buf0 = reader.storage('dc3464694021bc768a42e2357907046d8d41f683', 256, dtype_hint=torch.int8)
reader.tensor(buf0, (16, 16), dtype=torch.int8, is_leaf=True) # L_x_
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/USERNAME/local/torch_compile_debug/run_2023_10_16_20_00_56_432404-pid_2505787/minifier/checkpoints', autocast=False, backend='inductor')
```
### Versions
Collecting environment information...
PyTorch version: 2.2.0a0+git52e1478
Is debug build: False
CUDA used to build PyTorch: 12.0
ROCM used to build PyTorch: N/A
OS: CentOS Stream 9 (x86_64)
GCC version: (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
Clang version: 16.0.6 (Red Hat 16.0.6-1.el9)
CMake version: version 3.27.0
Libc version: glibc-2.34
Python version: 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.12.0-0_fbk16_zion_7661_geb00762ce6d2-x86_64-with-glibc2.34
Is CUDA available: True
CUDA runtime version: 12.0.140
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA PG509-210
GPU 1: NVIDIA PG509-210
GPU 2: NVIDIA PG509-210
GPU 3: NVIDIA PG509-210
GPU 4: NVIDIA PG509-210
GPU 5: NVIDIA PG509-210
GPU 6: NVIDIA PG509-210
GPU 7: NVIDIA PG509-210
Nvidia driver version: 525.105.17
cuDNN version: Probably one of the following:
/usr/lib64/libcudnn.so.8.8.1
/usr/lib64/libcudnn_adv_infer.so.8.8.1
/usr/lib64/libcudnn_adv_train.so.8.8.1
/usr/lib64/libcudnn_cnn_infer.so.8.8.1
/usr/lib64/libcudnn_cnn_train.so.8.8.1
/usr/lib64/libcudnn_ops_infer.so.8.8.1
/usr/lib64/libcudnn_ops_train.so.8.8.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn.so.8.0.5
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.0.5
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.0.5
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.0.5
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.0.5
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.0.5
/usr/local/cuda-11.7/targets/x86_64-linux/lib/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
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 192
On-line CPU(s) list: 0-191
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Platinum 8339HC CPU @ 1.80GHz
CPU family: 6
Model: 85
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 4
Stepping: 11
Frequency boost: enabled
CPU max MHz: 1801.0000
CPU min MHz: 800.0000
BogoMIPS: 3600.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 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 avx512_bf16 dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni md_clear flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 3 MiB (96 instances)
L1i cache: 3 MiB (96 instances)
L2 cache: 96 MiB (96 instances)
L3 cache: 132 MiB (4 instances)
NUMA node(s): 4
NUMA node0 CPU(s): 0-23,96-119
NUMA node1 CPU(s): 24-47,120-143
NUMA node2 CPU(s): 48-71,144-167
NUMA node3 CPU(s): 72-95,168-191
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: 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; Enhanced IBRS, IBPB conditional, RSB filling
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.12.0
[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==1.4.1
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.3
[pip3] pytorch-lightning==2.0.6
[pip3] pytorch-triton==2.1.0+6e4932cda8
[pip3] torch==2.2.0a0+gita063238
[pip3] torchmetrics==1.0.2
[pip3] torchvision==0.17.0a0+ace9221
[pip3] triton-nightly==2.1.0.dev20230726014945
[conda] blas 1.0 mkl
[conda] magma-cuda117 2.6.1 1 pytorch
[conda] mkl 2023.1.0 h6d00ec8_46342
[conda] mkl-include 2023.1.0 h06a4308_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-lightning 2.0.6 pypi_0 pypi
[conda] pytorch-triton 2.1.0+6e4932cda8 pypi_0 pypi
[conda] torch 2.2.0a0+gita063238 dev_0 <develop>
[conda] torchmetrics 1.0.2 pypi_0 pypi
[conda] torchvision 0.17.0a0+ace9221 dev_0 <develop>
[conda] triton-nightly 2.1.0.dev20230726014945 pypi_0 pypi
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 6 |
224 | 111,413 |
[inductor] Adding a way to force fusion of int_mm with mul
|
module: inductor, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111631
* __->__ #111413
Summary: When doing quantization int_mm -> mul or int_mm -> mul ->
to(dtype) is an extremely common op pattern which is currently not
handled well by inductor. Ideally, since the output of
int_mm has dtype int32 we'd prefer to only realize a smaller dtype like
bf16 or float16. Currently inductor doesn't have a way to force this, in
many cases the mul gets fused with a bunch of subsequent pointwise and reduction
ops from the dequant and following ops creating an increase in memory overhead and a general
slowdown compared to the fused version.
as an external benchmark, for SAM this seems to improve our e2e image encoder times by 3-5% depending on
batchsize and reduces memory usage by 20%
Test Plan: python test/inductor/test_pattern_matcher.py -k
"int_mm_mul"
Reviewers:
Subscribers:
Tasks:
Tags:
| 1 |
225 | 111,412 |
[2/N] Apply clang-tidy to c10 CUDA files
|
module: lint, triaged, open source, ciflow/trunk, topic: not user facing
|
Finally we are able to cover all c10 CUDA files.
| 9 |
226 | 111,411 |
AOTAutograd: avoid intermediate_base logic when all aliased outputs came from a multi_output_view
|
ciflow/inductor, release notes: AO frontend
|
Partially addresses https://github.com/pytorch/pytorch/issues/111081
This fixes the majority of the slowness from https://fb.workplace.com/groups/1405155842844877/permalink/7491314274228973/. In particular, the type of example that suffers the most perf-wise in AOTAutograd looks like this:
```
@torch.compile
def f(x):
intermediate = x.mul(2)
outs = intermediate.unbind(0)
return *outs
x = torch.randn(50, 50, requires_grad=True)
outs = f(x)
sum(outs).sum().backward()
```
There are 50 output tensors in the above function, that all alias each other. AOTAutograd will dutifully exercise its intermediate base [logic](https://github.com/pytorch/pytorch/blob/main/torch/_functorch/aot_autograd.py#L294), and try to regenerate the aliases outside of the compiled `autograd.Function` at runtime, to ensure that the autograd engine is aware of the aliasing.
In this case, this will result in **50 AsStridedBackward nodes in the backward**, because we will fall back to using as_strided to generate each of those 50 outputs. The current PR as is (somewhat unsafely) ensures that the backward graph consists of a single `UnbindBackward`, or a call to `aten.cat()`.
I left a long comment in the code describing the situation, but the core idea is that **autograd does not let you mutate grad_fn of tensor aliases that come from multi-output views**. So if we have `k` outputs that alias each other, but `k-1` of them are aliases that came from multi-output views, then in eager mode, it would not be possible to mutate one of the aliases in a way that would change the grad_fn of any of the other aliases, without causing an error in the backward. So the claim I'm making is that if we hide this aliasing from the autograd engine, then it is impossible for the user to perform any mutations that would cause autograd metadata to diverge between torch.compile and eager in a way that isn't an error in eager mode.
To be fair, I think that taking the approach outlined in https://docs.google.com/document/d/1DlfFq8TKbuAn2zyJxLfoW-X1qkkm5PLdHFtySo03QAk/edit would also help us avoid the as_strided calls in this particularly egregious case, **and** keep the autograd error messages. This relies on both pre-dispatch functionalization being fully hardened **and** adding some pretty invasive changes to AOTAutograd though, and is probably at least several months out.
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111411
| 4 |
227 | 111,410 |
Use of -Wl,--as-needed in cmake config files can leak into third-party users' code and modify their own private libraries
|
module: build, triaged, topic: build
|
https://github.com/pytorch/pytorch/blob/a0632389b78bc52d66cfc31c72ee06df8d8dc986/cmake/public/utils.cmake#L264-L268
Use of `-Wl,--no-as-needed` paired with `-Wl,--as-needed` will corrupt the initial linker state upon returning. This appears to be the cause of the cmake config files providing the same linker args to other projects that depend on pytorch.
It will prevent other projects which also use Wl,--no-as-needed for their own code, from working with pytorch.
The linker has a dedicated flag for this which is much safer:
```
-Wl,--push-state,--as-needed <your args here> -Wl,--pop-state
```
It should be used instead. Reference: https://github.com/mesonbuild/meson/pull/12299
cc @malfet @seemethere
| 0 |
228 | 111,408 |
[vision hash update] update the pinned vision hash
|
open source, ciflow/trunk, topic: not user facing, ciflow/inductor
|
This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/main/.github/workflows/_update-commit-hash.yml).
Update the pinned vision hash.
| 4 |
229 | 111,405 |
adding way to force int_mm fusion
|
module: inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111405
* #111125
Summary: current issue with minified example, i think i fixed the Rocm
issue though.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 1 |
230 | 111,404 |
[HigherOrderOp] Move map_impl to torch.ops.higher_order
|
fb-exported, ciflow/trunk, module: export, release notes: export
|
The purpose of this pr is as titled. Because of some misusage of ghstack, ghimport, and export to github from internal, the stack of https://github.com/pytorch/pytorch/pull/111092 is a mess. I'll try to land them one by one. This is a replacement for #111092 and #111400.
cc @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan
| 5 |
231 | 111,402 |
[inductor] Defer memory operation lowering to wrapper
|
topic: not user facing, module: inductor, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111459
* __->__ #111402
* #111587
Right now, memory ops are being lowered to strings partly in
scheduler.codegen() and partly in wrapper.codegen(). But that makes
static memory planning (which is done entirely in `wrapper.codegen()`)
difficult to implement as information is "lost" by that point.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 3 |
232 | 111,398 |
DISABLED test_fused_int_mm_mul_gating (__main__.TestPaternMatcher)
|
module: rocm, triaged, module: flaky-tests, skipped, module: inductor
|
Platforms: rocm
This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/failure/test_fused_int_mm_mul_gating) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/17728965207).
Over the past 72 hours, it has flakily failed in 6 workflow(s).
**Debugging instructions (after clicking on the recent samples link):**
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Grep for `test_fused_int_mm_mul_gating`
Test file path: `inductor/test_pattern_matcher.py`
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 1 |
233 | 111,397 |
[inductor][BE] split triton_meta and inductor_meta
|
release notes: foreach_frontend, topic: not user facing, module: inductor, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111397
triton_meta is intended to be passed directly to triton. Previous we were also putting other metadata into triton_meta; but we should split out the other metadata into a separate dict to avoid possible conficts in the future.
This PR splits out triton_meta and inductor_meta so we have a place to put additional metadata that isn't intended to be passed to triton.
Tests - wait for CI
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
Differential Revision: [D50442547](https://our.internmc.facebook.com/intern/diff/D50442547)
| 7 |
234 | 111,395 |
Optimise vector allocations
|
open source
|
Updated with latest master and applied approach to more locations as #102868
If you like I can put it to one file per PR; as the TensorFlow and Keras people requested when I sent similar PRs.
| 4 |
235 | 111,392 |
Add an explicit _shutdown method to ProcessGroupNCCL
|
triaged, open source, release notes: distributed (c10d)
|
Currently, the only way ProcessGroupNCCL shuts down its background threads and aborts all communicators is via the destructor.
However, given how python GC works and code holding references to the PG in multiple places, in practice calling `destroy_process_group` doesn't actually end up invoking the destructor.
As a result, in this PR I'm adding a explicit shutdown method to that users can call to cleanup all resources.
| 4 |
236 | 111,385 |
Torch Compile Dynamic fails on sample on diffusers VAE
|
triaged, oncall: pt2, module: dynamic shapes
|
### 🐛 Describe the bug
Torch compile fails on dIffusers VAE code when calling .sample() in the randn_tensor helper function. Disabling dynamic compilation mode solves the issue, but slows other things down. I finally got the minifier to output a reproducer. It occurs on this line: https://github.com/mosaicml/diffusion/blob/cc26b39ad18ed0956a69f035096588507980b572/diffusion/models/stable_diffusion.py#L183
### Error logs
```
Error executing job with overrides: []
Traceback (most recent call last):
File "/mnt/workdisk/aaron/diffusion-main/run.py", line 22, in main
return train(config)
File "/mnt/workdisk/aaron/diffusion-main/diffusion/train.py", line 139, in train
return eval_and_then_train()
File "/mnt/workdisk/aaron/diffusion-main/diffusion/train.py", line 137, in eval_and_then_train
trainer.fit()
File "/usr/lib/python3/dist-packages/composer/trainer/trainer.py", line 1876, in fit
self._train_loop()
File "/usr/lib/python3/dist-packages/composer/trainer/trainer.py", line 2051, in _train_loop
total_loss_dict = self._train_batch(use_grad_scaling)
File "/usr/lib/python3/dist-packages/composer/trainer/trainer.py", line 2239, in _train_batch
self._train_microbatches(microbatches, total_loss_dict)
File "/usr/lib/python3/dist-packages/composer/trainer/trainer.py", line 2339, in _train_microbatches
microbatch_loss_dict = self._train_microbatch(use_grad_scaling, current_batch_size, is_final_microbatch)
File "/usr/lib/python3/dist-packages/composer/trainer/trainer.py", line 2403, in _train_microbatch
self.state.outputs = self.state.model(self.state.batch)
File "/usr/lib/python3/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/eval_frame.py", line 490, in catch_errors
return callback(frame, cache_entry, hooks, frame_state)
File "/usr/lib/python3/dist-packages/torch/_dynamo/convert_frame.py", line 641, in _convert_frame
result = inner_convert(frame, cache_size, hooks, frame_state)
File "/usr/lib/python3/dist-packages/torch/_dynamo/convert_frame.py", line 133, in _fn
return fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/convert_frame.py", line 389, in _convert_frame_assert
return _compile(
File "/usr/lib/python3/dist-packages/torch/_dynamo/convert_frame.py", line 569, in _compile
guarded_code = compile_inner(code, one_graph, hooks, transform)
File "/usr/lib/python3/dist-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
r = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/convert_frame.py", line 491, in compile_inner
out_code = transform_code_object(code, transform)
File "/usr/lib/python3/dist-packages/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
transformations(instructions, code_options)
File "/usr/lib/python3/dist-packages/torch/_dynamo/convert_frame.py", line 458, in transform
tracer.run()
File "/usr/lib/python3/dist-packages/torch/_dynamo/symbolic_convert.py", line 2074, in run
super().run()
File "/usr/lib/python3/dist-packages/torch/_dynamo/symbolic_convert.py", line 724, in run
and self.step()
File "/usr/lib/python3/dist-packages/torch/_dynamo/symbolic_convert.py", line 688, in step
getattr(self, inst.opname)(inst)
File "/usr/lib/python3/dist-packages/torch/_dynamo/symbolic_convert.py", line 439, in wrapper
self.output.compile_subgraph(self, reason=reason)
File "/usr/lib/python3/dist-packages/torch/_dynamo/output_graph.py", line 857, in compile_subgraph
self.compile_and_call_fx_graph(tx, pass2.graph_output_vars(), root)
File "/usr/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/usr/lib/python3/dist-packages/torch/_dynamo/output_graph.py", line 957, in compile_and_call_fx_graph
compiled_fn = self.call_user_compiler(gm)
File "/usr/lib/python3/dist-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
r = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/output_graph.py", line 1024, in call_user_compiler
raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
File "/usr/lib/python3/dist-packages/torch/_dynamo/output_graph.py", line 1009, in call_user_compiler
compiled_fn = compiler_fn(gm, self.example_inputs())
File "/usr/lib/python3/dist-packages/torch/_dynamo/repro/after_dynamo.py", line 96, in debug_wrapper
run_fwd_maybe_bwd(compiled_gm, example_inputs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/debug_utils.py", line 327, in run_fwd_maybe_bwd
out = gm(args)
File "/usr/lib/python3/dist-packages/torch/_functorch/aot_autograd.py", line 1482, in g
return f(*args)
File "/usr/lib/python3/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
return fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/torch/_functorch/aot_autograd.py", line 3905, in forward
return compiled_fn(full_args)
File "/usr/lib/python3/dist-packages/torch/_functorch/aot_autograd.py", line 1482, in g
return f(*args)
File "/usr/lib/python3/dist-packages/torch/_functorch/aot_autograd.py", line 2533, in runtime_wrapper
all_outs = call_func_with_args(
File "/usr/lib/python3/dist-packages/torch/_functorch/aot_autograd.py", line 1506, in call_func_with_args
out = normalize_as_list(f(args))
File "/usr/lib/python3/dist-packages/torch/_functorch/aot_autograd.py", line 1594, in rng_functionalization_wrapper
return compiled_fw(args)
File "/usr/lib/python3/dist-packages/torch/_inductor/codecache.py", line 374, in __call__
return self.get_current_callable()(inputs)
File "/usr/lib/python3/dist-packages/torch/_inductor/compile_fx.py", line 628, in run
return model(new_inputs)
File "/usr/lib/python3/dist-packages/torch/_inductor/codecache.py", line 401, in _run_from_cache
return compiled_graph.compiled_artifact(inputs)
File "/tmp/torchinductor_root/ic/cickzxbroxiht2qr44bogc2wzvnihmoqpfjeapb4cfbfqplh77s3.py", line 65, in call
buf0 = empty_strided((s0, 3, s2, s2), (3*(s2*s2), s2*s2, s2, 1), device='cuda', dtype=torch.float16)
torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised:
RuntimeError: aten/src/ATen/RegisterCUDA.cpp:7014: SymIntArrayRef expected to contain only concrete integers
from user code:
File "/mnt/workdisk/aaron/diffusion-main/diffusion/models/stable_diffusion.py", line 183, in <resume in forward>
latents = self.vae.encode(inputs.half()).latent_dist.sample()
File "/usr/lib/python3/dist-packages/diffusers/models/vae.py", line 661, in sample
sample = randn_tensor(
File "/usr/lib/python3/dist-packages/diffusers/utils/torch_utils.py", line 79, in randn_tensor
latents = torch.randn(shape, generator=generator, device=rand_device, dtype=dtype, layout=layout).to(device)
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.assume_static_by_default = False
from torch.nn import *
class Repro(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, s0 : torch.SymInt, s2 : torch.SymInt, L_batch_image_ : torch.Tensor, s3 : torch.SymInt, L_batch_captions_ : torch.Tensor):
l_batch_image_ = L_batch_image_
l_batch_captions_ = L_batch_captions_
size = l_batch_captions_.size()
getitem_1 = size[1]; size = None
view = l_batch_captions_.view(-1, getitem_1); l_batch_captions_ = getitem_1 = None
_enter_autocast = torch.amp.autocast_mode._enter_autocast('cuda', torch.float16, False, True)
half = l_batch_image_.half(); l_batch_image_ = None
_exit_autocast = torch.amp.autocast_mode._exit_autocast(_enter_autocast); _enter_autocast = None
return (half, view)
mod = Repro()
def load_args(reader):
reader.symint(64) # s0
reader.symint(256) # s2
buf0 = reader.storage('ea62cd3108ac82f857285316ed9a6be4f3040d2a', 402653184, device=device(type='cuda', index=1))
reader.tensor(buf0, (64, 3, 256, 256), is_leaf=True) # L_batch_image_
reader.symint(77) # s3
buf1 = reader.storage('9d850de4f79e8252556788997d9e61eb08e160ce', 315392, device=device(type='cuda', index=1), dtype_hint=torch.int64)
reader.tensor(buf1, (64, 77), dtype=torch.int64, is_leaf=True) # L_batch_captions_
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='/mnt/workdisk/aaron/diffusion-main/torch_compile_debug/run_2023_10_16_19_54_51_021280-pid_42543/minifier/checkpoints', autocast=True, backend='inductor')
```
### Versions
```
PyTorch version: 2.1.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: Could not collect
CMake version: version 3.26.3
Libc version: glibc-2.31
Python version: 3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
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
Nvidia driver version: 515.48.07
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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): 64
On-line CPU(s) list: 0-63
Thread(s) per core: 1
Core(s) per socket: 32
Socket(s): 2
NUMA node(s): 8
Vendor ID: AuthenticAMD
CPU family: 25
Model: 1
Model name: AMD EPYC 7513 32-Core Processor
Stepping: 1
Frequency boost: enabled
CPU MHz: 1497.016
CPU max MHz: 2600.0000
CPU min MHz: 1500.0000
BogoMIPS: 5200.13
Virtualization: AMD-V
L1d cache: 2 MiB
L1i cache: 2 MiB
L2 cache: 32 MiB
L3 cache: 256 MiB
NUMA node0 CPU(s): 0-7
NUMA node1 CPU(s): 8-15
NUMA node2 CPU(s): 16-23
NUMA node3 CPU(s): 24-31
NUMA node4 CPU(s): 32-39
NUMA node5 CPU(s): 40-47
NUMA node6 CPU(s): 48-55
NUMA node7 CPU(s): 56-63
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 disabled, RSB filling, 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 pcid 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 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca
Versions of relevant libraries:
[pip3] numpy==1.26.0
[pip3] pytorch-ranger==0.1.1
[pip3] torch==2.1.0+cu121
[pip3] torch-optimizer==0.3.0
[pip3] torchmetrics==1.0.3
[pip3] torchvision==0.16.0+cu121
[pip3] triton==2.1.0
```
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 1 |
237 | 111,384 |
[quant][pt2] Default batchnorm aten op has poor numerics during QAT
|
oncall: quantization, triaged
|
If a model contains batch norm, exporting `model.cpu()` gives `torch.ops.aten._native_batch_norm_legit.default` while exporting `model.cuda()` gives `torch.ops.aten.cudnn_batch_norm.default`. Quick experimentation revealed that these two ops have significantly different numerics. From running PT2 QAT on MobileNetV2, we found that these numerical differences are magnified through many back-to-back `[conv - bn]` or `[conv - bn - relu]` patterns, and training with `cudnn_batch_norm` gave significantly better accuracies.
For the short term, we recommend users of PT2 QAT to either export with `model.cuda()` from the start, or manually swap the batch norm op from `_native_batch_norm_legit` to `cudnn_batch_norm` before training. See this [tutorial](https://pytorch.org/tutorials/prototype/pt2e_quant_qat.html#prepare-the-model-for-quantization-aware-training) for more detail.
For the longer term, however, we wish to fix this so that the user does not have to do this manual swapping. We can achieve this by consolidating the batch norm ops such that exporting the model always gives the same op, regardless whether it is on CPU or cuda, and that op will automatically pick the right kernel to run on. See this relevant [comment](https://github.com/pytorch/pytorch/pull/108809#issuecomment-1724566234).
cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel
| 0 |
238 | 111,383 |
[WIP] Testing
|
open source, topic: not user facing
|
Not making any changes
| 1 |
239 | 111,380 |
Rename name->qualname in torch.library.impl_abstract
| null |
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111661
* #111660
* #111310
* #111659
* __->__ #111380
See title. Makes this consistent with torch.library.{define, impl, impl_device}, where we have named the same argument `qualname`. This is not BC-breaking because we have not released a version of PyTorch with impl_abstract in it yet.
| 1 |
240 | 111,377 |
Add `torch.utils.deterministic.fill_uninitialized_memory` flag
|
triaged, module: determinism, open source, release notes: python_frontend, ciflow/mps
|
Part of #109802
cc @mruberry
| 1 |
241 | 111,374 |
Tensor.lerp inconsistent when using -Infinity between MPS and CPU
|
triaged, module: mps
|
### 🐛 Describe the bug
lerping between -Inf and another number is NaN on a MPS tensor and -Inf on the CPU.
This breaks several Diffusion schedulers.
```
import torch
for device in ['cpu', 'mps']:
minusInfinity = torch.tensor([0]).log().to(device)
actualNumber = torch.tensor([1.0]).to(device);
print(minusInfinity);
print(actualNumber);
print(minusInfinity.lerp(actualNumber, 0.5))
```
```
tensor([-inf])
tensor([1.])
tensor([-inf])
tensor([-inf], device='mps:0')
tensor([1.], device='mps:0')
tensor([nan], device='mps:0')
```
### Versions
Collecting environment information...
PyTorch version: 2.1.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 14.0 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.0.40.1)
CMake version: version 3.24.4
Libc version: N/A
Python version: 3.10.13 (main, Sep 28 2023, 14:27:43) [Clang 12.0.5 (clang-1205.0.22.9)] (64-bit runtime)
Python platform: macOS-14.0-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
Versions of relevant libraries:
[pip3] numpy==1.26.0
[pip3] torch==2.1.0
[pip3] torchvision==0.16.0
[conda] Could not collect
cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
| 1 |
242 | 111,370 |
Tracker for torch._numpy errors under dynamo
|
triaged, module: numpy, module: dynamo
|
### 🐛 Describe the bug
This issue is to collect failures observed in https://github.com/pytorch/pytorch/pull/110401 when trying to run torch._numpy tests under Dynamo:
1. `array.tolist()`. Repro:
```
import torch
import numpy as np
def fn(value):
x = np.array([0])
# x = torch.as_tensor([0]) # this works
return x.tolist()
opt_fn = torch.compile(fn)
x = np.array([1, 2, 3])
print("compiled: ", opt_fn(x))
```
yields
```
Traceback (most recent call last):
File "arr.py", line 14, in <module>
print("compiled: ", opt_fn(x))
File "/home/ev-br/repos/pytorch/torch/_dynamo/eval_frame.py", line 401, in _fn
return fn(*args, **kwargs)
File "/home/ev-br/repos/pytorch/torch/_dynamo/eval_frame.py", line 549, in catch_errors
return callback(frame, cache_entry, hooks, frame_state)
File "/home/ev-br/repos/pytorch/torch/_dynamo/convert_frame.py", line 683, in _convert_frame
result = inner_convert(frame, cache_entry, hooks, frame_state)
File "/home/ev-br/repos/pytorch/torch/_dynamo/convert_frame.py", line 148, in _fn
return fn(*args, **kwargs)
File "/home/ev-br/repos/pytorch/torch/_dynamo/convert_frame.py", line 402, in _convert_frame_assert
return _compile(
File "/home/ev-br/repos/pytorch/torch/_dynamo/convert_frame.py", line 610, in _compile
guarded_code = compile_inner(code, one_graph, hooks, transform)
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 221, in time_wrapper
r = func(*args, **kwargs)
File "/home/ev-br/repos/pytorch/torch/_dynamo/convert_frame.py", line 527, in compile_inner
out_code = transform_code_object(code, transform)
File "/home/ev-br/repos/pytorch/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
transformations(instructions, code_options)
File "/home/ev-br/repos/pytorch/torch/_dynamo/convert_frame.py", line 497, in transform
tracer.run()
File "/home/ev-br/repos/pytorch/torch/_dynamo/symbolic_convert.py", line 2102, in run
super().run()
File "/home/ev-br/repos/pytorch/torch/_dynamo/symbolic_convert.py", line 742, in run
and self.step()
File "/home/ev-br/repos/pytorch/torch/_dynamo/symbolic_convert.py", line 705, in step
getattr(self, inst.opname)(inst)
File "/home/ev-br/repos/pytorch/torch/_dynamo/symbolic_convert.py", line 405, in wrapper
return inner_fn(self, inst)
File "/home/ev-br/repos/pytorch/torch/_dynamo/symbolic_convert.py", line 1138, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ev-br/repos/pytorch/torch/_dynamo/symbolic_convert.py", line 577, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ev-br/repos/pytorch/torch/_dynamo/variables/misc.py", line 648, in call_function
return self.obj.call_method(tx, self.name, args, kwargs).add_options(self)
File "/home/ev-br/repos/pytorch/torch/_dynamo/variables/tensor.py", line 1086, in call_method
return NumpyNdarrayVariable.create(tx, proxy, **options)
File "/home/ev-br/repos/pytorch/torch/_dynamo/variables/tensor.py", line 1000, in create
return wrap_fx_proxy_cls(
File "/home/ev-br/repos/pytorch/torch/_dynamo/variables/builder.py", line 1404, in wrap_fx_proxy_cls
example_value = get_fake_value(proxy.node, tx)
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 1422, in get_fake_value
raise TorchRuntimeError(str(e)).with_traceback(e.__traceback__) from None
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 1383, in get_fake_value
return wrap_fake_exception(
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 952, in wrap_fake_exception
return fn()
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 1384, in <lambda>
lambda: run_node(tx.output, node, args, kwargs, nnmodule)
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 1483, in run_node
raise RuntimeError(fn_str + str(e)).with_traceback(e.__traceback__) from e
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 1462, in run_node
return node.target(*args, **kwargs)
File "/home/ev-br/repos/pytorch/torch/_dynamo/utils.py", line 1799, in __call__
out = method_callable(*args[1:], **kwargs)
File "/home/ev-br/repos/pytorch/torch/_numpy/_ndarray.py", line 345, in tolist
return self.tensor.tolist()
torch._dynamo.exc.TorchRuntimeError: Failed running call_function <Wrapped method <original tolist>>(*(FakeTensor(..., size=(1,), dtype=torch.int64),), **{}):
.tolist() is not supported for tensor subclasses, got FakeTensor
```
-------------------------------------------------
2. `np.typecodes` is a `Dict[Str, Str]` is not compiled at all
```
import torch
import numpy as np
def fn():
return np.typecodes["AllInteger"]
cnts = torch._dynamo.testing.CompileCounter()
opt_fn = torch._dynamo.optimize(cnts)(fn)
print(torch._numpy.typecodes['AllInteger'])
print(fn())
print(opt_fn())
print(cnts.frame_count)
```
yields
```
Bbhil
bBhHiIlLqQpP
bBhHiIlLqQpP
0
```
The problem is that's `np.typecodes` does not contain tensors, is not traced and dynamo simply falls back to eager numpy.
cc @mruberry @rgommers @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 1 |
243 | 111,368 |
Implement device parameter in Dropout2d
|
feature, module: nn, triaged
|
### 🚀 The feature, motivation and pitch
Please provide a `device` parameter to the Dropout2d layer for creating it on a target device like so:
```python
dropout = nn.Dropout2d(
p=0.5,
device=torch.device('cuda'),
)
```
### Alternatives
Currently, [PyTorch's Dropout2D layer](https://pytorch.org/docs/stable/generated/torch.nn.Dropout2d.html) does not support creating it on a specific device. This means that one needs first create it on the CPU and then move it to the desired device, if any. Lacking this feature results in extra code to be written by the user:
```python
dropout = nn.Dropout2d(
p=0.5,
)
dropout1.cuda()
```
### Additional context
Creating the layer on CPU and moving it to GPU might also be slower, when compared to creation directly on the target device, as hinted at by the performance tuning guide:
<https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html#create-tensors-directly-on-the-target-device>
cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
| 0 |
244 | 111,366 |
RuntimeError: CUDAPluggableAllocator does not yet support cacheInfo
|
feature, triaged, module: CUDACachingAllocator
|
### 🐛 Describe the bug
Here, I ref a third party CUDA Memory Allocator into my code and use the cudnn to be the backend.
cudnn seems required to call `cacheInfo`, but the PyTorch didn't support this interface to be called by third party lib.
cudnn's action happens at here: https://github.com/pytorch/pytorch/blob/9af82fa2b86fb71df503082b1960c9392f9dc66d/aten/src/ATen/native/cudnn/Conv_v7.cpp#L212
```python
import torch
import rmm
from rmm.allocators.torch import rmm_torch_allocator
torch.backends.cudnn.benchmark = True
rmm.reinitialize(pool_allocator=True)
torch.cuda.memory.change_current_allocator(rmm_torch_allocator)
m = torch.nn.Conv1d(16, 33, 3, stride=2).cuda()
input = torch.randn(20, 16, 50).cuda()
output = m(input)
```
```text
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/__project__/benchmark.ipynb Cell 1 line 1
9 m = torch.nn.Conv1d(16, 33, 3, stride=2).cuda()
10 input = torch.randn(20, 16, 50).cuda()
---> 11 output = m(input)
File /__env__/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)
1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1517 else:
-> 1518 return self._call_impl(*args, **kwargs)
File /__env__/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)
1522 # If we don't have any hooks, we want to skip the rest of the logic in
1523 # this function, and just call forward.
1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1525 or _global_backward_pre_hooks or _global_backward_hooks
1526 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1527 return forward_call(*args, **kwargs)
1529 try:
1530 result = None
File /__env__/site-packages/torch/nn/modules/conv.py:310, in Conv1d.forward(self, input)
309 def forward(self, input: Tensor) -> Tensor:
--> 310 return self._conv_forward(input, self.weight, self.bias)
File /__env__/site-packages/torch/nn/modules/conv.py:306, in Conv1d._conv_forward(self, input, weight, bias)
302 if self.padding_mode != 'zeros':
303 return F.conv1d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),
304 weight, bias, self.stride,
305 _single(0), self.dilation, self.groups)
--> 306 return F.conv1d(input, weight, bias, self.stride,
307 self.padding, self.dilation, self.groups)
RuntimeError: CUDAPluggableAllocator does not yet support cacheInfo. If you need it, please file an issue describing your use case.
```
**For detailed error trace, could check this issue: https://github.com/rapidsai/rmm/issues/1362#issuecomment-1763996144**
### Versions
Collecting environment information...
PyTorch version: 2.1.0+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 9.5.0-1ubuntu1~22.04) 9.5.0
Clang version: Could not collect
CMake version: version 3.26.4
Libc version: glibc-2.35
Python version: 3.9.16 (main, May 15 2023, 23:46:34) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.19.0-40-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.2.128
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA A100 80GB PCIe
GPU 1: NVIDIA A100 80GB PCIe
Nvidia driver version: 525.105.17
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, 57 bits virtual
Byte Order: Little Endian
CPU(s): 96
On-line CPU(s) list: 0-95
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Gold 6336Y CPU @ 2.40GHz
CPU family: 6
Model: 106
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 2
Stepping: 6
CPU max MHz: 3600.0000
CPU min MHz: 800.0000
BogoMIPS: 4800.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 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 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 avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid fsrm md_clear pconfig flush_l1d arch_capabilities
Virtualisation: VT-x
L1d cache: 2.3 MiB (48 instances)
L1i cache: 1.5 MiB (48 instances)
L2 cache: 60 MiB (48 instances)
L3 cache: 72 MiB (2 instances)
NUMA node(s): 2
NUMA node0 CPU(s): 0-23,48-71
NUMA node1 CPU(s): 24-47,72-95
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
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] mypy-extensions==1.0.0
[pip3] numpy==1.24.4
[pip3] pytorch-forecasting==1.0.0
[pip3] pytorch-lightning==2.0.9.post0
[pip3] pytorch_optimizer==2.12.0
[pip3] pytorch-sphinx-theme==0.0.19
[pip3] torch==2.1.0
[pip3] torch-tb-profiler==0.4.1
[pip3] torchaudio==2.1.0
[pip3] torchinfo==1.8.0
[pip3] torchmetrics==1.2.0
[pip3] torchvision==0.16.0
[pip3] triton==2.1.0
[conda] numpy 1.24.4 pypi_0 pypi
[conda] pytorch-forecasting 1.0.0 pypi_0 pypi
[conda] pytorch-lightning 2.0.9.post0 pypi_0 pypi
[conda] pytorch-optimizer 2.12.0 pypi_0 pypi
[conda] pytorch-sphinx-theme 0.0.19 pypi_0 pypi
[conda] torch 2.1.0 pypi_0 pypi
[conda] torch-tb-profiler 0.4.1 pypi_0 pypi
[conda] torchaudio 2.1.0 pypi_0 pypi
[conda] torchinfo 1.8.0 pypi_0 pypi
[conda] torchmetrics 1.2.0 pypi_0 pypi
[conda] torchvision 0.16.0 pypi_0 pypi
[conda] triton 2.1.0 pypi_0 pypi
| 0 |
245 | 111,365 |
Failed to import transformer.
|
high priority, triage review, oncall: binaries, module: windows
|
### 🐛 Describe the bug
!pip install datasets evaluate transformers[sentencepiece]
```python
from transformers import Trainer
trainer = Trainer(
model,
training_args,
train_dataset=tokenized_datasets["train"],
eval_dataset=tokenized_datasets["validation"],
data_collator=data_collator,
tokenizer=tokenizer,
)
```
I am doing the NLP course by Hugging Face. On week 3, I cant seem the import anything from transformers.
```
{
"name": "RuntimeError",
"message": "Failed to import transformers.training_args because of the following error (look up to see its traceback):
[WinError 182] The operating system cannot run %1. Error loading \"d:\\Programmes\\anaconda3\\envs\\NLP310\\lib\\site-packages\\torch\\lib\\fbgemm.dll\" or one of its dependencies.",
"stack": "---------------------------------------------------------------------------
OSError Traceback (most recent call last)
File ~\\AppData\\Roaming\\Python\\Python310\\site-packages\\transformers\\utils\\import_utils.py:1282, in _LazyModule._get_module(self, module_name)
1281 try:
-> 1282 return importlib.import_module(\".\" + module_name, self.__name__)
1283 except Exception as e:
File d:\\Programmes\\anaconda3\\envs\\NLP310\\lib\\importlib\\__init__.py:126, in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:1006, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:688, in _load_unlocked(spec)
File <frozen importlib._bootstrap_external>:883, in exec_module(self, module)
File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)
File ~\\AppData\\Roaming\\Python\\Python310\\site-packages\\transformers\\training_args.py:30
28 from packaging import version
---> 30 from .debug_utils import DebugOption
31 from .trainer_utils import (
32 EvaluationStrategy,
33 FSDPOption,
(...)
37 ShardedDDPOption,
38 )
File ~\\AppData\\Roaming\\Python\\Python310\\site-packages\\transformers\\debug_utils.py:21
20 if is_torch_available():
---> 21 import torch
24 logger = logging.get_logger(__name__)
File d:\\Programmes\\anaconda3\\envs\\NLP310\\lib\\site-packages\\torch\\__init__.py:128
127 err.strerror += f' Error loading \"{dll}\" or one of its dependencies.'
--> 128 raise err
129 elif res is not None:
OSError: [WinError 182] The operating system cannot run %1. Error loading \"d:\\Programmes\\anaconda3\\envs\\NLP310\\lib\\site-packages\\torch\\lib\\fbgemm.dll\" or one of its dependencies.
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
d:\\OneDrive\\Data\\Learning\\Natural Science\\Computer Science\\AI, ML, DL\\Hugging Face NLP\
otebooks-main\\course\\en\\chapter3\\section3.ipynb Cell 5 line 1
----> <a href='vscode-notebook-cell:/d%3A/OneDrive/Data/Learning/Natural%20Science/Computer%20Science/AI%2C%20ML%2C%20DL/Hugging%20Face%20NLP/notebooks-main/course/en/chapter3/section3.ipynb#W4sZmlsZQ%3D%3D?line=0'>1</a> from transformers import TrainingArguments
<a href='vscode-notebook-cell:/d%3A/OneDrive/Data/Learning/Natural%20Science/Computer%20Science/AI%2C%20ML%2C%20DL/Hugging%20Face%20NLP/notebooks-main/course/en/chapter3/section3.ipynb#W4sZmlsZQ%3D%3D?line=2'>3</a> training_args = TrainingArguments(\"test-trainer\")
File <frozen importlib._bootstrap>:1075, in _handle_fromlist(module, fromlist, import_, recursive)
File ~\\AppData\\Roaming\\Python\\Python310\\site-packages\\transformers\\utils\\import_utils.py:1272, in _LazyModule.__getattr__(self, name)
1270 value = self._get_module(name)
1271 elif name in self._class_to_module.keys():
-> 1272 module = self._get_module(self._class_to_module[name])
1273 value = getattr(module, name)
1274 else:
File ~\\AppData\\Roaming\\Python\\Python310\\site-packages\\transformers\\utils\\import_utils.py:1284, in _LazyModule._get_module(self, module_name)
1282 return importlib.import_module(\".\" + module_name, self.__name__)
1283 except Exception as e:
-> 1284 raise RuntimeError(
1285 f\"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its\"
1286 f\" traceback):\
{e}\"
1287 ) from e
RuntimeError: Failed to import transformers.training_args because of the following error (look up to see its traceback):
[WinError 182] The operating system cannot run %1. Error loading \"d:\\Programmes\\anaconda3\\envs\\NLP310\\lib\\site-packages\\torch\\lib\\fbgemm.dll\" or one of its dependencies."
}
```
### Versions
(NLP310) D:\OneDrive\Data\Learning\Natural Science\Computer Science\AI, ML, DL\Hugging Face NLP\notebooks-main\course\en\chapter3>python collect_env.py
Collecting environment information...
PyTorch version: 2.1.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: Microsoft Windows 10 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A
Python version: 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:15:57) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19045-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=3801
DeviceID=CPU0
Family=107
L2CacheSize=4096
L2CacheSpeed=
Manufacturer=AuthenticAMD
MaxClockSpeed=3801
Name=AMD Ryzen 7 5700G with Radeon Graphics
ProcessorType=3
Revision=20480
Versions of relevant libraries:
[pip3] numpy==1.26.0
[pip3] torch==2.1.0
[conda] _tflow_select 2.3.0 mkl
[conda] blas 1.0 mkl
[conda] mkl 2023.1.0 h6b88ed4_46357
[conda] mkl-service 2.4.0 py310h2bbff1b_1
[conda] mkl_fft 1.3.8 py310h2bbff1b_0
[conda] mkl_random 1.2.4 py310h59b6b97_0
[conda] numpy 1.26.0 py310h055cbcc_0
[conda] numpy-base 1.26.0 py310h65a83cf_0
[conda] tensorflow 2.10.0 mkl_py310hd99672f_0
[conda] tensorflow-base 2.10.0 mkl_py310h6a7f48e_0
[conda] torch 2.1.0 pypi_0 pypi
(NLP310) D:\OneDrive\Data\Learning\Natural Science\Computer Science\AI, ML, DL\Hugging Face NLP\notebooks-main\course\en\chapter3>
cc @ezyang @gchanan @zou3519 @kadeng @seemethere @malfet @osalpekar @atalman @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite
| 1 |
246 | 111,363 |
Simulating lower memory on GPU does not indicate simulated memory in error message
|
module: cuda, module: memory usage, triaged, module: CUDACachingAllocator
|
### 🐛 Describe the bug
I'm on an 80G A100 trying to debug an OOM folks are getting running my code on a 40G, and found the `torch.cuda.set_per_process_memory_fraction(0.5)` API which I'm using to simulate lower CUDA memory conditions.
However, upon an OOM I get an error message such as
```
content_understanding.utils.injected_exception.NonRetryableExceptionWrapper: (OutOfMemoryError) CUDA out of memory. Tried to allocate 64.00 MiB. GPU 0 has a total capacty of 79.15 GiB of which 38.09 GiB is free. Including non-PyTorch memory, this process has 41.06 GiB memory in use. Of the allocated memory 39.10 GiB is allocated by PyTorch, and 427.46 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
```
where the simulated reduced memory is not reflected (80G is). To repro, call the above API and allocate a > 40G tensor.
### Versions
main
cc @ptrblck
| 0 |
247 | 111,362 |
fix: Flake8-BugBear code B-026 for PyTorch
|
triaged, open source, release notes: distributed (fsdp), ciflow/inductor
|
Fixes #106571
I have fixed the B-026 error codes for Flake8 tests on the codebase. Please review and tell me anything else to do.
Thanks and excited for this first contribution to PyTorch.
Also I refer this issue which introduced [B-026](https://github.com/PyCQA/flake8-bugbear/issues/286) in `pytest-bugbear` and discuss the error code.
| 6 |
248 | 111,359 |
I have a trouble with to_symmetric
|
needs reproduction, module: sparse, triaged
|
### 🐛 Describe the bug
This is my code:
```
dataset = DGraphFin(root=path, name=dataset_name, transform=T.ToSparseTensor())
nlabels = dataset.num_classes
if dataset_name in ['DGraph']:
nlabels = 2
data = dataset[0]
data.adj_t = data.adj_t.to_symmetric()
```
I got the warning : UserWarning: Sparse CSR tensor support is in beta state.
And an error:AttributeError: 'Tensor' object has no attribute 'to_symmetric'.
I don't know why. Why someone can run successfullly, but I can't?
### Versions
Stable (2.1.0)
python 3.8
CUDA 11.8
Windows 11
cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer
| 1 |
249 | 111,357 |
Couldn't export yolov7 quantized model to onnx
|
module: onnx, triaged, onnx-triaged
|
### 🐛 Describe the bug
I'm trying to export yolov7 model quantized using FX mode quantization to onnx format. But im unable to do it because of the following error:
```
Traceback (most recent call last):
File "/home/econsy/projects/yolov7-exploration/dev/v7/evaluate_quantized_model_US21_char.py", line 279, in <module>
main()
File "/home/econsy/projects/yolov7-exploration/lib/python3.10/site-packages/func_to_script/core.py", line 108, in scripted_function
return func(**args)
File "/home/econsy/projects/yolov7-exploration/dev/v7/evaluate_quantized_model_US21_char.py", line 238, in main
torch.onnx.export(model_int8,image_tensor[None],"onnx_model.onnx",verbose=True,opset_version=15)
File "/home/econsy/projects/yolov7-exploration/lib/python3.10/site-packages/torch/onnx/utils.py", line 506, in export
_export(
File "/home/econsy/projects/yolov7-exploration/lib/python3.10/site-packages/torch/onnx/utils.py", line 1548, in _export
graph, params_dict, torch_out = _model_to_graph(
File "/home/econsy/projects/yolov7-exploration/lib/python3.10/site-packages/torch/onnx/utils.py", line 1117, in _model_to_graph
graph = _optimize_graph(
File "/home/econsy/projects/yolov7-exploration/lib/python3.10/site-packages/torch/onnx/utils.py", line 665, in _optimize_graph
graph = _C._jit_pass_onnx(graph, operator_export_type)
File "/home/econsy/projects/yolov7-exploration/lib/python3.10/site-packages/torch/onnx/utils.py", line 1891, in _run_symbolic_function
return symbolic_fn(graph_context, *inputs, **attrs)
TypeError: quantized_add() missing 2 required positional arguments: 'op_scale' and 'op_zero_point'
```
Here is the skeleton code:
```
model = # my_model
model.eval()
from torch.quantization import quantize_fx
qconfig_dict = {"": torch.quantization.get_default_qconfig("qnnpack")}
model_prepared = quantize_fx.prepare_fx(model, qconfig_dict,(image_tensor[None],))
model_prepared.eval()
with torch.no_grad():
for i in range(0,len(eval_ds)):
image_tensor = eval_ds[i]
model_prepared(image_tensor[None])
model_int8 = torch.quantization.quantize_fx.convert_fx(model_prepared)
torch.onnx.export(model_int8,image_tensor[None],"onnx_model.onnx",verbose=True,opset_version=15)
```
### Versions
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 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.27.2
Libc version: glibc-2.35
Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-6.2.0-34-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: 535.113.01
cuDNN version: Probably one of the following:
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-11.8/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
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: 5800.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 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb 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 Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: 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.25.2
[pip3] onnx==1.14.1
[pip3] torch==2.0.1
[pip3] torchaudio==2.0.2
[pip3] torchvision==0.15.2
[pip3] triton==2.0.0
[conda] Could not collect
| 1 |
250 | 111,355 |
Segmentation fault (crash) running demucs on RX 6700 XT using ROCm 5.6.1
|
module: rocm, triaged
|
### 🐛 Describe the bug
demucs causes Python 3.11 and 3.9 to crash, using torch/torchvision/torchaudio 2.1.0+rocm5.6.
I've reported the issue at demucs as well, but it's probably not their bug:
https://github.com/facebookresearch/demucs/issues/556
And also at ROCm bug tracker:
https://github.com/RadeonOpenCompute/ROCm/issues/2563
From the demucs issue, I include a backtrace:
https://gist.github.com/kode54/1a318cfe6bd2c947a2cc287e5d5d6ac9
### Versions
```
Collecting environment information...
PyTorch version: 2.1.0+rocm5.6
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 5.6.31061-8c743ae5d
OS: Arch Linux (x86_64)
GCC version: (GCC) 13.2.1 20230801
Clang version: 16.0.6
CMake version: version 3.27.7
Libc version: glibc-2.38
Python version: 3.9.18 (main, Sep 11 2023, 13:41:44) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.5.7-1-cachyos-z2-x86_64-with-glibc2.38
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: AMD Radeon RX 6700 XT
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: 5.6.31061
MIOpen runtime version: 2.20.0
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): 16
On-line CPU(s) list: 0-15
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 7 2700 Eight-Core Processor
CPU family: 23
Model: 8
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 2
Frequency boost: enabled
CPU(s) scaling MHz: 65%
CPU max MHz: 3200.0000
CPU min MHz: 1550.0000
BogoMIPS: 6400.13
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 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 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: 256 KiB (8 instances)
L1i cache: 512 KiB (8 instances)
L2 cache: 4 MiB (8 instances)
L3 cache: 16 MiB (2 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Mitigation; untrained return thunk; SMT vulnerable
Vulnerability Spec rstack overflow: Mitigation; safe RET
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.24.1
[pip3] pytorch-triton-rocm==2.1.0
[pip3] torch==2.1.0+rocm5.6
[pip3] torchaudio==2.1.0+rocm5.6
[pip3] torchvision==0.16.0+rocm5.6
[conda] numpy 1.24.1 pypi_0 pypi
[conda] pytorch-triton-rocm 2.1.0 pypi_0 pypi
[conda] torch 2.1.0+rocm5.6 pypi_0 pypi
[conda] torchaudio 2.1.0+rocm5.6 pypi_0 pypi
[conda] torchvision 0.16.0+rocm5.6 pypi_0 pypi
```
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang
| 0 |
251 | 111,351 |
_foreach_copy_ supports fast copy between cpu and cuda devices.
|
feature, triaged, module: mta
|
### 🚀 The feature, motivation and pitch
The current implementation of PyTorch's `foreach_copy` operator requires the source and target tensors to be on the same device to enter the fast route in the [code](https://github.com/pytorch/pytorch/blob/e0e15a4ac61648cc8f63f0ab102c32e8884fb5d1/aten/src/ATen/native/cuda/ForeachBinaryOpList.cu#L260).
While I understand this limitation for other operators, I believe `copy` is a special case because copying between devices is a fairly common operation. Supporting this feature could be useful.
### Alternatives
_No response_
### Additional context
_No response_
cc @crcrpar @mcarilli
| 0 |
252 | 111,349 |
CUDA version 12.2 has differential accuracy when executing CPU and GPU
|
module: cuda, triaged
|
### 🐛 Describe the bug
The same training code is adapted to both GPU and CPU, and the GPU loss value oscillates back and forth at 0.2. The trained model results have the same score as above, and the learning rate has been adjusted for other training parameters, but it still oscillates continuously. Is it related to the NVIDIA GPU version?
nvidia-smi
```
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.12 Driver Version: 535.104.12 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4080 On | 00000000:01:00.0 Off | N/A |
| 0% 38C P8 7W / 320W | 141MiB / 16376MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 1766 G /usr/lib/xorg/Xorg 70MiB |
| 0 N/A N/A 1905 G /usr/bin/gnome-shell 61MiB |
+---------------------------------------------------------------------------------------+
```
nvcc -V
```
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:02:13_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0
```
##### Result returned by executing GPU
```
pth_model = 'ssk_model_gpu.pth'
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
img_path = glob.glob(os.path.join(base_dir, "script/9654.jpg"))
num_classes = 2
index_to_label_dict = {1: "ssk"}
base_predict = BasePicPrediction(index_to_label_dict, pth_model, img_path, num_classes)
base_predict.predict()
```
```
[{'boxes': tensor([[5.9821e+01, 2.8965e+02, 5.4606e+02, 3.6460e+02],
[2.8786e+01, 1.6227e+02, 5.3697e+02, 2.3907e+02],
[6.5855e+01, 2.1370e+02, 5.8006e+02, 2.8831e+02],
[7.9151e+01, 3.9213e+02, 5.5472e+02, 4.6895e+02],
[3.5071e+01, 1.3559e+02, 5.5699e+02, 2.1090e+02],
[9.1966e+01, 6.7707e+01, 5.5972e+02, 1.3955e+02],
[5.9214e+01, 4.1697e+02, 5.5963e+02, 4.9263e+02],
[4.8741e+01, 9.3800e+01, 5.8077e+02, 1.6318e+02],
[9.8421e+01, 1.8656e+02, 5.9046e+02, 2.6154e+02],
[2.0798e+01, 1.1636e+02, 5.8842e+02, 2.5557e+02],
[3.9316e+01, 4.8325e+02, 5.4797e+02, 5.5690e+02],
[1.9926e+01, 2.5784e+02, 5.9492e+02, 4.0312e+02],
[2.5491e+01, 4.5957e+01, 5.4219e+02, 1.1298e+02],
[3.5996e+01, 2.5901e+02, 5.5477e+02, 3.3518e+02],
[2.5888e+01, 2.1044e+02, 5.9977e+02, 3.5176e+02],
[4.9628e+01, 5.0893e+02, 5.3857e+02, 5.8452e+02],
[4.3815e+01, 3.3270e+02, 5.6472e+02, 4.1185e+02],
[2.7517e+01, 4.0084e+02, 6.1062e+02, 5.3665e+02],
[4.5567e+01, 1.1533e+02, 5.9768e+02, 5.5697e+02],
[6.7510e+01, 4.5763e+02, 5.7283e+02, 5.3533e+02],
[8.6543e+01, 5.8512e-01, 5.6876e+02, 2.1825e+02],
[2.2073e+01, 4.8063e+02, 6.0072e+02, 6.1768e+02],
[1.6896e+02, 1.1801e+02, 5.5157e+02, 3.9258e+02]],
grad_fn=<StackBackward0>), 'labels': tensor([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), 'scores': tensor([0.1989, 0.1731, 0.1713, 0.1658, 0.1610, 0.1603, 0.1568, 0.1401, 0.1392,
0.1321, 0.1271, 0.1204, 0.1172, 0.1139, 0.1070, 0.1057, 0.0999, 0.0973,
0.0898, 0.0860, 0.0679, 0.0646, 0.0552], grad_fn=<IndexBackward0>)}]
labels: tensor([], dtype=torch.int64)
```
##### Result returned by executing CPU
```
pth_model = 'ssk_model_cpu.pth'
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
img_path = glob.glob(os.path.join(base_dir, "script/9654.jpg"))
num_classes = 2
index_to_label_dict = {1: "ssk"}
base_predict = BasePicPrediction(index_to_label_dict, pth_model, img_path, num_classes)
base_predict.predict()
```
```
[{'boxes': tensor([[ 71.1018, 130.2508, 542.9422, 178.2809],
[ 80.0503, 244.4309, 557.0223, 295.3717],
[625.7035, 4.6740, 625.9987, 14.1678],
[ 73.4546, 126.2134, 557.5504, 300.8983],
[ 78.9559, 346.2308, 215.2213, 394.0876]], grad_fn=<StackBackward0>), 'labels': tensor([1, 1, 1, 1, 1]), 'scores': tensor([0.9880, 0.9849, 0.2521, 0.0657, 0.0591], grad_fn=<IndexBackward0>)}]
labels: tensor([1, 1])
```
I need help to solve this question!!!
### Versions
pytorch 2.1.0 py3.8_cuda12.1_cudnn8.9.2_0 pytorch
pytorch-cuda 12.1 ha16c6d3_5 pytorch
pytorch-mutex 1.0 cuda pytorch
cc @ptrblck
| 0 |
253 | 111,348 |
Custom Tensor Instances Do Not Work With DDP
|
oncall: distributed
|
### 🐛 Describe the bug
Existing DDP implementation throws an error for [`UninitializedParameter`](https://github.com/pytorch/pytorch/blob/e0e15a4ac61648cc8f63f0ab102c32e8884fb5d1/torch/nn/parallel/distributed.py#L765). This makes sense.
However, behind the scene, `isinstance(tensor, UninitializedParameter)` translates to `UninitializedParameter.__instancecheck__(tensor)`, which is implemented [here](https://github.com/pytorch/pytorch/blob/7bcf7da3a268b435777fe87c7794c382f444e86d/torch/nn/parameter.py#L8).
The aforementioned implementation returns `True` for custom Tensor instances (because of their `_is_param` attribute). I believe the intention of this implementation is to let custom Tensor instances to be compatible with `Parameter`. But this causes these custom Tensor instances to be instances of `UninitializedParameter`, and hence incompatible with DDP.
### Versions
NA
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu
| 0 |
254 | 111,345 |
DISABLED test_fused_int_mm_mul (__main__.TestPaternMatcher)
|
module: rocm, triaged, module: flaky-tests, skipped, module: inductor
|
Platforms: rocm
This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/failure/test_fused_int_mm_mul) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/17711524027).
Over the past 72 hours, it has flakily failed in 12 workflow(s).
**Debugging instructions (after clicking on the recent samples link):**
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Grep for `test_fused_int_mm_mul`
Test file path: `inductor/test_pattern_matcher.py`
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 1 |
255 | 111,341 |
Reenable sgd benchmark
|
module: inductor, module: dynamo, ciflow/inductor, ciflow/inductor-perf-test-nightly, ciflow/inductor-perf-compare
|
This is a cleaned up version of https://github.com/pytorch/pytorch/pull/110353--we should def land the OG PR. I wanted to launch a perf job to see the time difference in the nightly so made this one.
Job: https://github.com/pytorch/pytorch/actions/runs/6538030862
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 3 |
256 | 111,340 |
[WIP] 2D optimizer change
|
module: fsdp, ciflow/trunk, topic: not user facing, ciflow/periodic
|
This PR:
1. This PR adds a kwarg to the flat_param util in _get_unflat_views_aligned. We use _get_unflat_views_aligned() in both runtime and optim_state_dict. For optim_state_dict, we do not need to unflatten the dtensor in tp dimension for the views.
2. Add unit test for 2d_optim_state_dict.
Changes for optim state dict loading and unit test will be in next PR.
| 1 |
257 | 111,339 |
No speedup using semi-structured sparsity
|
module: sparse, triaged
|
When I convert linear layer weights with `to_sparse_semi_structured(module.weight)`, there doesn't appear to be any speedup when I set the dimension of the linear layer as 4096x4096 with input size being 1x4096. Pytorch is compiled with cuSparseLT. Is there any reason why there is no speedup? In addition, the sparse alternative consumes more memory than the dense one. Any hint will be helpful!
cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer
| 2 |
258 | 111,333 |
Additions to functorch_scan
|
open source, release notes: fx, module: inductor, module: dynamo, ciflow/inductor
|
This PR will contain additions to the `functorch_scan` functionality initially created with the PR https://github.com/pytorch/pytorch/pull/104442
The initial changes contain:
1. Scan being moved to higher_order_ops
2. Docstring being added for scan/scan_impl
3. A testcase to torch/testing/_internal/control_flow_opinfo_db.py
The next step would be to enable inductor lowering for scan.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler @websterbei @zou3519 @vadimkantorov @ydwu4
| 2 |
259 | 111,332 |
[dtensor] simply some padding logic
|
ciflow/trunk, release notes: distributed (dtensor)
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111332
This PR simplifes some padding logic to only handle padding when needed,
and avoid doing redudant work when no padding needed, should help reuse
some cpu overhead in eager
| 1 |
260 | 111,331 |
[dynamo] Proposal: `@init_values_once` API for initializing tensors and constants - without tracing the function in Dynamo
|
feature, module: optimizer, triaged, module: dynamo
|
## 🚀 The feature, motivation and pitch
### Consumer: `Optimizer._init_group`
The main driving motivation for this API is `Optimizer._init_group`. It is a function that rearranges the input parameters into lists, which are then multiplexed into downstream `foreach` operators based on their dtype and device.
Note that in a typical training loop, apart from the first initialization, this capture is a noop. The inputs are already mapped to the desired operators. If something about the inputs change (one of them suddenly `not has_grad`, dtype changes, order of the inputs, presence/absence of the input), we will actually want to recompile the graph.
### Requirements
In particular, we need to guard on `_init_group` and not on any downstream compiled artifact, even though `_init_group` itself will not be captured by the graph (we will retrace the original code object when recompiling). This is to ensure that `_init_group` is reexecuted as long as any of the guarded inputs change.
In particular, we are:
1. _guarding a function execution that is not captured by the graph_
2. _ask the user to specify the guarded inputs_
- since we cannot inspect the contents of the marked function, we require that the user upholds the contract (no other mutations/inputs/side-effects apart from guarded).
### API
```python
@init_values_once(
guards=["my_guarded_param"]
)
def _my_func(..., my_guarded_param=..., ...):
...
```
```python
@init_values_once(
guards=["self.state", "self.param_groups", "my_guarded_param"]
)
def _init_group(self, ..., my_guarded_param=..., ...):
...
```
### Implementation Details
1. We can guard on the arbitrary inputs like self.state and self.param_groups using `pytree.flatten`. (actually, we may also need to guard on `DICT_KEYS`. I am unsure if other container types need similar guards, but I suppose in this case that we need to duck-type inputs by their dtype and tensor metas)
2. We can use a similar method to `DisableContext` but with extra guard metadata? What's the advantage of this compared with just installing an attribute on the function itself?
3. We use `inspect.signature` to map guard parameter names to args/kwargs.
### Questions
1. We cant guard outputs of function, for the purpose of this API. However we can (and we should) guard on them as inputs to downstream graphs as it is natural to do... (downstream graphs depending on them recompile if they change, and may not recompile if they do not).
- However, since we cannot map input dependencies to outputs, we have to guard the entire function output on the inputs, which may be stricter than required in some cases.
2. The number of installed guards is quite high. For 1000 tensors, we need to check 1000 guards. Can we make this more efficient somehow? If we expect the guards to pass (in the happy case), then a hashing method could somehow be good.
- regardless, we have to read and check all of the tensor metas at runtime. If we can instead use something like _nested tensor_ maybe such problems (and other perf problems to do with high cardinality, both in dynamo and inductor alike) might go away.
Outdated:
<details>
- Do we need to ensure that downstream is guarded on return values of the `@init_values_once` function? It's unclear if these will derive from guarding on the specified inputs, or we need to guard them explicitly.
- I believe that we don't need to, but it is better if we do (less likely to screw up). Any of mutated values, return values, and inputs which determine the return values can be guarded upon, to equal effect. Mutated values have a reflexive relationship with to guards, but output guard dependence on input is asymmetric.
</details>
### Additional context
See discussion here: https://github.com/pytorch/pytorch/pull/110709#discussion_r1359911501
cc:
@ezyang @voznesenskym @jansel from dynamo / core compiler
@mlazos @janeyx99 from optim
cc @vincentqb @jbschlosser @albanD @janeyx99 @crcrpar @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 7 |
261 | 111,328 |
"InternalTorchDynamoError: source code not available" when using `torch.compile` in ipynb or google colab
|
high priority, triage review, triaged, oncall: pt2
|
### 🐛 Describe the bug
Hi!
Following snippet produces errors:
```py3
import torch
print(torch.__version__) # Tried with 2.1.0+cu121 (latest) and 2.0.1 (default in google colab). All fails
class Linear(nn.Linear):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def forward(self, *args, **kwargs):
return super().forward(*args, **kwargs)
m = Linear(4, 8)
m(torch.randn(3, 4)) # passes
compiled_m = torch.compile(m) # passes
compiled_m(torch.randn(3, 4)) # fails
```
<details>
<summary> Traceback: </summary>
```pytb
2.1.0+cu121
---------------------------------------------------------------------------
InternalTorchDynamoError Traceback (most recent call last)
[<ipython-input-19-61daefda3be3>](https://localhost:8080/#) in <cell line: 15>()
13
14 compiled_m = torch.compile(m) # passes
---> 15 compiled_m(torch.randn(3, 4)) # fails
21 frames
[/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _wrapped_call_impl(self, *args, **kwargs)
1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1517 else:
-> 1518 return self._call_impl(*args, **kwargs)
1519
1520 def _call_impl(self, *args, **kwargs):
[/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _call_impl(self, *args, **kwargs)
1525 or _global_backward_pre_hooks or _global_backward_hooks
1526 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1527 return forward_call(*args, **kwargs)
1528
1529 try:
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py](https://localhost:8080/#) in _fn(*args, **kwargs)
326 dynamic_ctx.__enter__()
327 try:
--> 328 return fn(*args, **kwargs)
329 finally:
330 set_eval_frame(prior)
[/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _wrapped_call_impl(self, *args, **kwargs)
1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1517 else:
-> 1518 return self._call_impl(*args, **kwargs)
1519
1520 def _call_impl(self, *args, **kwargs):
[/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _call_impl(self, *args, **kwargs)
1525 or _global_backward_pre_hooks or _global_backward_hooks
1526 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1527 return forward_call(*args, **kwargs)
1528
1529 try:
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py](https://localhost:8080/#) in catch_errors(frame, cache_entry, frame_state)
488
489 with compile_lock, _disable_current_modes():
--> 490 return callback(frame, cache_entry, hooks, frame_state)
491
492 catch_errors._torchdynamo_orig_callable = callback # type: ignore[attr-defined]
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in _convert_frame(frame, cache_size, hooks, frame_state)
639 counters["frames"]["total"] += 1
640 try:
--> 641 result = inner_convert(frame, cache_size, hooks, frame_state)
642 counters["frames"]["ok"] += 1
643 return result
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in _fn(*args, **kwargs)
131 cleanup = setup_compile_debug()
132 try:
--> 133 return fn(*args, **kwargs)
134 finally:
135 cleanup.close()
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in _convert_frame_assert(frame, cache_entry, hooks, frame_state)
387 )
388
--> 389 return _compile(
390 frame.f_code,
391 frame.f_globals,
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in _compile(code, globals, locals, builtins, compiler_fn, one_graph, export, export_constraints, hooks, cache_size, frame, frame_state, compile_id)
584 fail_reason = str(e)
585 exception_handler(e, code, frame, export=export)
--> 586 raise InternalTorchDynamoError(str(e)).with_traceback(
587 e.__traceback__
588 ) from None
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in _compile(code, globals, locals, builtins, compiler_fn, one_graph, export, export_constraints, hooks, cache_size, frame, frame_state, compile_id)
567 with compile_context(CompileContext(compile_id)):
568 try:
--> 569 guarded_code = compile_inner(code, one_graph, hooks, transform)
570 return guarded_code
571 except (
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/utils.py](https://localhost:8080/#) in time_wrapper(*args, **kwargs)
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):
188 t0 = time.time()
--> 189 r = func(*args, **kwargs)
190 time_spent = time.time() - t0
191 compilation_time_metrics[key].append(time_spent)
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in compile_inner(code, one_graph, hooks, transform)
489 for attempt in itertools.count():
490 try:
--> 491 out_code = transform_code_object(code, transform)
492 orig_code_map[out_code] = code
493 break
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/bytecode_transformation.py](https://localhost:8080/#) in transform_code_object(code, transformations, safe)
1026 propagate_line_nums(instructions)
1027
-> 1028 transformations(instructions, code_options)
1029 return clean_and_assemble_instructions(instructions, keys, code_options)[1]
1030
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/convert_frame.py](https://localhost:8080/#) in transform(instructions, code_options)
439 def transform(instructions, code_options):
440 nonlocal output
--> 441 tracer = InstructionTranslator(
442 instructions,
443 code,
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/symbolic_convert.py](https://localhost:8080/#) in __init__(self, instructions, f_code, f_locals, f_globals, f_builtins, code_options, compiler_fn, one_graph, export, export_constraints, mutated_closure_cell_contents, frame_state)
2016 cells_and_freevars_set = set(cells_and_freevars)
2017
-> 2018 self.symbolic_locals = collections.OrderedDict(
2019 (
2020 k,
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/symbolic_convert.py](https://localhost:8080/#) in <genexpr>(.0)
2019 (
2020 k,
-> 2021 VariableBuilder(
2022 self,
2023 LocalSource(k, cell_or_freevar=k in cells_and_freevars_set),
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/variables/builder.py](https://localhost:8080/#) in __call__(self, value)
221 )
222 return side_effect_result
--> 223 vt = self._wrap(value).clone(**self.options())
224 if self._can_lift_attrs_to_inputs(vt):
225 vt = self.tx.output.side_effects.track_object_existing(
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/variables/builder.py](https://localhost:8080/#) in _wrap(self, value)
490 elif (
491 istype(value, (type, types.FunctionType))
--> 492 and skipfiles.check(getfile(value), allow_torch=True)
493 and not inspect.getattr_static(value, "_torchdynamo_inline", False)
494 ):
[/usr/local/lib/python3.10/dist-packages/torch/_dynamo/utils.py](https://localhost:8080/#) in getfile(obj)
670 def getfile(obj):
671 try:
--> 672 return inspect.getfile(obj)
673 except TypeError:
674 return None
[/usr/local/lib/python3.10/dist-packages/torch/package/package_importer.py](https://localhost:8080/#) in _patched_getfile(object)
694 if object.__module__ in _package_imported_modules:
695 return _package_imported_modules[object.__module__].__file__
--> 696 return _orig_getfile(object)
697
698
[/usr/lib/python3.10/inspect.py](https://localhost:8080/#) in getfile(object)
783 return module.__file__
784 if object.__module__ == '__main__':
--> 785 raise OSError('source code not available')
786 raise TypeError('{!r} is a built-in class'.format(object))
787 if ismethod(object):
InternalTorchDynamoError: source code not available
from user code:
Set TORCH_LOGS="+dynamo" and 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
```
</details>
I guess Issue happens with all user defined models `forward` inside ipynb.
### Versions
```
Collecting environment information...
PyTorch version: 2.1.0+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.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 14.0.0-1ubuntu1.1
CMake version: version 3.27.6
Libc version: glibc-2.35
Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.120+-x86_64-with-glibc2.35
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.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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): 2
On-line CPU(s) list: 0,1
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) CPU @ 2.20GHz
CPU family: 6
Model: 79
Thread(s) per core: 2
Core(s) per socket: 1
Socket(s): 1
Stepping: 0
BogoMIPS: 4400.43
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
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32 KiB (1 instance)
L1i cache: 32 KiB (1 instance)
L2 cache: 256 KiB (1 instance)
L3 cache: 55 MiB (1 instance)
NUMA node(s): 1
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
Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==2.1.0
[pip3] torchaudio==2.0.2+cu118
[pip3] torchdata==0.6.1
[pip3] torchinfo==1.8.0
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.15.2
[pip3] torchvision==0.15.2+cu118
[pip3] triton==2.1.0
[conda] Could not collect
```
cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @wconstab @bdhirsh @anijain2305
| 1 |
262 | 111,326 |
[AOTInductor] Add UpdateConstants for AOTInductorModel
|
module: inductor, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111326
* #111325
* #111324
Summary:
Add update_constants for AOTInductorModel
Test Plan:
Included in commit
Reviewers:
Subscribers:
Tasks:
Tags:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @aakhundov @ColinPeppler
| 1 |
263 | 111,325 |
[AOTInductor] Add test for AOTInductorModel's interface
|
module: inductor, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111326
* __->__ #111325
* #111324
Summary:
Add a runner for AOTInductorModel for easier test.
Add test for existing AOTInductorModel's interface (create & update constants map)
Test Plan:
Commit itself is a test.
Reviewers:
Subscribers:
Tasks:
Tags:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @aakhundov @ColinPeppler
| 1 |
264 | 111,324 |
[AOTInductor] Rename model_runner to model_container_runner
|
ciflow/trunk
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111326
* #111325
* __->__ #111324
Summary:
We rename the model_runner to model_container_runner to prepare for
adding tests of pure model without container.
Test Plan:
commit itself is a test.
Reviewers:
Subscribers:
Tasks:
Tags:
| 3 |
265 | 111,323 |
Device index3
|
open source, release notes: jit
|
Fixes #ISSUE_NUMBER
| 1 |
266 | 111,320 |
test_max_pool1d reliably OOMs after https://github.com/pytorch/pytorch/pull/111216/
|
module: memory usage, triaged, oncall: pt2
|
### 🐛 Describe the bug
tracker issue
sample job https://github.com/pytorch/pytorch/actions/runs/6512785700/job/17691482527
```
test/nn/test_pooling.py::TestPoolingNNDeviceTypeCPU::test_pooling_max_nhwc_cpu_float32, test/nn/test_pooling.py::TestPoolingNNDeviceTypeCPU::test_pooling_max_nhwc_cpu_float64, test/nn/test_pooling.py::TestPoolingNNDeviceTypeCPU::test_pooling_shape_cpu, test/nn/test_pooling.py::TestPoolingNNDeviceTypeCPU::test_pooling_zero_stride_cpu
stepcurrent: skipping 69 already run items.
nn/test_pooling.py::TestPoolingNNDeviceTypeCPU::test_max_pool1d_cpu_float32 LLVM ERROR: out of memory
Fatal Python error: Aborted
Current thread 0x00007fee4c1f5280 (most recent call first):
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/nn/functional.py", line 710 in _max_pool1d
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_jit_internal.py", line 499 in fn
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 1462 in run_node
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 1384 in <lambda>
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 952 in wrap_fake_exception
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 1383 in get_fake_value
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/builder.py", line 1393 in wrap_fx_proxy_cls
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/builder.py", line 1306 in wrap_fx_proxy
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/torch.py", line 654 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 577 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 1190 in CALL_FUNCTION_KW
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 405 in wrapper
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 705 in step
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 742 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 2353 in inline_call_
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 2229 in inline_call
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 613 in inline_user_function_return
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/functions.py", line 90 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/functions.py", line 261 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/functions.py", line 307 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 577 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 1178 in CALL_FUNCTION_EX
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 405 in wrapper
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 705 in step
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 742 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 2353 in inline_call_
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 2229 in inline_call
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 613 in inline_user_function_return
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/functions.py", line 90 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/functions.py", line 261 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/variables/nn_module.py", line 727 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 577 in call_function
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 1138 in CALL_FUNCTION
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 405 in wrapper
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 705 in step
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 742 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 2102 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 485 in transform
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/bytecode_transformation.py", line 1028 in transform_code_object
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 515 in compile_inner
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 221 in time_wrapper
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 598 in _compile
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 390 in _convert_frame_assert
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 143 in _fn
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 671 in _convert_frame
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/eval_frame.py", line 549 in catch_errors
File "nn/test_pooling.py", line 840 in <resume in test_max_pool1d>
File "nn/test_pooling.py", line 834 in <resume in test_max_pool1d>
File "nn/test_pooling.py", line 833 in <resume in test_max_pool1d>
File "nn/test_pooling.py", line 832 in <resume in test_max_pool1d>
File "nn/test_pooling.py", line 831 in test_max_pool1d
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_device_type.py", line 1084 in only_fn
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_device_type.py", line 415 in instantiated_test
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_utils.py", line 2453 in wrapper
File "/opt/conda/envs/py_3.8/lib/python3.8/unittest/case.py", line 633 in _callTestMethod
File "/opt/conda/envs/py_3.8/lib/python3.8/unittest/case.py", line 676 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/external_utils.py", line 17 in inner
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/_dynamo/eval_frame.py", line 401 in _fn
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_utils.py", line 2526 in _run_with_retry
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_utils.py", line 2597 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_device_type.py", line 476 in run
File "/opt/conda/envs/py_3.8/lib/python3.8/unittest/case.py", line 736 in __call__
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/unittest.py", line 333 in runtest
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/runner.py", line 169 in pytest_runtest_call
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/runner.py", line 262 in <lambda>
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/runner.py", line 341 in from_call
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/runner.py", line 261 in call_runtest_hook
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/runner.py", line 222 in call_and_report
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/runner.py", line 133 in runtestprotocol
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pytest_rerunfailures.py", line 608 in pytest_runtest_protocol
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/main.py", line 348 in pytest_runtestloop
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/main.py", line 323 in _main
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/main.py", line 269 in wrap_session
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/_pytest/config/__init__.py", line 166 in main
File "/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/testing/_internal/common_utils.py", line 965 in run_tests
File "nn/test_pooling.py", line 1545 in <module>
FINISHED PRINTING LOG FILE of nn/test_pooling 1/1 (/var/lib/jenkins/workspace/test/test-reports/nn.test_pooling_1.1_z1q3pb3i_toprint.log)
```
### Versions
main
cc @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
267 | 111,318 |
[dynamo] Make configs more deterministic
|
module: bc-breaking, triaged, open source, module: inductor, module: dynamo, ciflow/inductor, release notes: dynamo, topic: bc_breaking
|
While not strictly necessary, it will definitely make config serialization easier and more portable, which may better support future efforts and testing/debugging.
Part of https://github.com/pytorch/pytorch/issues/111235
Split out from: https://github.com/pytorch/pytorch/pull/111298
cc @ezyang @gchanan @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler @yanboliang
| 3 |
268 | 111,317 |
Torch 2.1 compile + FSDP (mixed precision) + LlamaForCausalLM: `RuntimeError: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'.`
|
high priority, triage review, oncall: distributed, triaged, module: fsdp, oncall: pt2
|
### 🐛 Describe the bug
I am getting the following error when training LlamaForCausalLM with torch 2.1 and FSDP (mixed precision) and torch.compile. Same exact code works when torch.compile disabled or when torch 2.0.1 is used. I also tried enabling and disabling amp autocast, it doesn't matter and the same error happens.
```
RuntimeError: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'.
Please ensure that the gradient and the tensor have the same dtype
```
I am using a docker image, error happens in **Environment 2** which is provided in the **Versions** section.
### Error logs
```
0%| | 0/5 [00:00<?, ?it/s]Traceback (most recent call last):
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
Traceback (most recent call last):
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
main()
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
outputs = model(**batch)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
main()
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
outputs = model(**batch)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
Traceback (most recent call last):
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
Traceback (most recent call last):
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
Traceback (most recent call last):
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
Traceback (most recent call last):
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
main()
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return forward_call(*args, **kwargs)outputs = model(**batch)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
main()
main()
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
outputs = model(**batch)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
outputs = model(**batch)
return fn(*args, **kwargs)
main() File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 511, in <module>
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
outputs = model(**batch)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return self._call_impl(*args, **kwargs)return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
main()
File "/workspace/workdir/models/pretraining/huggingface/llama/pretrain_fsdp_torch2.1_minimal.py", line 387, in main
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
outputs = model(**batch)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
return forward_call(*args, **kwargs)
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return fn(*args, **kwargs)
return fn(*args, **kwargs)return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return fn(*args, **kwargs)
output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return self._call_impl(*args, **kwargs)
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
return forward_call(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return self._call_impl(*args, **kwargs)return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return model_forward(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/_dynamo/external_utils.py", line 17, in inner
return self._call_impl(*args, **kwargs)
return fn(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
return forward_call(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
return model_forward(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
outputs = self.model(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return convert_to_fp32(self.model_forward(*args, **kwargs))
return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 839, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
outputs = self.model(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return forward_call(*args, **kwargs)output = self._fsdp_wrapped_module(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
return forward_call(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return model_forward(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
return forward_call(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
return self._call_impl(*args, **kwargs) return model_forward(*args, **kwargs)
return model_forward(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
layer_outputs = decoder_layer(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return convert_to_fp32(self.model_forward(*args, **kwargs))
return convert_to_fp32(self.model_forward(*args, **kwargs)) File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
return forward_call(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
return model_forward(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
outputs = self.model(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return forward_call(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 659, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
outputs = self.model(
outputs = self.model( File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return convert_to_fp32(self.model_forward(*args, **kwargs))layer_outputs = decoder_layer(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
return model_forward(*args, **kwargs)
File "/workspace/accelerate/src/accelerate/utils/operations.py", line 647, in __call__
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 16, in decorate_autocast
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return func(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 1034, in forward
outputs = self.model(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
args, kwargs = _pre_forward(
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
return forward_call(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
unshard_fn(state, handle)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
return forward_call(*args, **kwargs)
return forward_call(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
outputs = self.model(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
layer_outputs = decoder_layer(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
args, kwargs = _pre_forward(
layer_outputs = decoder_layer(layer_outputs = decoder_layer( File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
ran_pre_unshard = handle.pre_unshard()
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
unshard_fn(state, handle)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream)
ret = self._writeback_orig_params() File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
return self._call_impl(*args, **kwargs)return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return func(*args, **kwargs)ran_pre_unshard = handle.pre_unshard()
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 2202, in _writeback_orig_params
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
return forward_call(*args, **kwargs)
File "/workspace/transformers/src/transformers/models/llama/modeling_llama.py", line 921, in forward
layer_outputs = decoder_layer(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
layer_outputs = decoder_layer(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
ret = self._writeback_orig_params()
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
args, kwargs = _pre_forward(
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
return self._call_impl(*args, **kwargs)return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 2202, in _writeback_orig_params
args, kwargs = _pre_forward(
args, kwargs = _pre_forward( File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
unshard_fn(state, handle)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
flat_param.grad = flat_param_grad
RuntimeError: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'. Please ensure that the gradient and the tensor have the same dtype
Traceback (most recent call last):
unshard_fn(state, handle)unshard_fn(state, handle)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream)
ran_pre_unshard = handle.pre_unshard() File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream) File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
ran_pre_unshard = handle.pre_unshard()
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
ran_pre_unshard = handle.pre_unshard()
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
flat_param.grad = flat_param_grad
RuntimeError: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'. Please ensure that the gradient and the tensor have the same dtype
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 825, in forward
args, kwargs = _pre_forward(
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
ret = self._writeback_orig_params()
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 2202, in _writeback_orig_params
unshard_fn(state, handle)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
ret = self._writeback_orig_params()ret = self._writeback_orig_params()
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
args, kwargs = _pre_forward(
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 429, in _pre_forward
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 2202, in _writeback_orig_params
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 2202, in _writeback_orig_params
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
unshard_fn(state, handle)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 464, in _pre_forward_unshard
ran_pre_unshard = handle.pre_unshard()
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
_unshard(state, handle, state._unshard_stream, state._pre_unshard_stream)
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/_runtime_utils.py", line 336, in _unshard
ran_pre_unshard = handle.pre_unshard()
File "/usr/local/lib/python3.10/dist-packages/torch/distributed/fsdp/flat_param.py", line 1194, in pre_unshard
flat_param.grad = flat_param_grad
RuntimeError: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'. Please ensure that the gradient and the tensor have the same dtype
flat_param.grad = flat_param_grad
flat_param.grad = flat_param_grad
ret = self._writeback_orig_params()
RuntimeError File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
RuntimeError: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'. Please ensure that the gradient and the tensor have the same dtype: attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype 'float'. Please ensure that the gradient and the tensor have the same dtype
============================================================
pretrain_fsdp_torch2.1_minimal.py FAILED
------------------------------------------------------------
Failures:
[1]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 2 (local_rank: 2)
exitcode : 1 (pid: 348906)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[2]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 3 (local_rank: 3)
exitcode : 1 (pid: 348907)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[3]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 4 (local_rank: 4)
exitcode : 1 (pid: 348908)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[4]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 5 (local_rank: 5)
exitcode : 1 (pid: 348909)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[5]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 6 (local_rank: 6)
exitcode : 1 (pid: 348910)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[6]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 7 (local_rank: 7)
exitcode : 1 (pid: 348911)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
time : 2023-10-14_20:44:01
host : ec3b2a9a542c
rank : 1 (local_rank: 1)
exitcode : 1 (pid: 348905)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================
```
### Minified repro
_No response_
### Versions
**Environment 1**
```
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 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.27.4
Libc version: glibc-2.35
Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-86-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.2.128
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
GPU 4: NVIDIA A100-SXM4-80GB
GPU 5: NVIDIA A100-SXM4-80GB
GPU 6: NVIDIA A100-SXM4-80GB
GPU 7: NVIDIA A100-SXM4-80GB
Nvidia driver version: 535.104.12
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 224
On-line CPU(s) list: 0-223
Vendor ID: AuthenticAMD
Model name: AMD EPYC 7713 64-Core Processor
CPU family: 25
Model: 1
Thread(s) per core: 1
Core(s) per socket: 224
Socket(s): 1
Stepping: 1
BogoMIPS: 3999.99
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 perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt nrip_save umip vaes vpclmulqdq rdpid fsrm arch_capabilities
Virtualization: AMD-V
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 14 MiB (224 instances)
L1i cache: 14 MiB (224 instances)
L2 cache: 112 MiB (224 instances)
L3 cache: 3.5 GiB (224 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-223
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Mitigation; safe RET
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 disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] numpy==1.23.1
[pip3] onnx==1.14.0
[pip3] pytorch-quantization==2.1.2
[pip3] torch==2.0.1
[pip3] torch-tensorrt==2.0.0.dev0
[pip3] torchdata==0.7.0a0
[pip3] torchtext==0.16.0a0
[pip3] torchvision==0.16.0
[pip3] triton==2.0.0
[conda] Could not collect
```
**Environment 2**
```
Collecting environment information...
PyTorch version: 2.1.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.27.4
Libc version: glibc-2.35
Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-86-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.2.128
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
GPU 4: NVIDIA A100-SXM4-80GB
GPU 5: NVIDIA A100-SXM4-80GB
GPU 6: NVIDIA A100-SXM4-80GB
GPU 7: NVIDIA A100-SXM4-80GB
Nvidia driver version: 535.104.12
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 224
On-line CPU(s) list: 0-223
Vendor ID: AuthenticAMD
Model name: AMD EPYC 7713 64-Core Processor
CPU family: 25
Model: 1
Thread(s) per core: 1
Core(s) per socket: 224
Socket(s): 1
Stepping: 1
BogoMIPS: 3999.99
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 perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt nrip_save umip vaes vpclmulqdq rdpid fsrm arch_capabilities
Virtualization: AMD-V
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 14 MiB (224 instances)
L1i cache: 14 MiB (224 instances)
L2 cache: 112 MiB (224 instances)
L3 cache: 3.5 GiB (224 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-223
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Mitigation; safe RET
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 disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] numpy==1.23.1
[pip3] onnx==1.14.0
[pip3] pytorch-quantization==2.1.2
[pip3] torch==2.1.0
[pip3] torch-tensorrt==2.0.0.dev0
[pip3] torchdata==0.7.0a0
[pip3] torchtext==0.16.0a0
[pip3] torchvision==0.16.0
[pip3] triton==2.1.0+e621604
[conda] Could not collect
```
cc @ezyang @gchanan @zou3519 @kadeng @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @fegin @msaroufim @wconstab @bdhirsh @anijain2305
| 2 |
269 | 111,313 |
Remove dynamo suported check for Windows.
|
triaged, open source, module: dynamo, ciflow/inductor, release notes: dynamo
|
We've had developers using Dynamo via torch.compile and torch._dynamo.export for months on Windows via SHARK (by just deleting these lines locally). The Windows check is moved to just the inductor backend, since it is based on Triton not supporting Windows.
Progress on #90768
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 6 |
270 | 111,310 |
Rewrite torch.library's documentation
|
release notes: composability
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111661
* #111660
* __->__ #111310
* #111659
* #111380
We mention the higher-level torch.library APIs and put the original docs
into a low-level API section.
| 1 |
271 | 111,306 |
[dynamo] Add LazyVariableTracker
|
ciflow/trunk, topic: not user facing, module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111726
* #111725
* #111415
* #111614
* #111717
* __->__ #111306
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 4 |
272 | 111,303 |
[dynamo] annotate config with `@compile_ignored`
|
open source, module: inductor, module: dynamo, ciflow/inductor, release notes: dynamo
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111300
* #111299
* #111298
* __->__ #111303
Fixes: #111221
cc @ezyang @voznesenskym @Chillee @yanboliang
| 7 |
273 | 111,302 |
Deprecated verbose parameter in LR schedulers
|
triaged, open source, topic: deprecation, release notes: optim
|
Fixes https://github.com/pytorch/pytorch/issues/100847
This PR follows the comment in https://github.com/pytorch/pytorch/issues/100847#issuecomment-1546247239 by deprecating the `verbose` parameter and removing the print statements. Removing the print statements is technically BC breaking, so I would be okay with putting them back in.
To be less annoying, this PR raises a warning only when `verbose` is explicitly passed in.
| 1 |
274 | 111,300 |
[dynamo] Cache size calc for differing config
|
open source, module: dynamo, ciflow/inductor, release notes: dynamo
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111300
* #111299
* #111298
* #111303
cc @voznesenskym @ezyang @Chillee
| 2 |
275 | 111,299 |
[dynamo] guarded config
|
open source, module: dynamo, ciflow/inductor, release notes: dynamo
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111300
* __->__ #111299
* #111298
* #111303
---
Fixes: https://github.com/pytorch/pytorch/issues/110682
Replaces: https://github.com/pytorch/pytorch/pull/111074
The guards are installed based on config that is valid at the call to `torch.compile`, rather than at any subsequent call / triggered compilation. Subsequent compilations will restore the config if there is a config mismatch of the existing global config with the saved config.
TODO:
- [X] add tests
Follow up PRs:
- [x] add revised cache size computation (follow up PR: #111300 , based on: https://github.com/pytorch/pytorch/pull/107496)
- [ ] handle run-only mode?
- [ ] config restoration itself is not thread-safe (tracked: https://github.com/pytorch/pytorch/issues/111150)
cc @voznesenskym @ezyang @Chillee
| 3 |
276 | 111,298 |
[dynamo] md5 hash non `compile_ignored` configs
|
open source, topic: not user facing, module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111300
* #111299
* __->__ #111298
* #111303
fixes: https://github.com/pytorch/pytorch/issues/111235
cc @voznesenskym @ezyang @Chillee
| 3 |
277 | 111,281 |
[Quant] [PT2] Add ConvBNAdd(ReLU) Annotation into X86InductorQuantizer
|
open source, ciflow/trunk, release notes: quantization, module: inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111281
* #111280
**Summary**
This PR adds ConvBNAdd(ReLU) QAT Annotation into `X86InductorQuantizer`.
**Test Plan**
```
python -m pytest test_x86inductor_quantizer.py -k test_qat_conv2d_binary_with_quantizer_api
python -m pytest test_x86inductor_quantizer.py -k test_qat_conv2d_binary_unary_with_quantizer_api
python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_qconv2d_add
python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_qconv2d_add_relu
```
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 1 |
278 | 111,280 |
[Quant] [PT2] Enable QAT Quantization flow in X86InductorQuantizer
|
open source, ciflow/trunk, release notes: quantization, module: inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #111281
* __->__ #111280
**Summary**
This PR enables PT2 QAT Quantization flow in `X86InductorQuantizer`.
**Test Plan**
```
python -m pytest test_x86inductor_quantizer.py -k test_qat_conv2d_with_quantizer_api
python -m pytest test_x86inductor_quantizer.py -k test_qat_conv2d_unary_with_quantizer_api
python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_qconv2d
python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_qconv2d_relu
```
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 1 |
279 | 111,279 |
Cannot use compiled model together with the ddp strategy
|
oncall: distributed
|
### 🐛 Describe the bug
Cannot use compiled model together with the `ddp` strategy, and the error disappears when change the strategy to `auto`.
CMD:
```
python code.py
```
code (`code.py`):
```python
from typing import *
import pytorch_lightning as pl
import torch
import torch.nn as nn
from jsonargparse import lazy_instance
from packaging.version import Version
from torch import Tensor
from torch.nn import MultiheadAttention
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader, Dataset
def default_collate_func(batches: List[Tuple[Tensor, Tensor, Dict[str, Any]]]) -> List[Any]:
mini_batch = []
for x in zip(*batches):
if isinstance(x[0], Tensor):
x = torch.stack(x)
mini_batch.append(x)
return mini_batch
class SmsWsjPlusDataset(Dataset):
def __init__(self,) -> None:
super().__init__()
def __getitem__(self, index: int):
return torch.randn((129, 251, 12)), torch.randn((2, 129, 251)), {'index': index, 'sample_rate': 8000}
def __len__(self):
return 100000
class SmsWsjPlusDataModule(LightningDataModule):
def __init__(self,):
super().__init__()
def construct_dataloader(self):
ds = SmsWsjPlusDataset()
return DataLoader(ds, batch_size=1, collate_fn=default_collate_func, num_workers=2)
def train_dataloader(self) -> DataLoader:
return self.construct_dataloader()
def val_dataloader(self) -> DataLoader:
return self.construct_dataloader()
class SpatialNet(nn.Module):
def __init__(self,):
super().__init__()
self.encoder = nn.Conv1d(in_channels=12, out_channels=96, kernel_size=5, stride=1, padding="same")
layers = []
for l in range(2):
layer = nn.ModuleList([nn.LayerNorm(96), MultiheadAttention(embed_dim=96, num_heads=4, batch_first=True)])
layers.append(layer)
self.layers = nn.ModuleList(layers)
self.decoder = nn.Linear(in_features=96, out_features=4)
def forward(self, x: Tensor, return_attn_score: bool = False) -> Tensor:
# x: [Batch, Freq, Time, Feature]
B, F, T, H0 = x.shape
x = self.encoder(x.reshape(B * F, T, H0).permute(0, 2, 1)).permute(0, 2, 1)
H = x.shape[2]
attns = [] if return_attn_score else None
x = x.reshape(B, F, T, H)
for m in self.layers:
x = x.reshape(B * F, T, H)
x = m[0](x)
x, attn = m[1].forward(x, x, x)
x = x.reshape(B, F, T, H)
if return_attn_score:
attns.append(attn)
y = self.decoder(x)
if return_attn_score:
return y.contiguous(), attns
else:
return y.contiguous()
class TrainModule(pl.LightningModule):
def __init__(self, arch: nn.Module = lazy_instance(SpatialNet), compile: bool = False):
super().__init__()
if compile != False:
assert Version(torch.__version__) >= Version('2.0.0'), f'compile only works for torch>=2.0: current version: {torch.__version__}'
self.arch = torch.compile(arch)
else:
self.arch = arch
def forward(self, x: Tensor) -> Tensor:
B, F, T, H = x.shape
out = self.arch(x)
out = torch.view_as_complex(out.float().reshape(B, F, T, -1, 2)) # [B,F,T,Spk]
out = out.permute(0, 3, 1, 2) # [B,Spk,F,T]
return out
def training_step(self, batch, batch_idx):
x, ys, paras = batch
yr_hat = self.forward(x)
loss = (ys - yr_hat).abs().mean()
self.log('train/loss', loss, batch_size=ys[0].shape[0], prog_bar=True)
return loss
def validation_step(self, batch, batch_idx):
x, ys, paras = batch
yr_hat = self.forward(x)
loss = (ys - yr_hat).abs().mean()
self.log('val/loss', loss, sync_dist=True, batch_size=ys.shape[0])
def configure_optimizers(self):
return torch.optim.Adam(self.parameters())
if __name__ == '__main__':
arch = SpatialNet()
model = TrainModule(arch=arch, compile=True)
datamodule = SmsWsjPlusDataModule()
from pytorch_lightning import Trainer
trainer = Trainer(strategy='ddp', devices="0,") # strategy='auto' is OK
trainer.fit(model=model, datamodule=datamodule)
```
The error reported:
```
Traceback (most recent call last):
File "/mnt/home/quancs/projects/NBSS/SharedTrainer2.py", line 128, in <module>
trainer.fit(model=model, datamodule=datamodule)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 545, in fit
call._call_and_handle_interrupt(
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 43, in _call_and_handle_interrupt
return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 102, in launch
return function(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 581, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 990, in _run
results = self._run_stage()
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1034, in _run_stage
self._run_sanity_check()
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1063, in _run_sanity_check
val_loop.run()
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/loops/utilities.py", line 181, in _decorator
return loop_run(self, *args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 134, in run
self._evaluation_step(batch, batch_idx, dataloader_idx, dataloader_iter)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 391, in _evaluation_step
output = call._call_strategy_hook(trainer, hook_name, *step_args)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 309, in _call_strategy_hook
output = fn(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/strategies/strategy.py", line 402, in validation_step
return self._forward_redirection(self.model, self.lightning_module, "validation_step", *args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/strategies/strategy.py", line 628, in __call__
wrapper_output = wrapper_module(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1519, in forward
else self._run_ddp_forward(*inputs, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1355, in _run_ddp_forward
return self.module(*inputs, **kwargs) # type: ignore[index]
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/pytorch_lightning/strategies/strategy.py", line 621, in wrapped_forward
out = method(*_args, **_kwargs)
File "/mnt/home/quancs/projects/NBSS/SharedTrainer2.py", line 113, in validation_step
yr_hat = self.forward(x)
File "/mnt/home/quancs/projects/NBSS/SharedTrainer2.py", line 99, in forward
out = self.arch(x)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
return fn(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 487, in catch_errors
return hijacked_callback(frame, cache_entry, hooks, frame_state)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 641, in _convert_frame
result = inner_convert(frame, cache_size, hooks, frame_state)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 133, in _fn
return fn(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 389, in _convert_frame_assert
return _compile(
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 569, in _compile
guarded_code = compile_inner(code, one_graph, hooks, transform)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
r = func(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 491, in compile_inner
out_code = transform_code_object(code, transform)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
transformations(instructions, code_options)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 458, in transform
tracer.run()
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 2074, in run
super().run()
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 724, in run
and self.step()
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in step
getattr(self, inst.opname)(inst)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 2162, in RETURN_VALUE
self.output.compile_subgraph(
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 833, in compile_subgraph
self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 957, in compile_and_call_fx_graph
compiled_fn = self.call_user_compiler(gm)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
r = func(*args, **kwargs)
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 1024, in call_user_compiler
raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 1009, in call_user_compiler
compiled_fn = compiler_fn(gm, self.example_inputs())
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/_dynamo/backends/distributed.py", line 268, in compile_fn
if maybe_param.requires_grad and not self._ignore_parameter(
File "/mnt/home/quancs/miniconda3/envs/torch211/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
torch._dynamo.exc.BackendCompilerFailed: backend='compile_fn' raised:
AttributeError: 'MultiheadAttention' object has no attribute 'requires_grad'
Set TORCH_LOGS="+dynamo" and 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
```
### Versions
Collecting environment information...
PyTorch version: 2.1.0
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Clang version: Could not collect
CMake version: version 2.8.12.2
Libc version: glibc-2.17
Python version: 3.9.0 (default, Nov 15 2020, 14:28:56) [GCC 7.3.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
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: 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): 128
On-line CPU(s) list: 0-127
Thread(s) per core: 1
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
CPU MHz: 2250.000
CPU max MHz: 2250.0000
CPU min MHz: 1500.0000
BogoMIPS: 4491.67
Virtualization: AMD-V
L1d cache: 32K
L1i cache: 32K
L2 cache: 512K
L3 cache: 16384K
NUMA node0 CPU(s): 0-15
NUMA node1 CPU(s): 16-31
NUMA node2 CPU(s): 32-47
NUMA node3 CPU(s): 48-63
NUMA node4 CPU(s): 64-79
NUMA node5 CPU(s): 80-95
NUMA node6 CPU(s): 96-111
NUMA node7 CPU(s): 112-127
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 art rep_good nopl nonstop_tsc extd_apicid aperfmperf eagerfpu 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 ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_l2 cpb cat_l3 cdp_l3 hw_pstate sme retpoline_amd ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip overflow_recov succor smca
Versions of relevant libraries:
[pip3] mypy==1.6.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.3
[pip3] pytorch-lightning==2.1.0
[pip3] torch==2.1.0
[pip3] torchaudio==2.1.0
[pip3] torcheval==0.0.6
[pip3] torchmetrics==1.2.0
[pip3] torchtnt==0.2.1
[pip3] torchvision==0.16.0
[pip3] triton==2.1.0
[conda] blas 1.0 mkl
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] libjpeg-turbo 2.0.0 h9bf148f_0 pytorch
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py39h7f8727e_0
[conda] mkl_fft 1.3.1 py39hd3c417c_0
[conda] mkl_random 1.2.2 py39h51133e4_0
[conda] numpy 1.24.3 py39h14f4228_0
[conda] numpy-base 1.24.3 py39h31eccc5_0
[conda] pytorch 2.1.0 py3.9_cuda12.1_cudnn8.9.2_0 pytorch
[conda] pytorch-cuda 12.1 ha16c6d3_5 pytorch
[conda] pytorch-lightning 2.1.0 pypi_0 pypi
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] torchaudio 2.1.0 py39_cu121 pytorch
[conda] torcheval 0.0.6 pypi_0 pypi
[conda] torchmetrics 1.2.0 pypi_0 pypi
[conda] torchtnt 0.2.1 pypi_0 pypi
[conda] torchtriton 2.1.0 py39 pytorch
[conda] torchvision 0.16.0 py39_cu121 pytorch
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu
| 1 |
280 | 111,264 |
[vision hash update] update the pinned vision hash
|
open source, ciflow/trunk, topic: not user facing, ciflow/inductor
|
This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/main/.github/workflows/_update-commit-hash.yml).
Update the pinned vision hash.
| 4 |
281 | 111,263 |
Specialize on symint if used as a dict key
|
module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111263
[WIP] Needs tests - specialize on symint if used as a dict key
cc @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 2 |
282 | 111,257 |
[pytorch] bfloat16 support in erfinv
|
fb-exported, release notes: cuda
|
Differential Revision: D50280766
| 4 |
283 | 111,255 |
[AOTInductor] 14k models: AssertionError: Dynamo attempts to add additional input during export
|
triaged, oncall: pt2
|
### 🐛 Describe the bug
53 errors like: AssertionError: Dynamo attempts to add additional input during export: value=0.1767766952966369, source=NNModuleSource(base=AttrSource(base=NNModuleSource(base=AttrSource(base=LocalSource(local_name='self', cell_or_freevar=False), member='wscale')), member='scale')) (example ./generated/test_taesungp_contrastive_unpaired_translation.py:Generator # pytest ./generated/test_taesungp_contrastive_unpaired_translation.py -k test_007)
repro:
```
git clone https://github.com/jansel/pytorch-jit-paritybench.git
# set PYTHONPATH like the following example
PYTHONPATH=/home/yangche/work/pytorch-jit-paritybench/paritybench:$PYTHONPATH python main.py --compile_mode=aot_inductor -e ./generated/test_taesungp_contrastive_unpaired_translation.py
```
### Versions
Collecting environment information...
PyTorch version: 2.2.0a0+git9e8da56
Is debug build: False
CUDA used to build PyTorch: 12.0
ROCM used to build PyTorch: N/A
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
284 | 111,254 |
[AOTInductor] 14k models: AssertionError: Failed to produce a graph during tracing. Tracing through 'f' must produce a single graph.
|
triaged, oncall: pt2
|
### 🐛 Describe the bug
169 errors like: AssertionError: Failed to produce a graph during tracing. Tracing through 'f' must produce a single graph. (example ./generated/test_alibaba_FederatedScope.py:DummyRegularizer # pytest ./generated/test_alibaba_FederatedScope.py -k test_002)
repro:
```
git clone https://github.com/jansel/pytorch-jit-paritybench.git
# set PYTHONPATH like the following example
PYTHONPATH=/home/yangche/work/pytorch-jit-paritybench/paritybench:$PYTHONPATH python main.py --compile_mode=aot_inductor -e ./generated/test_alibaba_FederatedScope.py
```
### Versions
Versions
Versions
Collecting environment information...
PyTorch version: 2.2.0a0+git9e8da56
Is debug build: False
CUDA used to build PyTorch: 12.0
ROCM used to build PyTorch: N/A
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
285 | 111,252 |
[AOTInductor] 14k models: UserError: Tried to use data-dependent value in the subsequent computation
|
triaged, oncall: pt2
|
### 🐛 Describe the bug
40 errors like: UserError: Tried to use data-dependent value in the subsequent computation. This can happen when we encounter unbounded dynamic value that is unknown during tracing time.You will need to explicitly give hint to the compiler. Please take a look at constrain_as_value OR constrain_as_size APIs (example ./generated/test_wasidennis_AdaptSegNet.py:CrossEntropy2d # pytest ./generated/test_wasidennis_AdaptSegNet.py -k test_002)
How to repro:
```
git clone https://github.com/jansel/pytorch-jit-paritybench.git
# set PYTHONPATH like the following example
PYTHONPATH=/home/yangche/work/pytorch-jit-paritybench/paritybench:$PYTHONPATH python main.py --compile_mode=aot_inductor -e ./generated/test_wasidennis_AdaptSegNet.py
```
### Versions
Versions
Versions
Collecting environment information...
PyTorch version: 2.2.0a0+git9e8da56
Is debug build: False
CUDA used to build PyTorch: 12.0
ROCM used to build PyTorch: N/A
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
286 | 111,250 |
[AOTInductor] 14k models: AssertionError: original output #2 is None, but only the following types are supported
|
triaged, oncall: pt2
|
### 🐛 Describe the bug
85 errors like: AssertionError: original output # 1 is None, but only the following types are supported: (<class 'torch.Tensor'>, <class 'torch.SymInt'>, <class 'torch.SymFloat'>, <class 'torch.SymBool'>) (example ./generated/test_nlp_uoregon_trankit.py:SelfAttention # pytest ./generated/test_nlp_uoregon_trankit.py -k test_031)
How to repro:
```
git clone https://github.com/jansel/pytorch-jit-paritybench.git
# set PYTHONPATH like the following example
PYTHONPATH=/home/yangche/work/pytorch-jit-paritybench/paritybench:$PYTHONPATH python main.py --compile_mode=aot_inductor -e ./generated/test_nlp_uoregon_trankit.py
```
### Versions
Versions
Collecting environment information...
PyTorch version: 2.2.0a0+git9e8da56
Is debug build: False
CUDA used to build PyTorch: 12.0
ROCM used to build PyTorch: N/A
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
287 | 111,247 |
pytorch index_select is too slow
|
module: performance, module: cuda, triaged
|
### 🐛 Describe the bug
pytorch's `index_select` function could be faster.
I tested multiple versions of pytorch's `index_select` function against two possibly implementation using a CUDA extension that I wrote. The extension outperforms all pytorch implementations. I'm not yet sure why.
index_select.py:
```python
#!/usr/bin/env python3
import torch
import time
from torch.utils.cpp_extension import load
index_select = load(
name='index_select',
sources=["index_select.cu"],
build_directory='.',
verbose=True,
extra_cuda_cflags=["--expt-extended-lambda"],
)
def main():
randomize_trials = 3;
index_select_trials = 3;
key_type = torch.int32
indices_type = torch.int32
array_size = 1000;
indices_count = 10000000;
for _ in range(randomize_trials):
keys = torch.randint(0, 100000, (array_size,), device="cuda", dtype=key_type)
indices = torch.randint(0, array_size, (indices_count,), device="cuda", dtype=indices_type)
for _ in range(index_select_trials):
out = torch.empty((indices.size(0),), device="cuda", dtype=keys.dtype)
torch.cuda.nvtx.range_push("torch.index_select_out")
torch.index_select(keys, 0, indices, out=out)
torch.cuda.nvtx.range_pop()
torch.cuda.nvtx.range_push("cuda 1024x1024")
out2 = index_select.index_select(keys, indices, 1024, 1024)
torch.cuda.nvtx.range_pop()
torch.cuda.nvtx.range_push("cuda 864x128")
out3 = index_select.index_select(keys, indices, 864, 128)
torch.cuda.nvtx.range_pop()
torch.cuda.nvtx.range_push("torch.index_select")
out4 = torch.index_select(keys, 0, indices)
torch.cuda.nvtx.range_pop()
torch.cuda.nvtx.range_push("keys[indcies]")
out5 = keys[indices]
torch.cuda.nvtx.range_pop()
assert torch.sum(out == out2, 0) == indices_count
assert torch.sum(out == out3, 0) == indices_count
assert torch.sum(out == out4, 0) == indices_count
assert torch.sum(out == out5, 0) == indices_count
if __name__ == "__main__":
main()
```
index_select.cu:
```cuda
#include <pybind11/pybind11.h>
#include <torch/extension.h>
#include <chrono>
template <typename hash_index_type, typename key_type>
__global__ void index_select_kernel(hash_index_type* __restrict__ out,
const hash_index_type* __restrict__ input,
const key_type* __restrict__ indices,
int64_t indices_count) {
// _D is the size of data, 30 million
// _N is the size of mask, 30 million
// data[_N] will contain the id for each element when we're done. HASH
// ids[_N] are the elements that we want to hash. INPUT
// hash[_M] is the size of the hash, like 180 HASH
// hash element _M will be used for atomics.
auto block_count = gridDim.x;
auto threads_per_block = blockDim.x;
auto block_index = blockIdx.x;
auto thread_in_block_index = threadIdx.x;
auto thread_in_grid_index = threads_per_block * block_index + thread_in_block_index;
// Finally, for each element, we look up the position of its
// representative in the hash and write it into the output.
for (uint64_t i = thread_in_grid_index; i < indices_count; i += threads_per_block*block_count) {
auto current_index = indices[i];
assert(current_index < 1000000);
out[i] = input[current_index];
}
}
torch::Tensor index_select(torch::Tensor keys, torch::Tensor indices, uint blocks, uint threads_per_block) {
auto key_tensor_options = torch::TensorOptions()
.dtype(keys.dtype())
.device(torch::kCUDA);
auto out = torch::empty(indices.size(0), key_tensor_options);
index_select_kernel<<<blocks, threads_per_block>>>(
out.template data_ptr<int32_t>(), keys.data_ptr<int32_t>(), indices.data_ptr<int32_t>(),
indices.size(0));
return out;
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("index_select", &index_select, "blah blah");
}
```
### Versions
```
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: Ubuntu 20.04.6 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.27.5
Libc version: glibc-2.31
Python version: 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-1049-azure-x86_64-with-glibc2.29
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA A100 80GB PCIe
Nvidia driver version: 535.113.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.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: 1
Core(s) per socket: 24
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 25
Model: 1
Model name: AMD EPYC 7V13 64-Core Processor
Stepping: 1
CPU MHz: 2445.437
BogoMIPS: 4890.87
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 768 KiB
L1i cache: 768 KiB
L2 cache: 12 MiB
L3 cache: 96 MiB
NUMA node0 CPU(s): 0-23
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Mitigation; safe RET, no microcode
Vulnerability Spec store bypass: Vulnerable
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
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 tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat umip vaes vpclmulqdq rdpid fsrm
Versions of relevant libraries:
[pip3] numpy==1.24.4
[pip3] torch==2.0.0
[pip3] triton==2.0.0
[conda] Could not collect
```
cc @ptrblck
| 2 |
288 | 111,246 |
[C10D] address PR feedback for test_hooks.py
|
ciflow/trunk, topic: not user facing, merging
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #109739
* #111239
* __->__ #111246
| 4 |
289 | 111,239 |
[C10D] callback cleanups and comments
|
release notes: distributed (c10d)
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #109739
* __->__ #111239
* #111246
Should be purely cosmetic changes
| 1 |
290 | 111,236 |
Add tensor parallel sharding APIs
| null |
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111236
Add libraries to apply tensor parallel transformation to an exported program.
Differential Revision: [D50214796](https://our.internmc.facebook.com/intern/diff/D50214796/)
| 4 |
291 | 111,235 |
[dynamo] `ConfigModule`: Implement mechanism to hash non-`compile_ignored` configs quickly
|
triaged, oncall: pt2
|
### 🚀 The feature, motivation and pitch
Tracked: https://github.com/pytorch/pytorch/issues/111220
compile_ignored defined by https://github.com/pytorch/pytorch/issues/111221
Hash lazily using an `_is_dirty` flag, use sorted dict `_repr_` str as hash input, using MD5, output is a binary string.
`_is_dirty` is only flagged for non-`compile_ignored` keys
There should also be a thread-local variant as per: https://github.com/pytorch/pytorch/issues/111150
Additional Work:
- (non-blocking) Make the hash deterministic
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
292 | 111,231 |
torch.export: cannot instantiate Dim from REPL
|
fb-exported, module: inductor, ciflow/inductor
|
Summary:
```
In [1]: import torch
...: torch.export.Dim('foo', min=1, max=16)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[1], line 2
1 import torch
----> 2 torch.export.Dim('foo', min=1, max=16)
File /..../torch/export/__init__.py:319, in Dim(name, min, max)
317 assert _max > _min, f"Cannot create Dim with inconsistent min={min}, max={max}"
318 dim = _Dim(name, (int,), {"min": _min, "max": _max})
--> 319 dim.__module__ = inspect.getmodule(inspect.stack()[1][0]).__name__ # type: ignore[union-attr]
320 return dim
AttributeError: 'NoneType' object has no attribute '__name__'
```
Test Plan: Repeat above repro
Differential Revision: D50275165
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
| 10 |
293 | 111,228 |
[TEST] Test is_allowed at the end
|
module: dynamo, ciflow/inductor
|
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111228
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 3 |
294 | 111,227 |
nanogpt_generate: C++ compile times out, because the generated .cpp file is too large.
|
triaged, oncall: pt2
|
`nanogpt_generate` exists in torchbench before https://github.com/pytorch/benchmark/pull/1911,
Repro:
```
benchmarks/dynamo/torchbench.py --bfloat16 --accuracy --inference --device cuda --export-aot-inductor --only nanogpt_generate
| 1 |
295 | 111,224 |
[AOTInductor] 14K models: TypeError: make_boxed_func..g() missing 1 required positional argument: 'args'
|
triaged, oncall: pt2
|
### 🐛 Describe the bug
386 errors like: TypeError: make_boxed_func..g() missing 1 required positional argument: 'args' (example ./generated/test_Yang_Liu1082_InvDN.py:_UpsampleBlock # pytest ./generated/test_Yang_Liu1082_InvDN.py -k test_014)
How to repro:
```
git clone https://github.com/jansel/pytorch-jit-paritybench.git
# set PYTHONPATH like the following example
PYTHONPATH=/home/yangche/work/pytorch-jit-paritybench/paritybench:$PYTHONPATH python main.py --compile_mode=aot_inductor -e ./generated/test_pyro_ppl_pyro.py
```
### Versions
Collecting environment information...
PyTorch version: 2.2.0a0+git9e8da56
Is debug build: False
CUDA used to build PyTorch: 12.0
ROCM used to build PyTorch: N/A
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 1 |
296 | 111,223 |
[dynamo] Investigate interop issues with torch_scatter/torch_sparse/pyg_lib
|
oncall: pt2, module: dynamic shapes, module: dynamo
|
In [this post](https://pytorch-geometric.readthedocs.io/en/latest/advanced/compile.html) pytorch-geometric mentions they needed to disable `torch_scatter`, `torch_sparse`, and `pyg_lib` to get `torch.compile` working.
We should investigate what is causing these libraries to fail, create issues for the underling problems, and fix them.
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 1 |
297 | 111,222 |
Test factory functions with layout=torch.strided
|
good first issue, triaged, module: testing
|
### 🚀 The feature, motivation and pitch
It'd be nice to have an OpInfo-based test that tests this. See https://github.com/pytorch/pytorch/pull/111205 and the issue that the PR resolves.
### Alternatives
_No response_
### Additional context
_No response_
| 4 |
298 | 111,221 |
[dynamo] annotate configs with `@compile_ignored`
|
triaged, module: dynamo
|
### 🚀 The feature, motivation and pitch
Originated: https://github.com/pytorch/pytorch/pull/111074#discussion_r1358455363
Tracked: https://github.com/pytorch/pytorch/issues/111220
This annotation means that we will not recompile if these configs change
We will also store separate dicts instead of a single `_config`:
`_compile_config` and `_compile_ignored`.
We can thus more quickly read and hash this config.
---
Currently ignorable dynamo configs:
```python
dynamo_guarded_config_ignorelist = {
"log_file_name",
"verbose",
"verify_correctness", # will not affect model, will raise RuntimeError
# (no silent change to compilation behaviour)
"cache_size_limit",
"accumulated_cache_size_limit",
"print_specializations",
"replay_record_enabled",
"cprofile", # only wraps _compile, not graph
"repro_after",
"repro_level",
"repro_forward_only",
"repro_tolerance",
"same_two_models_use_fp64",
"error_on_recompile", # safe because: will throw error
"report_guard_failures",
"report_all_guard_failures",
"base_dir", # used for minifying / logging
"translation_validation",
"translation_validation_timeout",
"translation_validation_no_bisect",
"DEBUG_DIR_VAR_NAME",
"debug_dir_root",
}
```
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
| 0 |
299 | 111,220 |
[dynamo] Tracking: improve `ConfigModule`
|
triaged, oncall: pt2
|
### Tracked
- [ ] https://github.com/pytorch/pytorch/issues/111150
- [ ] https://github.com/pytorch/pytorch/issues/111221
- [ ] https://github.com/pytorch/pytorch/issues/111235
### 🚀 The feature, motivation and pitch
Part of making config more portable between compilations: https://github.com/pytorch/pytorch/issues/110682
Affects consumers:
- dynamo
- inductor
- functorch
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
| 0 |
300 | 111,214 |
[TEST] reverse sort signatures by default
| null |
Okay, clearly, this doesn't "just" work lol. The ABC ordering was depended on for the topological sort.
There are ~135/325 (41%) of ops whose orderings change, see attached file:
[extracted_lines.txt](https://github.com/pytorch/pytorch/files/12898208/extracted_lines.txt)
<details>
```
static PythonArgParser parser({
- "_assert_async(Tensor input)",
"_assert_async(Tensor input, c10::string_view assert_msg)",
+ "_assert_async(Tensor input)",
static PythonArgParser parser({
- "_use_cudnn_ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank)",
"_use_cudnn_ctc_loss(Tensor log_probs, Tensor targets, Tensor input_lengths, Tensor target_lengths, int64_t blank)",
+ "_use_cudnn_ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank)",
static PythonArgParser parser({
- "_cudnn_ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank, bool deterministic, bool zero_infinity)",
"_cudnn_ctc_loss(Tensor log_probs, Tensor targets, Tensor input_lengths, Tensor target_lengths, int64_t blank, bool deterministic, bool zero_infinity)",
+ "_cudnn_ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank, bool deterministic, bool zero_infinity)",
static PythonArgParser parser({
- "add(Tensor input, Scalar alpha, Tensor other, *, Tensor out=None)|deprecated",
"add(Tensor input, Tensor other, *, Scalar alpha=1, Tensor out=None)",
+ "add(Tensor input, Scalar alpha, Tensor other, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "addmv(Scalar beta, Tensor input, Scalar alpha, Tensor mat, Tensor vec, *, Tensor out=None)|deprecated",
- "addmv(Scalar beta, Tensor input, Tensor mat, Tensor vec, *, Tensor out=None)|deprecated",
"addmv(Tensor input, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1, Tensor out=None)",
+ "addmv(Scalar beta, Tensor input, Tensor mat, Tensor vec, *, Tensor out=None)|deprecated",
+ "addmv(Scalar beta, Tensor input, Scalar alpha, Tensor mat, Tensor vec, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "addmv_(Scalar beta, Tensor input, Scalar alpha, Tensor mat, Tensor vec)|deprecated",
- "addmv_(Scalar beta, Tensor input, Tensor mat, Tensor vec)|deprecated",
"addmv_(Tensor input, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1)",
+ "addmv_(Scalar beta, Tensor input, Tensor mat, Tensor vec)|deprecated",
+ "addmv_(Scalar beta, Tensor input, Scalar alpha, Tensor mat, Tensor vec)|deprecated",
static PythonArgParser parser({
- "addr(Scalar beta, Tensor input, Scalar alpha, Tensor vec1, Tensor vec2, *, Tensor out=None)|deprecated",
- "addr(Scalar beta, Tensor input, Tensor vec1, Tensor vec2, *, Tensor out=None)|deprecated",
"addr(Tensor input, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor out=None)",
+ "addr(Scalar beta, Tensor input, Tensor vec1, Tensor vec2, *, Tensor out=None)|deprecated",
+ "addr(Scalar beta, Tensor input, Scalar alpha, Tensor vec1, Tensor vec2, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "all(Tensor input, *, Tensor out=None)",
"all(Tensor input, int64_t dim, bool keepdim=False, *, Tensor out=None)",
+ "all(Tensor input, *, Tensor out=None)",
"all(Tensor input, Dimname dim, bool keepdim=False, *, Tensor out=None)",
static PythonArgParser parser({
- "any(Tensor input, *, Tensor out=None)",
"any(Tensor input, int64_t dim, bool keepdim=False, *, Tensor out=None)",
+ "any(Tensor input, *, Tensor out=None)",
"any(Tensor input, Dimname dim, bool keepdim=False, *, Tensor out=None)",
static PythonArgParser parser({
- "arange(Scalar end, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "arange(Scalar start, Scalar end, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"arange(Scalar start, Scalar end, Scalar step=1, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "arange(Scalar start, Scalar end, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "arange(Scalar end, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "atleast_1d(Tensor input)",
"atleast_1d(TensorList tensors)",
+ "atleast_1d(Tensor input)",
static PythonArgParser parser({
- "atleast_2d(Tensor input)",
"atleast_2d(TensorList tensors)",
+ "atleast_2d(Tensor input)",
static PythonArgParser parser({
- "atleast_3d(Tensor input)",
"atleast_3d(TensorList tensors)",
+ "atleast_3d(Tensor input)",
static PythonArgParser parser({
- "baddbmm(Scalar beta, Tensor input, Scalar alpha, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
- "baddbmm(Scalar beta, Tensor input, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
"baddbmm(Tensor input, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1, Tensor out=None)",
+ "baddbmm(Scalar beta, Tensor input, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
+ "baddbmm(Scalar beta, Tensor input, Scalar alpha, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "bartlett_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"bartlett_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "bartlett_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "bernoulli(Tensor input, *, Generator? generator=None, Tensor out=None)",
"bernoulli(Tensor input, double p, *, Generator? generator=None)",
+ "bernoulli(Tensor input, *, Generator? generator=None, Tensor out=None)",
static PythonArgParser parser({
- "blackman_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"blackman_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "blackman_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "tensor_split(Tensor input, SymIntArrayRef indices, int64_t dim=0)",
"tensor_split(Tensor input, Tensor tensor_indices_or_sections, int64_t dim=0)",
+ "tensor_split(Tensor input, SymIntArrayRef indices, int64_t dim=0)",
"tensor_split(Tensor input, SymInt sections, int64_t dim=0)",
static PythonArgParser parser({
- "_convolution(Tensor input, Tensor weight, Tensor? bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups, bool benchmark, bool deterministic, bool cudnn_enabled)",
"_convolution(Tensor input, Tensor weight, Tensor? bias, IntArrayRef stride, SymIntArrayRef padding, IntArrayRef dilation, bool transposed, SymIntArrayRef output_padding, int64_t groups, bool benchmark, bool deterministic, bool cudnn_enabled, bool allow_tf32)",
+ "_convolution(Tensor input, Tensor weight, Tensor? bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups, bool benchmark, bool deterministic, bool cudnn_enabled)",
static PythonArgParser parser({
- "conv1d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[1] stride=1, SymIntArrayRef[1] padding=0, IntArrayRef[1] dilation=1, int64_t groups=1)",
"conv1d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[1] stride=1, c10::string_view padding=\"valid\", IntArrayRef[1] dilation=1, int64_t groups=1)",
+ "conv1d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[1] stride=1, SymIntArrayRef[1] padding=0, IntArrayRef[1] dilation=1, int64_t groups=1)",
static PythonArgParser parser({
- "conv2d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[2] stride=1, SymIntArrayRef[2] padding=0, IntArrayRef[2] dilation=1, int64_t groups=1)",
"conv2d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[2] stride=1, c10::string_view padding=\"valid\", IntArrayRef[2] dilation=1, int64_t groups=1)",
+ "conv2d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[2] stride=1, SymIntArrayRef[2] padding=0, IntArrayRef[2] dilation=1, int64_t groups=1)",
static PythonArgParser parser({
- "conv3d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[3] stride=1, SymIntArrayRef[3] padding=0, IntArrayRef[3] dilation=1, int64_t groups=1)",
"conv3d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[3] stride=1, c10::string_view padding=\"valid\", IntArrayRef[3] dilation=1, int64_t groups=1)",
+ "conv3d(Tensor input, Tensor weight, Tensor? bias=None, IntArrayRef[3] stride=1, SymIntArrayRef[3] padding=0, IntArrayRef[3] dilation=1, int64_t groups=1)",
static PythonArgParser parser({
- "ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank=0, int64_t reduction=at::Reduction::Mean, bool zero_infinity=False)",
"ctc_loss(Tensor log_probs, Tensor targets, Tensor input_lengths, Tensor target_lengths, int64_t blank=0, int64_t reduction=at::Reduction::Mean, bool zero_infinity=False)",
+ "ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank=0, int64_t reduction=at::Reduction::Mean, bool zero_infinity=False)",
static PythonArgParser parser({
- "_ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank=0, bool zero_infinity=False)",
"_ctc_loss(Tensor log_probs, Tensor targets, Tensor input_lengths, Tensor target_lengths, int64_t blank=0, bool zero_infinity=False)",
+ "_ctc_loss(Tensor log_probs, Tensor targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank=0, bool zero_infinity=False)",
static PythonArgParser parser({
- "diagonal(Tensor input, *, Dimname outdim, Dimname dim1, Dimname dim2, int64_t offset=0)",
"diagonal(Tensor input, int64_t offset=0, int64_t dim1=0, int64_t dim2=1)",
+ "diagonal(Tensor input, *, Dimname outdim, Dimname dim1, Dimname dim2, int64_t offset=0)",
static PythonArgParser parser({
- "gradient(Tensor input, *, IntArrayRef dim, int64_t edge_order=1)",
- "gradient(Tensor input, *, Scalar spacing, IntArrayRef dim, int64_t edge_order=1)",
- "gradient(Tensor input, *, Scalar? spacing=None, int64_t? dim=None, int64_t edge_order=1)",
"gradient(Tensor input, *, ScalarList spacing, int64_t? dim=None, int64_t edge_order=1)",
- "gradient(Tensor input, *, ScalarList spacing, IntArrayRef dim, int64_t edge_order=1)",
+ "gradient(Tensor input, *, Scalar? spacing=None, int64_t? dim=None, int64_t edge_order=1)",
+ "gradient(Tensor input, *, Scalar spacing, IntArrayRef dim, int64_t edge_order=1)",
+ "gradient(Tensor input, *, IntArrayRef dim, int64_t edge_order=1)",
"gradient(Tensor input, *, TensorList spacing, int64_t? dim=None, int64_t edge_order=1)",
+ "gradient(Tensor input, *, ScalarList spacing, IntArrayRef dim, int64_t edge_order=1)",
"gradient(Tensor input, *, TensorList spacing, IntArrayRef dim, int64_t edge_order=1)",
static PythonArgParser parser({
- "div(Tensor input, Tensor other, *, Tensor out=None)",
"div(Tensor input, Tensor other, *, c10::string_view? rounding_mode, Tensor out=None)",
+ "div(Tensor input, Tensor other, *, Tensor out=None)",
"div(Tensor input, Scalar other, *, c10::string_view? rounding_mode)",
static PythonArgParser parser({
- "divide(Tensor input, Tensor other, *, Tensor out=None)",
"divide(Tensor input, Tensor other, *, c10::string_view? rounding_mode, Tensor out=None)",
- "divide(Tensor input, Scalar other)",
+ "divide(Tensor input, Tensor other, *, Tensor out=None)",
"divide(Tensor input, Scalar other, *, c10::string_view? rounding_mode)",
+ "divide(Tensor input, Scalar other)",
static PythonArgParser parser({
- "embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, Tensor? per_sample_weights, bool include_last_offset, int64_t? padding_idx)",
"embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq=False, int64_t mode=0, bool sparse=False, Tensor? per_sample_weights=None, bool include_last_offset=False)",
+ "embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, Tensor? per_sample_weights, bool include_last_offset, int64_t? padding_idx)",
static PythonArgParser parser({
- "empty(IntArrayRef size, *, DimnameList? names, MemoryFormat? memory_format=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"empty(SymIntArrayRef size, *, MemoryFormat? memory_format=None, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "empty(IntArrayRef size, *, DimnameList? names, MemoryFormat? memory_format=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "eye(SymInt n, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"eye(SymInt n, SymInt m, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "eye(SymInt n, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "flatten(Tensor input, int64_t start_dim, int64_t end_dim, Dimname out_dim)",
"flatten(Tensor input, int64_t start_dim=0, int64_t end_dim=-1)",
- "flatten(Tensor input, Dimname start_dim, Dimname end_dim, Dimname out_dim)",
+ "flatten(Tensor input, int64_t start_dim, int64_t end_dim, Dimname out_dim)",
"flatten(Tensor input, DimnameList dims, Dimname out_dim)",
+ "flatten(Tensor input, Dimname start_dim, Dimname end_dim, Dimname out_dim)",
static PythonArgParser parser({
- "unflatten(Tensor input, Dimname dim, SymIntArrayRef sizes, DimnameList names)",
"unflatten(Tensor input, int64_t dim, SymIntArrayRef sizes)",
+ "unflatten(Tensor input, Dimname dim, SymIntArrayRef sizes, DimnameList names)",
static PythonArgParser parser({
- "full(IntArrayRef size, Scalar fill_value, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"full(SymIntArrayRef size, Scalar fill_value, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "full(IntArrayRef size, Scalar fill_value, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "hann_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"hann_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "hann_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "hamming_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "hamming_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "hamming_window(int64_t window_length, bool periodic, double alpha, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"hamming_window(int64_t window_length, bool periodic, double alpha, double beta, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "hamming_window(int64_t window_length, bool periodic, double alpha, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "hamming_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "hamming_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "kaiser_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "kaiser_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"kaiser_window(int64_t window_length, bool periodic, double beta, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "kaiser_window(int64_t window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "kaiser_window(int64_t window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
"isin(Tensor elements, Tensor test_elements, *, bool assume_unique=False, bool invert=False, Tensor out=None)",
- "isin(Scalar element, Tensor test_elements, *, bool assume_unique=False, bool invert=False, Tensor out=None)",
"isin(Tensor elements, Scalar test_element, *, bool assume_unique=False, bool invert=False, Tensor out=None)",
+ "isin(Scalar element, Tensor test_elements, *, bool assume_unique=False, bool invert=False, Tensor out=None)",
static PythonArgParser parser({
- "fbgemm_pack_quantized_matrix(Tensor input)",
"fbgemm_pack_quantized_matrix(Tensor input, int64_t K, int64_t N)",
+ "fbgemm_pack_quantized_matrix(Tensor input)",
static PythonArgParser parser({
"linspace(Tensor start, Tensor end, int64_t steps, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "linspace(Scalar start, Tensor end, int64_t steps, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"linspace(Tensor start, Scalar end, int64_t steps, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "linspace(Scalar start, Tensor end, int64_t steps, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"linspace(Scalar start, Scalar end, int64_t steps, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
"xlogy(Tensor input, Tensor other, *, Tensor out=None)",
- "xlogy(Scalar self, Tensor other, *, Tensor out=None)",
"xlogy(Tensor input, Scalar other, *, Tensor out=None)",
+ "xlogy(Scalar self, Tensor other, *, Tensor out=None)",
static PythonArgParser parser({
"logspace(Tensor start, Tensor end, int64_t steps, double base=10.0, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "logspace(Scalar start, Tensor end, int64_t steps, double base=10.0, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"logspace(Tensor start, Scalar end, int64_t steps, double base=10.0, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "logspace(Scalar start, Tensor end, int64_t steps, double base=10.0, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"logspace(Scalar start, Scalar end, int64_t steps, double base=10.0, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "_aminmax(Tensor input)",
"_aminmax(Tensor input, int64_t dim, bool keepdim=False)",
+ "_aminmax(Tensor input)",
static PythonArgParser parser({
- "max(Tensor input, *, Tensor out=None)",
- "max(Tensor input, Tensor other, *, Tensor out=None)",
"max(Tensor input, int64_t dim, bool keepdim=False, *, TensorList[2] out=None)",
+ "max(Tensor input, Tensor other, *, Tensor out=None)",
+ "max(Tensor input, *, Tensor out=None)",
"max(Tensor input, Dimname dim, bool keepdim=False, *, TensorList[2] out=None)",
static PythonArgParser parser({
- "mean(Tensor input, *, ScalarType? dtype=None)",
"mean(Tensor input, IntArrayRef[1]? dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor out=None)",
+ "mean(Tensor input, *, ScalarType? dtype=None)",
"mean(Tensor input, DimnameList[1] dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor out=None)",
static PythonArgParser parser({
- "median(Tensor input)",
"median(Tensor input, int64_t dim, bool keepdim=False, *, TensorList[2] out=None)",
+ "median(Tensor input)",
"median(Tensor input, Dimname dim, bool keepdim=False, *, TensorList[2] out=None)",
static PythonArgParser parser({
- "nanmedian(Tensor input)",
"nanmedian(Tensor input, int64_t dim, bool keepdim=False, *, TensorList[2] out=None)",
+ "nanmedian(Tensor input)",
"nanmedian(Tensor input, Dimname dim, bool keepdim=False, *, TensorList[2] out=None)",
static PythonArgParser parser({
- "min(Tensor input, *, Tensor out=None)",
- "min(Tensor input, Tensor other, *, Tensor out=None)",
"min(Tensor input, int64_t dim, bool keepdim=False, *, TensorList[2] out=None)",
+ "min(Tensor input, Tensor other, *, Tensor out=None)",
+ "min(Tensor input, *, Tensor out=None)",
"min(Tensor input, Dimname dim, bool keepdim=False, *, TensorList[2] out=None)",
static PythonArgParser parser({
- "_native_batch_norm_legit(Tensor input, Tensor? weight, Tensor? bias, Tensor running_mean, Tensor running_var, bool training, double momentum, double eps, *, TensorList[3] out=None)",
"_native_batch_norm_legit(Tensor input, Tensor? weight, Tensor? bias, bool training, double momentum, double eps, *, TensorList[3] out=None)",
+ "_native_batch_norm_legit(Tensor input, Tensor? weight, Tensor? bias, Tensor running_mean, Tensor running_var, bool training, double momentum, double eps, *, TensorList[3] out=None)",
static PythonArgParser parser({
- "ones(IntArrayRef size, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"ones(SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "ones(IntArrayRef size, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "rand(SymIntArrayRef size, *, Generator? generator, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "rand(SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"rand(SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "rand(SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "rand(SymIntArrayRef size, *, Generator? generator, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"rand(SymIntArrayRef size, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "randint(SymInt high, SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "randint(SymInt high, SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "randint(SymInt low, SymInt high, SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"randint(SymInt low, SymInt high, SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randint(SymInt low, SymInt high, SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randint(SymInt high, SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randint(SymInt high, SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "randint_like(Tensor input, SymInt high, *, MemoryFormat? memory_format=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"randint_like(Tensor input, SymInt low, SymInt high, *, MemoryFormat? memory_format=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randint_like(Tensor input, SymInt high, *, MemoryFormat? memory_format=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "randn(SymIntArrayRef size, *, Generator? generator, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
- "randn(SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"randn(SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randn(SymIntArrayRef size, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randn(SymIntArrayRef size, *, Generator? generator, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"randn(SymIntArrayRef size, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "randperm(SymInt n, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"randperm(SymInt n, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "randperm(SymInt n, *, Generator? generator, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "repeat_interleave(Tensor input, Tensor repeats, int64_t? dim=None, *, SymInt? output_size=None)",
"repeat_interleave(Tensor repeats, *, SymInt? output_size=None)",
+ "repeat_interleave(Tensor input, Tensor repeats, int64_t? dim=None, *, SymInt? output_size=None)",
"repeat_interleave(Tensor input, SymInt repeats, int64_t? dim=None, *, SymInt? output_size=None)",
static PythonArgParser parser({
- "round(Tensor input, *, Tensor out=None)",
"round(Tensor input, *, int64_t decimals, Tensor out=None)",
+ "round(Tensor input, *, Tensor out=None)",
static PythonArgParser parser({
- "round_(Tensor input)",
"round_(Tensor input, *, int64_t decimals)",
+ "round_(Tensor input)",
static PythonArgParser parser({
- "select(Tensor input, Dimname dim, int64_t index)",
"select(Tensor input, int64_t dim, SymInt index)",
+ "select(Tensor input, Dimname dim, int64_t index)",
static PythonArgParser parser({
- "split(Tensor input, SymInt split_size, int64_t dim=0)",
"split(Tensor input, SymIntArrayRef split_size, int64_t dim=0)",
+ "split(Tensor input, SymInt split_size, int64_t dim=0)",
static PythonArgParser parser({
- "squeeze(Tensor input)",
"squeeze(Tensor input, int64_t dim)",
+ "squeeze(Tensor input)",
"squeeze(Tensor input, IntArrayRef dim)",
"squeeze(Tensor input, Dimname dim)",
static PythonArgParser parser({
- "sspaddmm(Scalar beta, Tensor input, Scalar alpha, Tensor mat1, Tensor mat2)|deprecated",
- "sspaddmm(Scalar beta, Tensor input, Tensor mat1, Tensor mat2)|deprecated",
"sspaddmm(Tensor input, Tensor mat1, Tensor mat2, *, Scalar beta=1, Scalar alpha=1, Tensor out=None)",
+ "sspaddmm(Scalar beta, Tensor input, Tensor mat1, Tensor mat2)|deprecated",
+ "sspaddmm(Scalar beta, Tensor input, Scalar alpha, Tensor mat1, Tensor mat2)|deprecated",
static PythonArgParser parser({
- "stft(Tensor input, int64_t n_fft, int64_t? hop_length=None, int64_t? win_length=None, Tensor? window=None, bool center=True, c10::string_view pad_mode=\"reflect\", bool normalized=False, bool? onesided=None, bool? return_complex=None)",
"stft(Tensor input, int64_t n_fft, int64_t? hop_length=None, int64_t? win_length=None, Tensor? window=None, bool normalized=False, bool? onesided=None, bool? return_complex=None)",
+ "stft(Tensor input, int64_t n_fft, int64_t? hop_length=None, int64_t? win_length=None, Tensor? window=None, bool center=True, c10::string_view pad_mode=\"reflect\", bool normalized=False, bool? onesided=None, bool? return_complex=None)",
static PythonArgParser parser({
- "sum(Tensor input, *, ScalarType? dtype=None)",
"sum(Tensor input, IntArrayRef[1]? dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor out=None)",
+ "sum(Tensor input, *, ScalarType? dtype=None)",
"sum(Tensor input, DimnameList[1] dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor out=None)",
static PythonArgParser parser({
- "std(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
- "std(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False, Tensor out=None)",
"std(Tensor input, bool unbiased=True)",
- "std(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
+ "std(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False, Tensor out=None)",
+ "std(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
"std(Tensor input, DimnameList[1] dim, *, Scalar? correction=None, bool keepdim=False, Tensor out=None)",
+ "std(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
static PythonArgParser parser({
- "std_mean(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False)",
- "std_mean(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False)",
"std_mean(Tensor input, bool unbiased=True)",
- "std_mean(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False)",
+ "std_mean(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False)",
+ "std_mean(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False)",
"std_mean(Tensor input, DimnameList[1] dim, *, Scalar? correction=None, bool keepdim=False)",
+ "std_mean(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False)",
static PythonArgParser parser({
- "prod(Tensor input, *, ScalarType? dtype=None)",
"prod(Tensor input, int64_t dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor out=None)",
+ "prod(Tensor input, *, ScalarType? dtype=None)",
"prod(Tensor input, Dimname dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor out=None)",
static PythonArgParser parser({
- "trapz(Tensor y, *, double dx=1, int64_t dim=-1)",
"trapz(Tensor y, Tensor x, *, int64_t dim=-1)",
+ "trapz(Tensor y, *, double dx=1, int64_t dim=-1)",
static PythonArgParser parser({
- "var(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
- "var(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False, Tensor out=None)",
"var(Tensor input, bool unbiased=True)",
- "var(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
+ "var(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False, Tensor out=None)",
+ "var(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
"var(Tensor input, DimnameList[1] dim, *, Scalar? correction=None, bool keepdim=False, Tensor out=None)",
+ "var(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False, *, Tensor out=None)",
static PythonArgParser parser({
- "var_mean(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False)",
- "var_mean(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False)",
"var_mean(Tensor input, bool unbiased=True)",
- "var_mean(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False)",
+ "var_mean(Tensor input, IntArrayRef[1]? dim=None, *, Scalar? correction=None, bool keepdim=False)",
+ "var_mean(Tensor input, IntArrayRef[1]? dim, bool unbiased=True, bool keepdim=False)",
"var_mean(Tensor input, DimnameList[1] dim, *, Scalar? correction=None, bool keepdim=False)",
+ "var_mean(Tensor input, DimnameList[1] dim, bool unbiased=True, bool keepdim=False)",
static PythonArgParser parser({
- "where(Tensor condition)",
"where(Tensor condition, Tensor input, Tensor other, *, Tensor out=None)",
- "where(Tensor condition, Scalar self, Tensor other)",
+ "where(Tensor condition)",
"where(Tensor condition, Tensor input, Scalar other)",
+ "where(Tensor condition, Scalar self, Tensor other)",
"where(Tensor condition, Scalar self, Scalar other)",
static PythonArgParser parser({
- "zeros(IntArrayRef size, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
"zeros(SymIntArrayRef size, *, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "zeros(IntArrayRef size, *, DimnameList? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
static PythonArgParser parser({
- "native_norm(Tensor input, Scalar p=2)",
"native_norm(Tensor input, Scalar? p, IntArrayRef[1] dim, bool keepdim, ScalarType? dtype)",
+ "native_norm(Tensor input, Scalar p=2)",
static PythonArgParser parser({
- "_sparse_sum(Tensor input)",
- "_sparse_sum(Tensor input, *, ScalarType dtype)",
- "_sparse_sum(Tensor input, IntArrayRef[1] dim)",
"_sparse_sum(Tensor input, IntArrayRef[1] dim, *, ScalarType dtype)",
+ "_sparse_sum(Tensor input, IntArrayRef[1] dim)",
+ "_sparse_sum(Tensor input, *, ScalarType dtype)",
+ "_sparse_sum(Tensor input)",
static PythonArgParser parser({
- "norm(Tensor input, Scalar p=2)",
- "norm(Tensor input, Scalar? p, *, ScalarType dtype)",
- "norm(Tensor input, Scalar? p, IntArrayRef[1] dim, bool keepdim, *, ScalarType dtype, Tensor out=None)",
"norm(Tensor input, Scalar? p, IntArrayRef[1] dim, bool keepdim=False, *, Tensor out=None)",
- "norm(Tensor input, Scalar? p, DimnameList[1] dim, bool keepdim, *, ScalarType dtype, Tensor out=None)",
+ "norm(Tensor input, Scalar? p, IntArrayRef[1] dim, bool keepdim, *, ScalarType dtype, Tensor out=None)",
+ "norm(Tensor input, Scalar? p, *, ScalarType dtype)",
+ "norm(Tensor input, Scalar p=2)",
"norm(Tensor input, Scalar? p, DimnameList[1] dim, bool keepdim=False, *, Tensor out=None)",
+ "norm(Tensor input, Scalar? p, DimnameList[1] dim, bool keepdim, *, ScalarType dtype, Tensor out=None)",
static PythonArgParser parser({
- "nuclear_norm(Tensor input, IntArrayRef[2] dim, bool keepdim=False, *, Tensor out=None)",
"nuclear_norm(Tensor input, bool keepdim=False, *, Tensor out=None)",
+ "nuclear_norm(Tensor input, IntArrayRef[2] dim, bool keepdim=False, *, Tensor out=None)",
static PythonArgParser parser({
- "sub(Tensor input, Scalar alpha, Tensor other, *, Tensor out=None)|deprecated",
"sub(Tensor input, Tensor other, *, Scalar alpha=1, Tensor out=None)",
+ "sub(Tensor input, Scalar alpha, Tensor other, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "addmm(Scalar beta, Tensor input, Scalar alpha, Tensor mat1, Tensor mat2, *, Tensor out=None)|deprecated",
- "addmm(Scalar beta, Tensor input, Tensor mat1, Tensor mat2, *, Tensor out=None)|deprecated",
"addmm(Tensor input, Tensor mat1, Tensor mat2, *, Scalar beta=1, Scalar alpha=1, Tensor out=None)",
+ "addmm(Scalar beta, Tensor input, Tensor mat1, Tensor mat2, *, Tensor out=None)|deprecated",
+ "addmm(Scalar beta, Tensor input, Scalar alpha, Tensor mat1, Tensor mat2, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "quantize_per_tensor(Tensor input, Tensor scale, Tensor zero_point, ScalarType dtype)",
- "quantize_per_tensor(Tensor input, double scale, int64_t zero_point, ScalarType dtype)",
"quantize_per_tensor(TensorList tensors, Tensor scales, Tensor zero_points, ScalarType dtype)",
+ "quantize_per_tensor(Tensor input, double scale, int64_t zero_point, ScalarType dtype)",
+ "quantize_per_tensor(Tensor input, Tensor scale, Tensor zero_point, ScalarType dtype)",
static PythonArgParser parser({
- "dequantize(Tensor input)",
"dequantize(TensorList tensors)",
+ "dequantize(Tensor input)",
static PythonArgParser parser({
- "fake_quantize_per_tensor_affine(Tensor input, Tensor scale, Tensor zero_point, int64_t quant_min, int64_t quant_max)",
"fake_quantize_per_tensor_affine(Tensor input, double scale, int64_t zero_point, int64_t quant_min, int64_t quant_max)",
+ "fake_quantize_per_tensor_affine(Tensor input, Tensor scale, Tensor zero_point, int64_t quant_min, int64_t quant_max)",
static PythonArgParser parser({
- "meshgrid(TensorList tensors)",
"meshgrid(TensorList tensors, *, c10::string_view indexing)",
+ "meshgrid(TensorList tensors)",
static PythonArgParser parser({
"result_type(Tensor tensor, Tensor other)",
- "result_type(Scalar scalar, Tensor tensor)",
"result_type(Tensor tensor, Scalar other)",
+ "result_type(Scalar scalar, Tensor tensor)",
"result_type(Scalar scalar1, Scalar scalar2)",
static PythonArgParser parser({
- "lstm(Tensor data, Tensor batch_sizes, TensorList hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
"lstm(Tensor input, TensorList hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional, bool batch_first)",
+ "lstm(Tensor data, Tensor batch_sizes, TensorList hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
static PythonArgParser parser({
- "gru(Tensor data, Tensor batch_sizes, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
"gru(Tensor input, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional, bool batch_first)",
+ "gru(Tensor data, Tensor batch_sizes, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
static PythonArgParser parser({
- "rnn_tanh(Tensor data, Tensor batch_sizes, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
"rnn_tanh(Tensor input, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional, bool batch_first)",
+ "rnn_tanh(Tensor data, Tensor batch_sizes, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
static PythonArgParser parser({
- "rnn_relu(Tensor data, Tensor batch_sizes, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
"rnn_relu(Tensor input, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional, bool batch_first)",
+ "rnn_relu(Tensor data, Tensor batch_sizes, Tensor hx, TensorList params, bool has_biases, int64_t num_layers, double dropout, bool train, bool bidirectional)",
static PythonArgParser parser({
"index_fill(Tensor input, int64_t dim, Tensor index, Tensor value)",
- "index_fill(Tensor input, Dimname dim, Tensor index, Tensor value)",
"index_fill(Tensor input, int64_t dim, Tensor index, Scalar value)",
+ "index_fill(Tensor input, Dimname dim, Tensor index, Tensor value)",
"index_fill(Tensor input, Dimname dim, Tensor index, Scalar value)",
static PythonArgParser parser({
- "scatter(Tensor input, int64_t dim, Tensor index, Tensor src, *, Tensor out=None)",
"scatter(Tensor input, int64_t dim, Tensor index, Tensor src, *, c10::string_view reduce, Tensor out=None)",
- "scatter(Tensor input, Dimname dim, Tensor index, Tensor src)",
- "scatter(Tensor input, int64_t dim, Tensor index, Scalar value, *, Tensor out=None)",
+ "scatter(Tensor input, int64_t dim, Tensor index, Tensor src, *, Tensor out=None)",
"scatter(Tensor input, int64_t dim, Tensor index, Scalar value, *, c10::string_view reduce, Tensor out=None)",
+ "scatter(Tensor input, int64_t dim, Tensor index, Scalar value, *, Tensor out=None)",
+ "scatter(Tensor input, Dimname dim, Tensor index, Tensor src)",
"scatter(Tensor input, Dimname dim, Tensor index, Scalar value)",
static PythonArgParser parser({
"bitwise_and(Tensor input, Tensor other, *, Tensor out=None)",
- "bitwise_and(Scalar self, Tensor other)",
"bitwise_and(Tensor input, Scalar other, *, Tensor out=None)",
+ "bitwise_and(Scalar self, Tensor other)",
static PythonArgParser parser({
"bitwise_or(Tensor input, Tensor other, *, Tensor out=None)",
- "bitwise_or(Scalar self, Tensor other)",
"bitwise_or(Tensor input, Scalar other, *, Tensor out=None)",
+ "bitwise_or(Scalar self, Tensor other)",
static PythonArgParser parser({
"bitwise_xor(Tensor input, Tensor other, *, Tensor out=None)",
- "bitwise_xor(Scalar self, Tensor other)",
"bitwise_xor(Tensor input, Scalar other, *, Tensor out=None)",
+ "bitwise_xor(Scalar self, Tensor other)",
static PythonArgParser parser({
"bitwise_left_shift(Tensor input, Tensor other, *, Tensor out=None)",
- "bitwise_left_shift(Scalar self, Tensor other)",
"bitwise_left_shift(Tensor input, Scalar other, *, Tensor out=None)",
+ "bitwise_left_shift(Scalar self, Tensor other)",
static PythonArgParser parser({
"bitwise_right_shift(Tensor input, Tensor other, *, Tensor out=None)",
- "bitwise_right_shift(Scalar self, Tensor other)",
"bitwise_right_shift(Tensor input, Scalar other, *, Tensor out=None)",
+ "bitwise_right_shift(Scalar self, Tensor other)",
static PythonArgParser parser({
- "addbmm(Scalar beta, Tensor input, Scalar alpha, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
- "addbmm(Scalar beta, Tensor input, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
"addbmm(Tensor input, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1, Tensor out=None)",
+ "addbmm(Scalar beta, Tensor input, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
+ "addbmm(Scalar beta, Tensor input, Scalar alpha, Tensor batch1, Tensor batch2, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "addcmul(Tensor input, Scalar value, Tensor tensor1, Tensor tensor2, *, Tensor out=None)|deprecated",
"addcmul(Tensor input, Tensor tensor1, Tensor tensor2, *, Scalar value=1, Tensor out=None)",
+ "addcmul(Tensor input, Scalar value, Tensor tensor1, Tensor tensor2, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "addcdiv(Tensor input, Scalar value, Tensor tensor1, Tensor tensor2, *, Tensor out=None)|deprecated",
"addcdiv(Tensor input, Tensor tensor1, Tensor tensor2, *, Scalar value=1, Tensor out=None)",
+ "addcdiv(Tensor input, Scalar value, Tensor tensor1, Tensor tensor2, *, Tensor out=None)|deprecated",
static PythonArgParser parser({
- "histogram(Tensor input, Tensor bins, *, Tensor? weight=None, bool density=False, TensorList[2] out=None)",
"histogram(Tensor input, int64_t bins=100, *, ArrayRef<double>? range=None, Tensor? weight=None, bool density=False, TensorList[2] out=None)",
+ "histogram(Tensor input, Tensor bins, *, Tensor? weight=None, bool density=False, TensorList[2] out=None)",
static PythonArgParser parser({
"remainder(Tensor input, Tensor other, *, Tensor out=None)",
- "remainder(Scalar self, Tensor other)",
"remainder(Tensor input, Scalar other, *, Tensor out=None)",
+ "remainder(Scalar self, Tensor other)",
static PythonArgParser parser({
- "quantile(Tensor input, Tensor q, int64_t? dim=None, bool keepdim=False, *, c10::string_view interpolation=\"linear\", Tensor out=None)",
"quantile(Tensor input, double q, int64_t? dim=None, bool keepdim=False, *, c10::string_view interpolation=\"linear\", Tensor out=None)",
+ "quantile(Tensor input, Tensor q, int64_t? dim=None, bool keepdim=False, *, c10::string_view interpolation=\"linear\", Tensor out=None)",
static PythonArgParser parser({
- "nanquantile(Tensor input, Tensor q, int64_t? dim=None, bool keepdim=False, *, c10::string_view interpolation=\"linear\", Tensor out=None)",
"nanquantile(Tensor input, double q, int64_t? dim=None, bool keepdim=False, *, c10::string_view interpolation=\"linear\", Tensor out=None)",
+ "nanquantile(Tensor input, Tensor q, int64_t? dim=None, bool keepdim=False, *, c10::string_view interpolation=\"linear\", Tensor out=None)",
static PythonArgParser parser({
- "sort(Tensor input, *, bool? stable, int64_t dim=-1, bool descending=False, TensorList[2] out=None)",
"sort(Tensor input, int64_t dim=-1, bool descending=False, *, TensorList[2] out=None)",
- "sort(Tensor input, *, bool? stable, Dimname dim, bool descending=False, TensorList[2] out=None)",
+ "sort(Tensor input, *, bool? stable, int64_t dim=-1, bool descending=False, TensorList[2] out=None)",
"sort(Tensor input, Dimname dim, bool descending=False, *, TensorList[2] out=None)",
+ "sort(Tensor input, *, bool? stable, Dimname dim, bool descending=False, TensorList[2] out=None)",
static PythonArgParser parser({
- "argsort(Tensor input, *, bool stable, int64_t dim=-1, bool descending=False)",
"argsort(Tensor input, int64_t dim=-1, bool descending=False)",
+ "argsort(Tensor input, *, bool stable, int64_t dim=-1, bool descending=False)",
"argsort(Tensor input, Dimname dim, bool descending=False)",
static PythonArgParser parser({
"pow(Tensor input, Tensor exponent, *, Tensor out=None)",
- "pow(Scalar self, Tensor exponent, *, Tensor out=None)",
"pow(Tensor input, Scalar exponent, *, Tensor out=None)",
+ "pow(Scalar self, Tensor exponent, *, Tensor out=None)",
static PythonArgParser parser({
"float_power(Tensor input, Tensor exponent, *, Tensor out=None)",
- "float_power(Scalar self, Tensor exponent, *, Tensor out=None)",
"float_power(Tensor input, Scalar exponent, *, Tensor out=None)",
+ "float_power(Scalar self, Tensor exponent, *, Tensor out=None)",
static PythonArgParser parser({
- "normal(Tensor mean, Tensor std, *, Generator? generator=None, Tensor out=None)",
- "normal(Tensor mean, double std=1, *, Generator? generator=None, Tensor out=None)",
- "normal(double mean, Tensor std, *, Generator? generator=None, Tensor out=None)",
"normal(double mean, double std, SymIntArrayRef size, *, Generator? generator=None, Tensor out=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False, bool? requires_grad=False)",
+ "normal(double mean, Tensor std, *, Generator? generator=None, Tensor out=None)",
+ "normal(Tensor mean, double std=1, *, Generator? generator=None, Tensor out=None)",
+ "normal(Tensor mean, Tensor std, *, Generator? generator=None, Tensor out=None)",
static PythonArgParser parser({
- "_foreach_add(TensorList self, Scalar scalar)",
- "_foreach_add(TensorList self, ScalarList scalars)",
- "_foreach_add(TensorList self, Tensor other, Scalar alpha=1)",
"_foreach_add(TensorList self, TensorList other, *, Scalar alpha=1)",
+ "_foreach_add(TensorList self, Tensor other, Scalar alpha=1)",
+ "_foreach_add(TensorList self, ScalarList scalars)",
+ "_foreach_add(TensorList self, Scalar scalar)",
static PythonArgParser parser({
- "_foreach_add_(TensorList self, Scalar scalar)",
- "_foreach_add_(TensorList self, ScalarList scalars)",
- "_foreach_add_(TensorList self, Tensor other, Scalar alpha=1)",
"_foreach_add_(TensorList self, TensorList other, *, Scalar alpha=1)",
+ "_foreach_add_(TensorList self, Tensor other, Scalar alpha=1)",
+ "_foreach_add_(TensorList self, ScalarList scalars)",
+ "_foreach_add_(TensorList self, Scalar scalar)",
static PythonArgParser parser({
- "_foreach_sub(TensorList self, Scalar scalar)",
- "_foreach_sub(TensorList self, ScalarList scalars)",
"_foreach_sub(TensorList self, TensorList other, *, Scalar alpha=1)",
+ "_foreach_sub(TensorList self, ScalarList scalars)",
+ "_foreach_sub(TensorList self, Scalar scalar)",
static PythonArgParser parser({
- "_foreach_sub_(TensorList self, Scalar scalar)",
- "_foreach_sub_(TensorList self, ScalarList scalars)",
"_foreach_sub_(TensorList self, TensorList other, *, Scalar alpha=1)",
+ "_foreach_sub_(TensorList self, ScalarList scalars)",
+ "_foreach_sub_(TensorList self, Scalar scalar)",
static PythonArgParser parser({
- "_foreach_mul(TensorList self, ScalarList scalars)",
"_foreach_mul(TensorList self, Tensor other)",
- "_foreach_mul(TensorList self, TensorList other)",
+ "_foreach_mul(TensorList self, ScalarList scalars)",
"_foreach_mul(TensorList self, Scalar scalar)",
+ "_foreach_mul(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_mul_(TensorList self, ScalarList scalars)",
"_foreach_mul_(TensorList self, Tensor other)",
- "_foreach_mul_(TensorList self, TensorList other)",
+ "_foreach_mul_(TensorList self, ScalarList scalars)",
"_foreach_mul_(TensorList self, Scalar scalar)",
+ "_foreach_mul_(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_div(TensorList self, Scalar scalar)",
"_foreach_div(TensorList self, ScalarList scalars)",
+ "_foreach_div(TensorList self, Scalar scalar)",
"_foreach_div(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_div_(TensorList self, Scalar scalar)",
"_foreach_div_(TensorList self, ScalarList scalars)",
+ "_foreach_div_(TensorList self, Scalar scalar)",
"_foreach_div_(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_clamp_max(TensorList self, Scalar scalar)",
"_foreach_clamp_max(TensorList self, ScalarList scalars)",
+ "_foreach_clamp_max(TensorList self, Scalar scalar)",
"_foreach_clamp_max(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_clamp_max_(TensorList self, Scalar scalar)",
"_foreach_clamp_max_(TensorList self, ScalarList scalars)",
+ "_foreach_clamp_max_(TensorList self, Scalar scalar)",
"_foreach_clamp_max_(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_clamp_min(TensorList self, Scalar scalar)",
"_foreach_clamp_min(TensorList self, ScalarList scalars)",
+ "_foreach_clamp_min(TensorList self, Scalar scalar)",
"_foreach_clamp_min(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_clamp_min_(TensorList self, Scalar scalar)",
"_foreach_clamp_min_(TensorList self, ScalarList scalars)",
+ "_foreach_clamp_min_(TensorList self, Scalar scalar)",
"_foreach_clamp_min_(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_maximum(TensorList self, Scalar scalar)",
"_foreach_maximum(TensorList self, ScalarList scalars)",
+ "_foreach_maximum(TensorList self, Scalar scalar)",
"_foreach_maximum(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_maximum_(TensorList self, Scalar scalar)",
"_foreach_maximum_(TensorList self, ScalarList scalars)",
+ "_foreach_maximum_(TensorList self, Scalar scalar)",
"_foreach_maximum_(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_minimum(TensorList self, Scalar scalar)",
"_foreach_minimum(TensorList self, ScalarList scalars)",
+ "_foreach_minimum(TensorList self, Scalar scalar)",
"_foreach_minimum(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_minimum_(TensorList self, Scalar scalar)",
"_foreach_minimum_(TensorList self, ScalarList scalars)",
+ "_foreach_minimum_(TensorList self, Scalar scalar)",
"_foreach_minimum_(TensorList self, TensorList other)",
static PythonArgParser parser({
- "_foreach_addcdiv(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcdiv(TensorList self, TensorList tensor1, TensorList tensor2, Tensor scalars)",
+ "_foreach_addcdiv(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcdiv(TensorList self, TensorList tensor1, TensorList tensor2, Scalar value=1)",
static PythonArgParser parser({
- "_foreach_addcdiv_(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcdiv_(TensorList self, TensorList tensor1, TensorList tensor2, Tensor scalars)",
+ "_foreach_addcdiv_(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcdiv_(TensorList self, TensorList tensor1, TensorList tensor2, Scalar value=1)",
static PythonArgParser parser({
- "_foreach_addcmul(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcmul(TensorList self, TensorList tensor1, TensorList tensor2, Tensor scalars)",
+ "_foreach_addcmul(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcmul(TensorList self, TensorList tensor1, TensorList tensor2, Scalar value=1)",
static PythonArgParser parser({
- "_foreach_addcmul_(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcmul_(TensorList self, TensorList tensor1, TensorList tensor2, Tensor scalars)",
+ "_foreach_addcmul_(TensorList self, TensorList tensor1, TensorList tensor2, ScalarList scalars)",
"_foreach_addcmul_(TensorList self, TensorList tensor1, TensorList tensor2, Scalar value=1)",
static PythonArgParser parser({
- "_foreach_lerp(TensorList self, TensorList tensors1, Scalar weight)",
"_foreach_lerp(TensorList self, TensorList tensors1, TensorList weights)",
+ "_foreach_lerp(TensorList self, TensorList tensors1, Scalar weight)",
static PythonArgParser parser({
- "_foreach_lerp_(TensorList self, TensorList tensors1, Scalar weight)",
"_foreach_lerp_(TensorList self, TensorList tensors1, TensorList weights)",
+ "_foreach_lerp_(TensorList self, TensorList tensors1, Scalar weight)",
static PythonArgParser parser({
- "_foreach_pow(Scalar self, TensorList exponent)",
- "_foreach_pow(TensorList self, Scalar exponent)",
"_foreach_pow(TensorList self, ScalarList exponent)",
+ "_foreach_pow(TensorList self, Scalar exponent)",
+ "_foreach_pow(Scalar self, TensorList exponent)",
"_foreach_pow(TensorList self, TensorList exponent)",
static PythonArgParser parser({
- "_foreach_pow_(TensorList self, Scalar exponent)",
"_foreach_pow_(TensorList self, ScalarList exponent)",
+ "_foreach_pow_(TensorList self, Scalar exponent)",
"_foreach_pow_(TensorList self, TensorList exponent)",
static PythonArgParser parser({
- "_test_autograd_multiple_dispatch(Tensor input)",
"_test_autograd_multiple_dispatch(Tensor input, bool b)",
+ "_test_autograd_multiple_dispatch(Tensor input)",
static PythonArgParser parser({
- "squeeze_copy(Tensor input, *, Tensor out=None)",
"squeeze_copy(Tensor input, int64_t dim, *, Tensor out=None)",
+ "squeeze_copy(Tensor input, *, Tensor out=None)",
"squeeze_copy(Tensor input, IntArrayRef dim, *, Tensor out=None)",
static PythonArgParser parser({
- "view_copy(Tensor input, ScalarType dtype, *, Tensor out=None)",
"view_copy(Tensor input, SymIntArrayRef size, *, Tensor out=None)",
+ "view_copy(Tensor input, ScalarType dtype, *, Tensor out=None)",
static PythonArgParser parser({
- "_fused_adam_(TensorList self, TensorList grads, TensorList exp_avgs, TensorList exp_avg_sqs, TensorList max_exp_avg_sqs, TensorList state_steps, *, Tensor lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, Tensor? grad_scale=None, Tensor? found_inf=None)",
"_fused_adam_(TensorList self, TensorList grads, TensorList exp_avgs, TensorList exp_avg_sqs, TensorList max_exp_avg_sqs, TensorList state_steps, *, double lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, Tensor? grad_scale=None, Tensor? found_inf=None)",
+ "_fused_adam_(TensorList self, TensorList grads, TensorList exp_avgs, TensorList exp_avg_sqs, TensorList max_exp_avg_sqs, TensorList state_steps, *, Tensor lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, Tensor? grad_scale=None, Tensor? found_inf=None)",
static PythonArgParser parser({
- "_fused_adamw_(TensorList self, TensorList grads, TensorList exp_avgs, TensorList exp_avg_sqs, TensorList max_exp_avg_sqs, TensorList state_steps, *, Tensor lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, Tensor? grad_scale=None, Tensor? found_inf=None)",
"_fused_adamw_(TensorList self, TensorList grads, TensorList exp_avgs, TensorList exp_avg_sqs, TensorList max_exp_avg_sqs, TensorList state_steps, *, double lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, Tensor? grad_scale=None, Tensor? found_inf=None)",
+ "_fused_adamw_(TensorList self, TensorList grads, TensorList exp_avgs, TensorList exp_avg_sqs, TensorList max_exp_avg_sqs, TensorList state_steps, *, Tensor lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, Tensor? grad_scale=None, Tensor? found_inf=None)",
```
<details>
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111214
| 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.