DanLing NestedTensor: Composable Multi-Ragged Tensors for Deep Learning
Not on the map. Why?
Abstract (arXiv)
Variable-size inputs are common in deep learning, but dense batching allocates a shared envelope and spends computation on padding. The cost multiplies across varying axes: an explicit pair state allocates BNmax2 positions instead of sumi Ni2. Packing removes that waste, but composing packed operations still requires the logical axes and sample boundaries a flat buffer no longer exposes. We present DanLing NestedTensor, a PyTorch tensor abstraction that makes multi-ragged structure a property of the tensor itself. Packed values carry tensor-backed partitions and logical dimension order, so broadcasting creates ragged axes, feature transformations retain them, and reductions consume them. The same representation carries through autograd and both eager and compiled execution. On an A100, the geometric-mean speedup over same-mode padding is 2.74× eager and 3.39× compiled across four BERT scales, and 1.97× eager across four FCN backbones. A four-block Pairformer-style workload runs 2.40-4.32× faster than a padded reference using native PyTorch kernels across square length regimes in eager execution, with peak allocation falling from 38.08 to 5.41 GiB on its high-variation batch. The tensor interface lets model code built from its supported operators compose efficient variable-size computation without managing offsets at any call site. Code will be released publicly upon publication.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 20 of its 32 references that are in the map. First posted on arXiv 24 Sep 2026.
Builds on
20 of 32 references.
References · 20
- 2017Attention Is All You Needcited by 60,361
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2014Microsoft COCO: Common Objects in Contextcited by 17,608
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,498
- 2020End-to-End Object Detection with Transformerscited by 7,414
- 2014Fully Convolutional Networks for Semantic Segmentationcited by 4,859
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
8 more
- 2020GLU Variants Improve Transformercited by 1,804
- 2016Semantic Understanding of Scenes through the ADE20K Datasetcited by 1,069
- 2023Patch n' Pack: NaViT, a Vision Transformer for any Aspect Ratio and Resolutioncited by 229
- 2020Kernel Operations on the GPU, with Autodiff, without Memory Overflowscited by 104
- 2017Curriculum Learning and Minibatch Bucketing in Neural Machine Translationcited by 63
- 2021The CoRa Tensor Compiler: Compilation for Ragged Tensors with Minimal Paddingcited by 17
- 2023Relax: Composable Abstractions for End-to-End Dynamic Machine Learningcited by 12
- 2017An Empirical Study of Mini-Batch Creation Strategies for Neural Machine Translationcited by 6
Built on by
Not cited yet.