All Projects → pytorch → Nestedtensor

pytorch / Nestedtensor

Licence: bsd-3-clause
[Prototype] Tools for the concurrent manipulation of variably sized Tensors.

Projects that are alternatives of or similar to Nestedtensor

Neural Painters Pytorch
PyTorch library for "Neural Painters: A learned differentiable constraint for generating brushstroke paintings"
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Reinforcementlearning Atarigame
Pytorch LSTM RNN for reinforcement learning to play Atari games from OpenAI Universe. We also use Google Deep Mind's Asynchronous Advantage Actor-Critic (A3C) Algorithm. This is much superior and efficient than DQN and obsoletes it. Can play on many games
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Tensorflow shiny
A R/Shiny app for interactive RNN tensorflow models
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Adaptiveneuraltrees
Adaptive Neural Trees
Stars: ✭ 119 (+0%)
Mutual labels:  jupyter-notebook
Bitcoin Price Prediction Using Sentiment Analysis
Predicts real-time bitcoin price using twitter and reddit sentiment, and sends out notifications via SMS.
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Statistical Learning Method
《统计学习方法》笔记-基于Python算法实现
Stars: ✭ 1,643 (+1280.67%)
Mutual labels:  jupyter-notebook
Fusion360gallerydataset
Data, tools, and documentation of the Fusion 360 Gallery Dataset
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Ds salary proj
Repo for the data science salary prediction of the Data Science Project From Scratch video on my youtube
Stars: ✭ 116 (-2.52%)
Mutual labels:  jupyter-notebook
Vae Tensorflow
A Tensorflow implementation of a Variational Autoencoder for the deep learning course at the University of Southern California (USC).
Stars: ✭ 117 (-1.68%)
Mutual labels:  jupyter-notebook
Ysda deeplearning17
Yandex SDA classes on deep learning. Version of year 2017
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Amazonsagemakercourse
SageMaker Course Material
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Pandas
pandas cheetsheet
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Qiskit Tutorials
A collection of Jupyter notebooks showing how to use the Qiskit SDK
Stars: ✭ 1,777 (+1393.28%)
Mutual labels:  jupyter-notebook
Vcn
Volumetric Correspondence Networks for Optical Flow, NeurIPS 2019.
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Senato.py
A scraper for the data made available by the Italian Senate, and a cluster analysis to detect similar amendments.
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Reinvent2019 Aim362 Sagemaker Debugger Model Monitor
Build, train & debug, and deploy & monitor with Amazon SageMaker
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Pytextrank
Python implementation of TextRank for phrase extraction and summarization of text documents
Stars: ✭ 1,675 (+1307.56%)
Mutual labels:  jupyter-notebook
Deeplearning With Tensorflow Notes
龙曲良《TensorFlow深度学习》学习笔记及代码,采用TensorFlow2.0.0版本
Stars: ✭ 119 (+0%)
Mutual labels:  jupyter-notebook
Midi Dataset
Code for creating a dataset of MIDI ground truth
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook
Planet Amazon Deforestation
The open source repository for the Kaggle Amazon forest devastation competition https://www.kaggle.com/c/planet-understanding-the-amazon-from-space
Stars: ✭ 118 (-0.84%)
Mutual labels:  jupyter-notebook

The nestedtensor package prototype

If you are here because you ran into a runtime error due to a missing feature or some kind of bug, please open an issue and fill in the appropiate template. If you have general feedback about this prototype you can use our suggested template or just open a free-form issue if you like. Thank you for contributing to this project!

Tutorials

If you are new to this project, we recommend you take a look at our whirlwind introduction to get started.

Operator support

Please see the list of currently supported operators and open an issue if you find you need one for your project that's not listed.

Binaries

The nestedtensor project is built on top of a torch fork for improved interoperability and also ships with torchvision binaries that were built against this fork. To use NestedTensors you need to install this version of torch, which is frequently rebased upon PyTorch's viable/strict branch (most recent master where all tests pass).

Version Python CUDA Wheels
0.1.1 3.6 CPU-only torch, nestedtensor, torchvision
0.1.1 3.7 CPU-only torch, nestedtensor, torchvision
0.1.1 3.8 CPU-only torch, nestedtensor, torchvision

Why consider using this? / Dealing with dynamic shapes

In general we batch data for efficiency, but usually batched kernels need, or greatly benefit from, regular, statically-shaped data.

One way of dealing with dynamic shapes then, is via padding and masking. Various projects construct masks that, together with a data Tensor, are used as a representation for lists of dynamically shaped Tensors.

Obviously this is inefficient from a memory and compute perspective if the Tensors within this list are sufficiently diverse.

You can also trace through the codebase where these masks are used and observe the kind of code this approach often leads to. See for example universal_sentence_embedding.

Otherwise we also have one-off operator support in PyTorch that aims to support dynamic shapes via extra arguments such as a padding index. Of course, while these functions are fast and sometimes memory efficient, they don't provide a consistent interface.

Other users simply gave up and started writing for-loops, or discovered that batching didn't help.

We want to have a single abstraction that is consistent, fast, memory efficient and readable and the nestedtensor project aims to provide that.

How does nestedtensor help here?

NestedTensors are a generalization of torch Tensors which eases working with data of different shapes and lengths. In a nutshell, Tensors have scalar entries (e.g. floats) and NestedTensors have Tensor entries. However, note that a NestedTensor is still a Tensor. That means it needs to have a single dimension, single dtype, single device and single layout.

Tensor entry constraints:

  • Each Tensor constituent is of the dtype, layout and device of the containing NestedTensor.
  • The dimension of a constituent Tensor must be less than the dimension of the NestedTensor.
  • An empty NestedTensor is of dimension zero.

Prototype classification

The nestedtensor package is a prototype intended for early stage feedback and testing. It is on the road to a beta classification, but there is no definitive timeline yet. See PyTorch feature classification for what prototype, beta and stale means.

Supported platforms

It is developed against a fork of PyTorch to enable cutting-edge features such as improved performance or better torch.vmap integration.

Developers will thus need to build from source, but users can use the binary we will start shipping soon (see the related issue).

If you want to use the binaries you need to run on Linux, use Python 3.8+ and have a CUDA-11 toolkit installed.

If you want to build from source you can probably get it to work on many platforms, but supporting other platforms won't take priority over Linux. We're happy to review community contributions that achieve this however.

Dependencies

  • pytorch (installed from nestedtensor/third_party/pytorch submodule)
  • torchvision (needed for examples and tests)
  • ipython (needed for examples)
  • notebook (needed for examples)

Build for development

Get the source

git clone --recursive https://github.com/pytorch/nestedtensor
cd nestedtensor
# if you are updating an existing checkout
git submodule sync
git submodule update --init --recursive

Install the build tools

conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests
conda install -c pytorch magma-cuda110

Build from scratch

./clean_build_with_submodule.sh

Incremental builds

./build_with_submodule.sh

Contribution

The project is under active development. If you have a suggestions or found a bug, please file an issue!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].