Skip to main content

Table of Contents

  1. Overview
  2. Install
    1. Requirement
    2. Install from PyPI
    3. Install from Source
  3. Features
  4. Implementation

Overview

This repository is non-official third-paty re-implementation of SLIDE1.

We provide

  • Python package
  • Hash based Deep Learning
  • Parallel computing based on C++17 parallel STL

We don't provide

  • Explicit CPU optimized code like AVX (We just rely on compiler optimization)
  • Compiled binary (You need to compile by yourself)

Install

There are two options, "Install from PyPI" and "Install from Source". For ordinary user, "Install from PyPI" is recommended.

For both case, sufficient C++ compiler is neccessary.

Requirement

  • Recent C++ compiler with parallel STL algorithm support
  • Python 3

Requirements can be installed on Docker image gcc:10.

# On local machine
docker run -it gcc:10 bash

# On gcc:10 image
apt update && apt install -y python3-pip libtbb-dev

Install from PyPI

pip install HashDL

Install from Source

git clone https://gitlab.com/ymd_h/hashdl.git HashDL
cd HashDL
pip install .

Features

  • Neural Network
    • hash-based sparse dense layer
  • Activation
    • ReLU
    • linear (no activation)
    • sigmoid
  • Optimizer
    • SGD
    • Adam2
  • Weight Initializer
    • constant
    • Gauss distribution
  • Hash for similarity
    • WTA
    • DWTA3
  • Scheduler for hash update
    • constant
    • exponential decay

In the current architecture, CNN is impossible.

Implementation

The official reference implementation focused on performance and accepted some "dirtyness" like hard-coded magic number for algotihm selection and unmanaged memory allocation.

We accept some (but hopefully small) overhead and improve maintenability in terms of software;

  • Polymorphism with inheritance and virtual function
  • RAII and smart pointer for memory management

These archtecture allows us to construct and manage C++ class from Python without recompile.

We also rely recent C++ standard and compiler optimization;

  • Parallel STL from C++17
  • Because of RVO (or at least move semantics), returning std::vector is not so much costful as it was.

Footnotes

1 B. Chen et al., "SLIDE : In Defense of Smart Algorithms over Hardware Acceleration for Large-Scale Deep Learning Systems", MLSys 2020 (arXiv, code)

2 D. P. Kingma and J. Ba, "Adam: A Method for Stochastic Optimization", ICLR (2015) (arXiv)

3 B. Chen et al., "Densified Winner Take All (WTA) Hashing for Sparse Datasets", Uncertainty in artificial intelligence (2018)

Metadata

Release files for HashDL 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for HashDL 4.0.0
File Size Uploaded
HashDL-4.0.0.tar.gz 202.4 kB Details

Release files / HashDL-4.0.0.tar.gz

Download URL HashDL-4.0.0.tar.gz
Size 202.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a06cd562d9c558ab5d4f0f63acef8f8b790b7cd4a061bd140ffedfd43f250916
BLAKE2b-256 checksum
How to use checksums
1c0600f13f029f41801097366aa069850308eb34416994aafea9ed37b55b4cc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

4.0.0 This release

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.0.0

1 release file

1.0.2

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page