• Stars
    star
    335
  • Rank 125,904 (Top 3 %)
  • Language
    C
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open single and half precision gemm implementations

Status: Archive (code is provided as-is, no updates expected)

openai-gemm

Open single and half precision gemm implementations. The main speedups over cublas are with small minibatch and in fp16 data formats.

Quick Install

The demonstration code currently depends on Nervana neon:

git clone [email protected]:NervanaSystems/neon.git
cd neon
make
. .venv/bin/activate

Clone and run this repo:

git clone [email protected]:openai/openai-gemm.git

Run the benchmark:
./benchmark.py

Run the unit test:
./test.py

DeepBench on Pascal TITAN X

( https://github.com/baidu-research/DeepBench )

M N K Op OpenAI_32 cuBLAS_32 ratio_32 OpenAI_16 cuBLAS_16 ratio_16
16 1760 1760 NN 2557 2195 1.2 3507 346 10.1
32 1760 1760 NN 5010 1128 4.4 6814 526 13.0
64 1760 1760 NN 6486 4112 1.6 8235 2801 2.9
128 1760 1760 NN 7068 6931 1.0 9400 5307 1.8
7000 1760 1760 NN 9968 9584 1.0 10515 9807 1.1
16 2048 2048 NN 2569 1516 1.7 3619 242 15.0
32 2048 2048 NN 5034 1356 3.7 6576 606 10.8
64 2048 2048 NN 6636 2815 2.4 8285 3241 2.6
128 2048 2048 NN 7316 6373 1.1 9066 5334 1.7
7000 2048 2048 NN 10081 9900 1.0 11275 9948 1.1
16 2560 2560 NN 2718 1312 2.1 4312 251 17.2
32 2560 2560 NN 5370 1660 3.2 7525 749 10.0
64 2560 2560 NN 7331 2687 2.7 8436 951 8.9
128 2560 2560 NN 8007 5238 1.5 9277 6123 1.5
7000 2560 2560 NN 10282 10131 1.0 11027 9974 1.1
16 4096 4096 NN 2695 1110 2.4 4442 266 16.7
32 4096 4096 NN 5266 2264 2.3 7723 758 10.2
64 4096 4096 NN 6942 3922 1.8 8904 1055 8.4
128 4096 4096 NN 8127 5686 1.4 9711 5681 1.7
7000 4096 4096 NN 10462 10082 1.0 11152 9991 1.1
16 1760 1760 NT 1719 1095 1.6 2692 290 9.3
32 1760 1760 NT 3316 1312 2.5 5068 447 11.3
64 1760 1760 NT 5247 1955 2.7 7621 1797 4.2
128 1760 1760 NT 6720 3393 2.0 8886 3342 2.7
7000 1760 1760 NT 9341 8513 1.1 10085 9635 1.0
16 2048 2048 NT 2442 1231 2.0 3641 299 12.2
32 2048 2048 NT 4801 1251 3.8 5849 468 12.5
64 2048 2048 NT 6317 1967 3.2 7825 3128 2.5
128 2048 2048 NT 7176 5041 1.4 8616 4843 1.8
7000 2048 2048 NT 9975 9173 1.1 10741 9560 1.1
16 2560 2560 NT 1834 1208 1.5 3154 297 10.6
32 2560 2560 NT 3610 1436 2.5 5418 584 9.3
64 2560 2560 NT 6083 2815 2.2 8331 1042 8.0
128 2560 2560 NT 7702 3246 2.4 8857 5259 1.7
7000 2560 2560 NT 9257 7829 1.2 10659 9548 1.1
16 4096 4096 NT 2546 1297 2.0 4164 309 13.5
32 4096 4096 NT 4992 2290 2.2 8156 775 10.5
64 4096 4096 NT 6746 4157 1.6 8429 1381 6.1
128 4096 4096 NT 7843 5425 1.4 9298 5527 1.7
7000 4096 4096 NT 9925 6879 1.4 10630 9784 1.1
7133 1760 1760 TN 9752 10186 1.0 10517 8912 1.2
7133 2048 2048 TN 10485 10319 1.0 10674 9608 1.1
7133 2560 2560 TN 10743 11057 1.0 11195 10059 1.1
7133 4096 4096 TN 10384 10290 1.0 10980 10558 1.0
9124 5124 1760 NN 9920 9480 1.0 10580 9743 1.1
9124 5124 2048 NN 10008 9415 1.1 10602 9796 1.1
9124 5124 2560 NN 9925 9426 1.1 10586 9850 1.1
9124 5124 4096 NN 9982 9489 1.1 10580 9472 1.1
9124 5124 1760 NT 9093 3497 2.6 9302 8692 1.1
9124 5124 2048 NT 9506 6512 1.5 9506 8883 1.1
9124 5124 2560 NT 8704 3364 2.6 9855 7733 1.3
9124 5124 4096 NT 9733 6109 1.6 10278 8760 1.2
8457 35 1760 NN 3343 1020 3.3 3841 736 5.2
8457 35 2048 NN 3419 1996 1.7 4782 803 6.0
8457 35 2560 NN 3415 1072 3.2 3868 789 4.9
8457 35 4096 NN 3743 2009 1.9 4741 804 5.9
8457 35 1760 NT 3574 1970 1.8 4176 1243 3.4
8457 35 2048 NT 4564 3069 1.5 4818 1255 3.8
8457 35 2560 NT 3598 2062 1.7 3597 1135 3.2
8457 35 4096 NT 4311 2990 1.4 4927 1303 3.8
16 7680 2560 NN 2683 718 3.7 4449 289 15.4
32 7680 2560 NN 5304 3660 1.4 7837 979 8.0
64 7680 2560 NN 7311 4979 1.5 9310 1274 7.3
128 7680 2560 NN 7931 6109 1.3 9390 6591 1.4
16 7680 2560 NT 1885 1191 1.6 3401 290 11.7
32 7680 2560 NT 3731 1808 2.1 6373 1004 6.3
64 7680 2560 NT 6274 3509 1.8 8809 1655 5.3
128 7680 2560 NT 7957 2988 2.7 9246 4695 2.0
16 3072 1024 NN 2277 1295 1.8 3373 282 12.0
32 3072 1024 NN 4494 1798 2.5 6011 807 7.4
64 3072 1024 NN 6272 3046 2.1 6790 917 7.4
128 3072 1024 NN 7364 5436 1.4 7768 5749 1.4
16 3072 1024 NT 2285 1077 2.1 3439 244 14.1
32 3072 1024 NT 4597 1540 3.0 5645 677 8.3
64 3072 1024 NT 6392 2969 2.2 7555 1204 6.3
128 3072 1024 NT 7460 5058 1.5 8586 5535 1.6
7435 3072 1024 TN 9829 8804 1.1 10123 9365 1.1
5481 7680 2560 TN 9448 9309 1.0 9466 9394 1.0

DeepBench on DGX1 (P100)

Note that the OpenAI kernels do not yet implement fp16x2 instructions. Even still it seems the current cublas hgemm implentation is only good for large dimensions. There are also accuracy considerations when accumulating large reductions in fp16.

M N K Op OpenAI_32 cuBLAS_32 ratio_32 OpenAI_16 cuBLAS_16 ratio_16
16 1760 1760 NN 2595 2048 1.3 2935 463 6.3
32 1760 1760 NN 4963 864 5.7 5766 895 6.4
64 1760 1760 NN 7565 3909 1.9 7760 1711 4.5
128 1760 1760 NN 8140 6053 1.3 8422 4089 2.1
7000 1760 1760 NN 9653 8722 1.1 9617 16143 0.6
16 2048 2048 NN 2255 1746 1.3 3211 546 5.9
32 2048 2048 NN 4467 1012 4.4 4533 1019 4.4
64 2048 2048 NN 6618 4198 1.6 6591 2018 3.3
128 2048 2048 NN 8059 5921 1.4 7936 4667 1.7
7000 2048 2048 NN 9761 9346 1.0 9910 18715 0.5
16 2560 2560 NN 2883 2108 1.4 4210 685 6.1
32 2560 2560 NN 5701 1279 4.5 5820 1297 4.5
64 2560 2560 NN 8100 6054 1.3 8099 2558 3.2
128 2560 2560 NN 8308 6799 1.2 8790 5901 1.5
7000 2560 2560 NN 9740 9538 1.0 9845 18499 0.5
16 4096 4096 NN 3449 1342 2.6 4299 1069 4.0
32 4096 4096 NN 6863 2045 3.4 6907 2103 3.3
64 4096 4096 NN 8404 4059 2.1 8248 4183 2.0
128 4096 4096 NN 8224 8039 1.0 8853 8669 1.0
7000 4096 4096 NN 9818 9519 1.0 10011 18588 0.5
16 1760 1760 NT 2579 1324 1.9 2763 428 6.4
32 1760 1760 NT 5089 878 5.8 5382 857 6.3
64 1760 1760 NT 7501 3017 2.5 7695 1695 4.5
128 1760 1760 NT 8043 5494 1.5 8192 3426 2.4
7000 1760 1760 NT 9477 7571 1.3 9355 16113 0.6
16 2048 2048 NT 2267 1276 1.8 3171 504 6.3
32 2048 2048 NT 4484 1026 4.4 4489 1009 4.4
64 2048 2048 NT 6567 3986 1.6 6551 2018 3.2
128 2048 2048 NT 8019 5825 1.4 7968 4496 1.8
7000 2048 2048 NT 9625 9373 1.0 9713 17878 0.5
16 2560 2560 NT 2870 1460 2.0 4256 638 6.7
32 2560 2560 NT 5614 1299 4.3 5705 1271 4.5
64 2560 2560 NT 8014 4402 1.8 8085 2521 3.2
128 2560 2560 NT 8219 5640 1.5 8240 5137 1.6
7000 2560 2560 NT 9534 9091 1.0 9735 18025 0.5
16 4096 4096 NT 3366 1547 2.2 4354 1047 4.2
32 4096 4096 NT 6714 2055 3.3 6859 2093 3.3
64 4096 4096 NT 8297 3445 2.4 8289 4178 2.0
128 4096 4096 NT 8335 7450 1.1 7911 7973 1.0
7000 4096 4096 NT 9578 9214 1.0 9877 18073 0.5
7133 1760 1760 TN 9704 9267 1.0 9506 15605 0.6
7133 2048 2048 TN 9747 9836 1.0 10012 19110 0.5
7133 2560 2560 TN 9742 9748 1.0 9805 19107 0.5
7133 4096 4096 TN 9807 9733 1.0 10122 19559 0.5
9124 5124 1760 NN 9326 9076 1.0 9631 17496 0.6
9124 5124 2048 NN 9414 9054 1.0 9602 17523 0.5
9124 5124 2560 NN 9353 9041 1.0 9698 17380 0.6
9124 5124 4096 NN 9370 9051 1.0 9689 17617 0.5
9124 5124 1760 NT 9124 8746 1.0 9524 16777 0.6
9124 5124 2048 NT 9294 8817 1.1 9641 16935 0.6
9124 5124 2560 NT 9221 8499 1.1 9637 16820 0.6
9124 5124 4096 NT 9270 8961 1.0 9568 17080 0.6
8457 35 1760 NN 3301 2233 1.5 4505 3154 1.4
8457 35 2048 NN 3265 3066 1.1 4501 3335 1.3
8457 35 2560 NN 3127 2300 1.4 4516 3135 1.4
8457 35 4096 NN 3257 3272 1.0 4729 3485 1.4
8457 35 1760 NT 4563 3142 1.5 4612 2998 1.5
8457 35 2048 NT 4554 3202 1.4 4601 3109 1.5
8457 35 2560 NT 4567 3144 1.5 4654 3039 1.5
8457 35 4096 NT 4353 3415 1.3 4457 3257 1.4
16 7680 2560 NN 3668 1200 3.1 5020 1236 4.1
32 7680 2560 NN 7245 3385 2.1 7519 2465 3.1
64 7680 2560 NN 8440 5210 1.6 8349 4910 1.7
128 7680 2560 NN 8765 4872 1.8 9131 11349 0.8
16 7680 2560 NT 3229 1515 2.1 5032 1157 4.3
32 7680 2560 NT 6640 2721 2.4 6810 2307 3.0
64 7680 2560 NT 8282 5113 1.6 8362 4494 1.9
128 7680 2560 NT 8763 4646 1.9 8617 9159 0.9
16 3072 1024 NN 2929 1717 1.7 3335 750 4.4
32 3072 1024 NN 5801 1399 4.1 6116 1420 4.3
64 3072 1024 NN 6958 4340 1.6 6923 2814 2.5
128 3072 1024 NN 8047 6492 1.2 7769 6302 1.2
16 3072 1024 NT 2990 1068 2.8 3384 705 4.8
32 3072 1024 NT 5834 1429 4.1 6021 1411 4.3
64 3072 1024 NT 6921 3500 2.0 6893 2819 2.4
128 3072 1024 NT 7918 6034 1.3 7876 5760 1.4
7435 3072 1024 TN 9367 9391 1.0 9559 17234 0.6
5481 7680 2560 TN 9672 9520 1.0 9967 18832 0.5

More Repositories

1

whisper

Robust Speech Recognition via Large-Scale Weak Supervision
Python
62,693
star
2

openai-cookbook

Examples and guides for using the OpenAI API
MDX
58,610
star
3

gym

A toolkit for developing and comparing reinforcement learning algorithms.
Python
34,442
star
4

CLIP

CLIP (Contrastive Language-Image Pretraining), Predict the most relevant text snippet given an image
Jupyter Notebook
22,966
star
5

openai-python

The official Python library for the OpenAI API
Python
22,561
star
6

gpt-2

Code for the paper "Language Models are Unsupervised Multitask Learners"
Python
21,450
star
7

chatgpt-retrieval-plugin

The ChatGPT Retrieval Plugin lets you easily find personal or work documents by asking questions in natural language.
Python
21,032
star
8

baselines

OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
Python
15,622
star
9

gpt-3

GPT-3: Language Models are Few-Shot Learners
15,573
star
10

swarm

Educational framework exploring ergonomic, lightweight multi-agent orchestration. Managed by OpenAI Solution team.
Python
14,944
star
11

evals

Evals is a framework for evaluating LLMs and LLM systems, and an open-source registry of benchmarks.
Python
14,607
star
12

tiktoken

tiktoken is a fast BPE tokeniser for use with OpenAI's models.
Python
11,374
star
13

triton

Development repository for the Triton language and compiler
C++
11,077
star
14

DALL-E

PyTorch package for the discrete VAE used for DALL·E.
Python
10,760
star
15

shap-e

Generate 3D objects conditioned on text or images
Python
10,285
star
16

spinningup

An educational resource to help anyone learn deep reinforcement learning.
Python
8,587
star
17

openai-node

The official Node.js / Typescript library for the OpenAI API
TypeScript
7,703
star
18

universe

Universe: a software platform for measuring and training an AI's general intelligence across the world's supply of games, websites and other applications.
Python
7,385
star
19

jukebox

Code for the paper "Jukebox: A Generative Model for Music"
Python
7,326
star
20

point-e

Point cloud diffusion for 3D model synthesis
Python
5,777
star
21

consistency_models

Official repo for consistency models.
Python
5,725
star
22

guided-diffusion

Python
5,000
star
23

plugins-quickstart

Get a ChatGPT plugin up and running in under 5 minutes!
Python
4,133
star
24

transformer-debugger

Python
4,003
star
25

retro

Retro Games in Gym
C
3,361
star
26

glide-text2im

GLIDE: a diffusion-based text-conditional image synthesis model
Python
3,277
star
27

glow

Code for reproducing results in "Glow: Generative Flow with Invertible 1x1 Convolutions"
Python
3,016
star
28

mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Cython
2,586
star
29

openai-quickstart-node

Node.js example app from the OpenAI API quickstart tutorial
JavaScript
2,534
star
30

weak-to-strong

Python
2,445
star
31

improved-gan

Code for the paper "Improved Techniques for Training GANs"
Python
2,218
star
32

human-eval

Code for the paper "Evaluating Large Language Models Trained on Code"
Python
2,204
star
33

improved-diffusion

Release for Improved Denoising Diffusion Probabilistic Models
Python
2,102
star
34

roboschool

DEPRECATED: Open-source software for robot simulation, integrated with OpenAI Gym.
Python
2,064
star
35

image-gpt

Python
2,025
star
36

consistencydecoder

Consistency Distilled Diff VAE
Python
1,933
star
37

finetune-transformer-lm

Code and model for the paper "Improving Language Understanding by Generative Pre-Training"
Python
1,929
star
38

gpt-2-output-dataset

Dataset of GPT-2 outputs for research in detection, biases, and more
Python
1,908
star
39

multiagent-particle-envs

Code for a multi-agent particle environment used in the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"
Python
1,871
star
40

pixel-cnn

Code for the paper "PixelCNN++: A PixelCNN Implementation with Discretized Logistic Mixture Likelihood and Other Modifications"
Python
1,856
star
41

openai-quickstart-python

Python example app from the OpenAI API quickstart tutorial
1,685
star
42

requests-for-research

A living collection of deep learning problems
HTML
1,625
star
43

multi-agent-emergence-environments

Environment generation code for the paper "Emergent Tool Use From Multi-Agent Autocurricula"
Python
1,590
star
44

gpt-discord-bot

Example Discord bot written in Python that uses the completions API to have conversations with the `text-davinci-003` model, and the moderations API to filter the messages.
Python
1,569
star
45

evolution-strategies-starter

Code for the paper "Evolution Strategies as a Scalable Alternative to Reinforcement Learning"
Python
1,504
star
46

generating-reviews-discovering-sentiment

Code for "Learning to Generate Reviews and Discovering Sentiment"
Python
1,491
star
47

neural-mmo

Code for the paper "Neural MMO: A Massively Multiagent Game Environment for Training and Evaluating Intelligent Agents"
Python
1,463
star
48

prm800k

800,000 step-level correctness labels on LLM solutions to MATH problems
Python
1,371
star
49

openai-dotnet

The official .NET library for the OpenAI API
C#
1,352
star
50

openai-assistants-quickstart

OpenAI Assistants API quickstart with Next.js.
TypeScript
1,350
star
51

sparse_attention

Examples of using sparse attention, as in "Generating Long Sequences with Sparse Transformers"
Python
1,347
star
52

maddpg

Code for the MADDPG algorithm from the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"
Python
1,284
star
53

Video-Pre-Training

Video PreTraining (VPT): Learning to Act by Watching Unlabeled Online Videos
Python
1,280
star
54

openai-openapi

OpenAPI specification for the OpenAI API
1,235
star
55

lm-human-preferences

Code for the paper Fine-Tuning Language Models from Human Preferences
Python
1,185
star
56

following-instructions-human-feedback

1,129
star
57

universe-starter-agent

A starter agent that can solve a number of universe environments.
Python
1,086
star
58

dalle-2-preview

1,044
star
59

InfoGAN

Code for reproducing key results in the paper "InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets"
Python
1,029
star
60

grade-school-math

Python
1,005
star
61

procgen

Procgen Benchmark: Procedurally-Generated Game-Like Gym-Environments
C++
1,005
star
62

supervised-reptile

Code for the paper "On First-Order Meta-Learning Algorithms"
JavaScript
955
star
63

blocksparse

Efficient GPU kernels for block-sparse matrix multiplication and convolution
Cuda
941
star
64

automated-interpretability

Python
896
star
65

random-network-distillation

Code for the paper "Exploration by Random Network Distillation"
Python
861
star
66

kubernetes-ec2-autoscaler

A batch-optimized scaling manager for Kubernetes
Python
849
star
67

summarize-from-feedback

Code for "Learning to summarize from human feedback"
Python
833
star
68

large-scale-curiosity

Code for the paper "Large-Scale Study of Curiosity-Driven Learning"
Python
800
star
69

multiagent-competition

Code for the paper "Emergent Complexity via Multi-agent Competition"
Python
761
star
70

imitation

Code for the paper "Generative Adversarial Imitation Learning"
Python
643
star
71

deeptype

Code for the paper "DeepType: Multilingual Entity Linking by Neural Type System Evolution"
Python
633
star
72

mlsh

Code for the paper "Meta-Learning Shared Hierarchies"
Python
588
star
73

iaf

Code for reproducing key results in the paper "Improving Variational Inference with Inverse Autoregressive Flow"
Python
499
star
74

mujoco-worldgen

Automatic object XML generation for Mujoco
Python
489
star
75

safety-gym

Tools for accelerating safe exploration research.
Python
421
star
76

vdvae

Repository for the paper "Very Deep VAEs Generalize Autoregressive Models and Can Outperform Them on Images"
Python
407
star
77

coinrun

Code for the paper "Quantifying Transfer in Reinforcement Learning"
C++
390
star
78

robogym

Robotics Gym Environments
Python
389
star
79

weightnorm

Example code for Weight Normalization, from "Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks"
Python
357
star
80

atari-py

A packaged and slightly-modified version of https://github.com/bbitmaster/ale_python_interface
C++
354
star
81

openai-security-bots

Python
351
star
82

vime

Code for the paper "Curiosity-driven Exploration in Deep Reinforcement Learning via Bayesian Neural Networks"
Python
331
star
83

safety-starter-agents

Basic constrained RL agents used in experiments for the "Benchmarking Safe Exploration in Deep Reinforcement Learning" paper.
Python
312
star
84

ebm_code_release

Code for Implicit Generation and Generalization with Energy Based Models
Python
311
star
85

CLIP-featurevis

code for reproducing some of the diagrams in the paper "Multimodal Neurons in Artificial Neural Networks"
Python
294
star
86

gym-http-api

API to access OpenAI Gym from other languages via HTTP
Python
292
star
87

gym-soccer

Python
289
star
88

sparse_autoencoder

Python
287
star
89

robosumo

Code for the paper "Continuous Adaptation via Meta-Learning in Nonstationary and Competitive Environments"
Python
283
star
90

web-crawl-q-and-a-example

Learn how to crawl your website and build a Q/A bot with the OpenAI API
Jupyter Notebook
268
star
91

phasic-policy-gradient

Code for the paper "Phasic Policy Gradient"
Python
245
star
92

EPG

Code for the paper "Evolved Policy Gradients"
Python
240
star
93

orrb

Code for the paper "OpenAI Remote Rendering Backend"
C#
235
star
94

miniF2F

Formal to Formal Mathematics Benchmark
Objective-C++
202
star
95

atari-reset

Code for the blog post "Learning Montezuma’s Revenge from a Single Demonstration"
Python
183
star
96

spinningup-workshop

For educational materials related to the spinning up workshops.
TeX
181
star
97

train-procgen

Code for the paper "Leveraging Procedural Generation to Benchmark Reinforcement Learning"
Python
170
star
98

human-eval-infilling

Code for the paper "Efficient Training of Language Models to Fill in the Middle"
Python
162
star
99

openai-go

The official Go library for the OpenAI API
Go
145
star
100

dallify-discord-bot

Example code for using OpenAI’s NodeJS SDK with discord.js SDK to create a Discord Bot that uses Slash Commands.
TypeScript
139
star