Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 grad  





2 jit  





3 vmap  





4 pmap  





5 Libraries using JAX  





6 See also  





7 External links  





8 References  














Google JAX






العربية
Català
Русский

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


JAX

Logo

Developer(s)

Google

Stable release

0.4.24[1] Edit this on Wikidata / 6 February 2024; 5 months ago (6 February 2024)

Repository

github.com/google/jax

Written in

Python, C++

Operating system

Linux, macOS, Windows

Platform

Python, NumPy

Size

9.0 MB

Type

Machine learning

License

Apache 2.0

Website

jax.readthedocs.io/en/latest/ Edit this on Wikidata

Google JAX is a machine learning framework for transforming numerical functions to be used in Python.[2][3][4] It is described as bringing together a modified version of autograd[5] (automatic obtaining of the gradient function through differentiation of a function) and TensorFlow's XLA (Accelerated Linear Algebra). It is designed to follow the structure and workflow of NumPy as closely as possible and works with various existing frameworks such as TensorFlow and PyTorch.[6][7] The primary functions of JAX are:[2]

  1. grad: automatic differentiation
  2. jit: compilation
  3. vmap: auto-vectorization
  4. pmap: SPMD programming

grad[edit]

The code below demonstrates the grad function's automatic differentiation.

# imports
from jax import grad
import jax.numpy as jnp

# define the logistic function
def logistic(x):  
    return jnp.exp(x) / (jnp.exp(x) + 1)

# obtain the gradient function of the logistic function
grad_logistic = grad(logistic)

# evaluate the gradient of the logistic function at x = 1 
grad_log_out = grad_logistic(1.0)   
print(grad_log_out)

The final line should outputː

0.19661194

jit[edit]

The code below demonstrates the jit function's optimization through fusion.

# imports
from jax import jit
import jax.numpy as jnp

# define the cube function
def cube(x):
    return x * x * x

# generate data
x = jnp.ones((10000, 10000))

# create the jit version of the cube function
jit_cube = jit(cube)

# apply the cube and jit_cube functions to the same data for speed comparison
cube(x)
jit_cube(x)

The computation time for jit_cube (line no. 17) should be noticeably shorter than that for cube (line no. 16). Increasing the values on line no. 10, will increase the difference.

vmap[edit]

The code below demonstrates the vmap function's vectorization.

# imports
from functools import partial
from jax import vmap
import jax.numpy as jnp

# define function
def grads(self, inputs):
    in_grad_partial = partial(self._net_grads, self._net_params)
    grad_vmap = vmap(in_grad_partial)
    rich_grads = grad_vmap(inputs)
    flat_grads = np.asarray(self._flatten_batch(rich_grads))
    assert flat_grads.ndim == 2 and flat_grads.shape[0] == inputs.shape[0]
    return flat_grads

The GIF on the right of this section illustrates the notion of vectorized addition.

Illustration video of vectorized addition

pmap[edit]

The code below demonstrates the pmap function's parallelization for matrix multiplication.

# import pmap and random from JAX; import JAX NumPy
from jax import pmap, random
import jax.numpy as jnp

# generate 2 random matrices of dimensions 5000 x 6000, one per device
random_keys = random.split(random.PRNGKey(0), 2)
matrices = pmap(lambda key: random.normal(key, (5000, 6000)))(random_keys)

# without data transfer, in parallel, perform a local matrix multiplication on each CPU/GPU
outputs = pmap(lambda x: jnp.dot(x, x.T))(matrices)

# without data transfer, in parallel, obtain the mean for both matrices on each CPU/GPU separately
means = pmap(jnp.mean)(outputs)
print(means)

The final line should print the valuesː

[1.1566595 1.1805978]

Libraries using JAX[edit]

Several python libraries use JAX as a backend, including:

Some R libraries use JAX as a backend as well, including:

See also[edit]

External links[edit]

References[edit]

  1. ^ https://github.com/google/jax/releases/tag/jax-v0.4.24. {{cite web}}: Missing or empty |title= (help)
  • ^ a b Bradbury, James; Frostig, Roy; Hawkins, Peter; Johnson, Matthew James; Leary, Chris; MacLaurin, Dougal; Necula, George; Paszke, Adam; Vanderplas, Jake; Wanderman-Milne, Skye; Zhang, Qiao (2022-06-18), "JAX: Autograd and XLA", Astrophysics Source Code Library, Google, Bibcode:2021ascl.soft11002B, archived from the original on 2022-06-18, retrieved 2022-06-18
  • ^ Frostig, Roy; Johnson, Matthew James; Leary, Chris (2018-02-02). "Compiling machine learning programs via high-level tracing" (PDF). MLsys: 1–3. Archived (PDF) from the original on 2022-06-21.
  • ^ "Using JAX to accelerate our research". www.deepmind.com. 4 December 2020. Archived from the original on 2022-06-18. Retrieved 2022-06-18.
  • ^ HIPS/autograd, Formerly: Harvard Intelligent Probabilistic Systems Group -- Now at Princeton, 2024-03-27, retrieved 2024-03-28
  • ^ Lynley, Matthew. "Google is quietly replacing the backbone of its AI product strategy after its last big push for dominance got overshadowed by Meta". Business Insider. Archived from the original on 2022-06-21. Retrieved 2022-06-21.
  • ^ "Why is Google's JAX so popular?". Analytics India Magazine. 2022-04-25. Archived from the original on 2022-06-18. Retrieved 2022-06-18.
  • ^ Flax: A neural network library and ecosystem for JAX designed for flexibility, Google, 2022-07-29, retrieved 2022-07-29
  • ^ Flax: A neural network library and ecosystem for JAX designed for flexibility, Google, 2022-07-29, retrieved 2022-07-29
  • ^ Kidger, Patrick (2022-07-29), Equinox, retrieved 2022-07-29
  • ^ Optax, DeepMind, 2022-07-28, retrieved 2022-07-29
  • ^ RLax, DeepMind, 2022-07-29, retrieved 2022-07-29
  • ^ Jraph - A library for graph neural networks in jax., DeepMind, 2023-08-08, retrieved 2023-08-08
  • ^ "typing — Support for type hints". Python documentation. Retrieved 2023-08-08.
  • ^ jaxtyping, Google, 2023-08-08, retrieved 2023-08-08
  • ^ Jerzak, Connor (2023-10-01), fastrerandomize, retrieved 2023-10-03
  • Differentiable computing

    General

  • Information geometry
  • Statistical manifold
  • Automatic differentiation
  • Neuromorphic engineering
  • Pattern recognition
  • Tensor calculus
  • Computational learning theory
  • Inductive bias
  • Concepts

  • Clustering
  • Regression
  • Hallucination
  • Adversary
  • Attention
  • Convolution
  • Loss functions
  • Backpropagation
  • Batchnorm
  • Activation
  • Regularization
  • Datasets
  • Diffusion
  • Autoregression
  • Applications

  • Artificial neural network
  • Scientific computing
  • Artificial Intelligence
  • Language model
  • Hardware

  • TPU
  • VPU
  • Memristor
  • SpiNNaker
  • Software libraries

  • PyTorch
  • Keras
  • Theano
  • JAX
  • Flux.jl
  • MindSpore
  • Implementations

    Audio–visual

  • WaveNet
  • Human image synthesis
  • HWR
  • OCR
  • Speech synthesis
  • Speech recognition
  • Facial recognition
  • AlphaFold
  • Text-to-image models
  • Text-to-video models
  • Whisper
  • Verbal

  • Seq2seq
  • BERT
  • Gemini
  • LaMDA
  • NMT
  • Project Debater
  • IBM Watson
  • IBM Watsonx
  • Granite
  • GPT-1
  • GPT-2
  • GPT-3
  • GPT-4
  • ChatGPT
  • GPT-J
  • Chinchilla AI
  • PaLM
  • BLOOM
  • LLaMA
  • PanGu-Σ
  • Decisional

  • AlphaZero
  • Q-learning
  • SARSA
  • OpenAI Five
  • Self-driving car
  • MuZero
  • Action selection
  • Robot control
  • People

  • Alex Graves
  • Ian Goodfellow
  • Stephen Grossberg
  • Demis Hassabis
  • Geoffrey Hinton
  • Yann LeCun
  • Fei-Fei Li
  • Andrew Ng
  • Jürgen Schmidhuber
  • David Silver
  • Ilya Sutskever
  • Organizations

  • EleutherAI
  • Google DeepMind
  • Hugging Face
  • OpenAI
  • Meta AI
  • Mila
  • MIT CSAIL
  • Huawei
  • Architectures

  • Differentiable neural computer
  • Transformer
  • Recurrent neural network (RNN)
  • Long short-term memory (LSTM)
  • Gated recurrent unit (GRU)
  • Echo state network
  • Multilayer perceptron (MLP)
  • Convolutional neural network
  • Residual neural network
  • Mamba
  • Autoencoder
  • Variational autoencoder (VAE)
  • Generative adversarial network (GAN)
  • Graph neural network
  • Technology
  • Categories
  • History
  • List of Android apps
  • List of Easter eggs
  • List of mergers and acquisitions
  • Company

    Divisions

  • AI
  • DeepMind
  • Android
  • China
  • Chrome
  • Cloud
  • Glass
  • Google.org
  • Health
  • Maps
  • Pixel
  • Search
  • Sidewalk Labs
  • Sustainability
  • YouTube
  • People

    Current

  • Vint Cerf
  • Jeff Dean
  • John Doerr
  • Sanjay Ghemawat
  • Al Gore
  • John L. Hennessy
  • Urs Hölzle
  • Salar Kamangar
  • Ray Kurzweil
  • Ann Mather
  • Alan Mulally
  • Rick Osterloh
  • Sundar Pichai (CEO)
  • Ruth Porat (CFO)
  • Rajen Sheth
  • Hal Varian
  • Susan Wojcicki
  • Neal Mohan
  • Former

  • Sergey Brin (Founder)
  • David Cheriton
  • Matt Cutts
  • David Drummond
  • Alan Eustace
  • Timnit Gebru
  • Omid Kordestani
  • Paul Otellini
  • Larry Page (Founder)
  • Patrick Pichette
  • Eric Schmidt
  • Ram Shriram
  • Amit Singhal
  • Shirley M. Tilghman
  • Rachel Whetstone
  • Real estate

  • Androidland
  • Barges
  • Binoculars Building
  • Central Saint Giles
  • Chelsea Market
  • Chrome Zone
  • Data centers
  • Googleplex
  • Mayfield Mall
  • Pier 57
  • Sidewalk Toronto
  • St. John's Terminal
  • YouTube Space
  • YouTube Theater
  • Design

  • Noto
  • Product Sans
  • Roboto
  • Logo
  • Material Design
  • Events

  • Developer Day
  • Developer Lab
  • Code-in
  • Code Jam
  • Developer Day
  • Developers Live
  • Doodle4Google
  • G-Day
  • I/O
  • Jigsaw
  • Living Stories
  • Lunar XPRIZE
  • Mapathon
  • Science Fair
  • Summer of Code
  • Talks at Google
  • YouTube

  • CNN/YouTube presidential debates
  • Comedy Week
  • Live
  • Music Awards
  • Space Lab
  • Symphony Orchestra
  • Projects and
    initiatives

  • Area 120
  • ATAP
  • Business Groups
  • Computing University Initiative
  • Data Liberation Front
  • Data Transfer Project
  • Developer Expert
  • Digital Garage
  • Digital News Initiative
  • Digital Unlocked
  • Dragonfly
  • Founders' Award
  • Free Zone
  • Get Your Business Online
  • Google for Education
  • Google for Startups
  • Labs
  • Liquid Galaxy
  • Made with Code
  • Māori
  • ML FairnessNative Client
  • News Lab
  • Nightingale
  • OKR
  • PowerMeter
  • Privacy Sandbox
  • Quantum Artificial Intelligence Lab
  • RechargeIT
  • Shield
  • Silicon Initiative
  • Solve for X
  • Starline
  • Student Ambassador Program
  • Submarine communications cables
  • Sunroof
  • YouTube
  • Zero
  • Criticism

  • 2018 walkouts
  • Alphabet Workers Union
  • Censorship
  • DeGoogle
  • "Did Google Manipulate Search for Hillary?"
  • Dragonfly
  • FairSearch
  • "Ideological Echo Chamber" memo
  • Litigation
  • Privacy concerns
  • San Francisco tech bus protests
  • Services outages
  • Smartphone patent wars
  • Worker organization
  • YouTube

  • Censorship
  • Copyright issues
  • Copyright strike
  • Elsagate
  • Fantastic Adventures scandal
  • Headquarters shooting
  • Kohistan video case
  • Reactions to Innocence of Muslims
  • Slovenian government incident
  • Operating systems

  • Glass OS
  • Go
  • gLinux
  • Goobuntu
  • Things
  • TV
  • Wear OS
  • ChromeOS
  • Fuchsia
  • TV
  • Libraries/
    frameworks

  • AMP
  • Angular
  • ARCore
  • APIs
  • Blockly
  • Chart API
  • Charts
  • Dialogflow
  • Exposure Notification
  • Fast Pair
  • Federated Learning of Cohorts
  • File System
  • FlatBuffers
  • Flutter
  • Gears
  • gRPC
  • Gson
  • Guava
  • Guice
  • Guetzli
  • JAX
  • gVisor
  • MapReduce
  • Matter
  • Mobile Services
  • Neural Machine Translation
  • OpenSocial
  • Pack
  • Polymer
  • Protocol Buffers
  • Reqwireless
  • Shell
  • Skia Graphics Engine
  • Tango
  • TensorFlow
  • Test
  • WaveNet
  • Weave
  • Web Accelerator
  • WebRTC
  • Platforms

  • AppJet
  • Apps Script
  • Cloud Platform
  • Firebase
  • Global IP Solutions
  • Gridcentric, Inc.
  • ITA Software
  • Kubernetes
  • LevelDB
  • Neatx
  • Project IDX
  • SageTV
  • Apigee

  • Bitium
  • Chronicle
  • Compute Engine
  • Connect
  • Dataflow
  • Datastore
  • Kaggle
  • Looker
  • Mandiant
  • Messaging
  • Orbitera
  • Shell
  • Stackdriver
  • Storage
  • Tools

  • Android Cloud to Device Messaging
  • Android Debug Bridge
  • Android Studio
  • App Maker
  • App Runtime for Chrome
  • AppSheet
  • Bazel
  • Chrome Frame
  • Closure Tools
  • Cpplint
  • Data Protocol
  • Gadgets
  • Gerrit
  • GYP
  • Kythe
  • Lighthouse
  • MIT App Inventor
  • Mashup Editor
  • Native Client
  • Optimize
  • OpenRefine
  • OR-Tools
  • PageSpeed
  • Plugin for Eclipse
  • Programmable Search Engine
  • Public DNS
  • reCAPTCHA
  • Schema.org
  • Search Console
  • Sitemaps
  • Swiffy
  • Tesseract (software)
  • Trendalyzer
  • VisBug
  • Wave Federation Protocol
  • Web Toolkit
  • Search algorithms

  • PageRank
  • Panda
  • Penguin
  • Pigeon
  • RankBrain
  • Others

  • BigQuery
  • Chrome Experiments
  • Flutter
  • Gemini
  • Googlebot
  • Keyhole Markup Language
  • LaMDA
  • Open Location Code
  • PaLM
  • Programming languages
  • Transformer
  • Viewdle
  • Webdriver Torso
  • Web Server
  • File formats

  • APK
  • On2 Technologies
  • VP9
  • WebM
  • WebP
  • WOFF2
  • Entertainment

  • PaperofRecord.com
  • Podcasts
  • Quick, Draw!
  • Santa Tracker
  • Songza
  • Stadia
  • TV
  • Vevo
  • Video
  • Play

  • Games
  • most downloaded apps
  • Music
  • Newsstand
  • Pass
  • Services
  • YouTube

  • BrandConnect
  • Content ID
  • Instant
  • Kids
  • Music
  • Official channel
  • Preferred
  • Premium
  • YouTube Rewind
  • RightsFlow
  • Shorts
  • Studio
  • TV
  • Communication

  • Bump
  • Buzz
  • Chat
  • Contacts
  • Currents (social app)
  • Dodgeball
  • Duo
  • Fi Wireless
  • Friend Connect
  • Gizmo5
  • Google+
  • Gmail
  • Groups
  • Hangouts
  • Helpouts
  • IME
  • Jaiku
  • Marratech
  • Meebo
  • Meet
  • Messages
  • Moderator
  • Neotonic Software
  • Orkut
  • Postini
  • Quest Visual
  • Schemer
  • Spaces
  • Sparrow
  • Talk
  • Translate
  • Voice
  • Voice Local Search
  • Wave
  • Search

  • Alerts
  • Answers
  • Base
  • BeatThatQuote.com
  • Blog Search
  • Books
  • Code Search
  • Data Commons
  • Dataset Search
  • Dictionary
  • Directory
  • Fast Flip
  • Flu Trends
  • Finance
  • Goggles
  • Google.by
  • Images
  • Kaltix
  • Knowledge Graph
  • Like.com
  • News
  • Patents
  • People Cards
  • Personalized Search
  • Public Data Explorer
  • Questions and Answers
  • SafeSearch
  • Scholar
  • Searchwiki
  • Shopping
  • Catalogs
  • Squared
  • Tenor
  • Travel
  • Trends
  • Voice Search
  • WDYL
  • Navigation

  • Endoxon
  • ImageAmerica
  • Maps
  • Waze
  • Business
    and finance

  • AdMob
  • Ads
  • Adscape
  • AdSense
  • Attribution
  • BebaPay
  • Checkout
  • Contributor
  • DoubleClick
  • Marketing Platform
  • Pay (mobile app)
  • PostRank
  • Primer
  • Softcard
  • Wildfire Interactive
  • Widevine
  • Organization
    and productivity

  • Browser Sync
  • Calendar
  • Cloud Search
  • Desktop
  • Drive
  • Etherpad
  • fflick
  • Files
  • iGoogle
  • Jamboard
  • Notebook
  • One
  • Photos
  • Quickoffice
  • Quick Search Box
  • Surveys
  • Sync
  • Tasks
  • Toolbar
  • Docs Editors

  • Drawings
  • Forms
  • Fusion Tables
  • Keep
  • Sheets
  • Slides
  • Sites
  • Vids
  • Publishing

  • Blogger
  • Domains
  • FeedBurner
  • One Pass
  • Page Creator
  • Sites
  • Web Designer
  • Education

  • Grasshopper
  • Socratic
  • Photomath
  • Read Along
  • Workspace
  • Others

  • Takeout
  • Android Auto
  • Android Beam
  • Arts & Culture
  • Assistant
  • Authenticator
  • Body
  • BufferBox
  • Building Maker
  • BumpTop
  • Cast
  • Cloud Print
  • Crowdsource
  • Digital Wellbeing
  • Expeditions
  • Family Link
  • Find My Device
  • Fit
  • Google Fonts
  • Gboard
  • Gemini
  • Gesture Search
  • Impermium
  • Knol
  • Lively
  • Live Transcribe
  • MyTracks
  • Nearby Share
  • Now
  • Offers
  • Opinion Rewards
  • Person Finder
  • Poly
  • Question Hub
  • Quick Share
  • Reader
  • Safe Browsing
  • Sidewiki
  • SlickLogin
  • Sound Amplifier
  • Speech Services
  • Station
  • Store
  • TalkBack
  • Tilt Brush
  • URL Shortener
  • Voice Access
  • Wavii
  • Web Light
  • WiFi
  • Chrome

  • Chromium
  • Dinosaur Game
  • GreenBorder
  • Remote Desktop
  • Web Store
  • V8
  • Images and
    photography

  • Lens
  • Snapseed
  • Panoramio
  • Photos
  • Picasa
  • Picnik
  • Hardware

    Smartphones

  • Android One
  • Nexus
  • S
  • Galaxy Nexus
  • 4
  • 5
  • 6
  • 5X
  • 6P
  • Comparison
  • Pixel
  • Play Edition
  • Project Ara
  • Laptops and tablets

  • Nexus
  • Pixel
  • Wearables

  • Pixel Buds
  • Pixel Watch
  • Pixel Watch 2
  • Project Iris (unreleased)
  • Virtual reality
  • Others

  • Chromebox
  • Clips
  • Digital media players
  • Dropcam
  • Liquid Galaxy
  • Nest
  • OnHub
  • Pixel Visual Core
  • Search Appliance
  • Sycamore processor
  • Tensor
  • Tensor Processing Unit
  • Titan Security Key
  • t
  • e
  • Advertising

  • Rescuecom Corp. v. Google Inc. (2009)
  • Goddard v. Google, Inc. (2009)
  • Rosetta Stone Ltd. v. Google, Inc. (2012)
  • Google, Inc. v. American Blind & Wallpaper Factory, Inc. (2017)
  • Jedi Blue
  • Antitrust

  • United States v. Adobe Systems, Inc., Apple Inc., Google Inc., Intel Corporation, Intuit, Inc., and Pixar (2011)
  • Umar Javeed, Sukarma Thapar, Aaqib Javeed vs. Google LLC and Ors. (2019)
  • United States v. Google LLC (2020)
  • United States v. Google LLC (2023)
  • Intellectual property

  • Viacom International Inc. v. YouTube, Inc. (2010)
  • Lenz v. Universal Music Corp.(2015)
  • Authors Guild, Inc. v. Google, Inc. (2015)
  • Field v. Google, Inc. (2016)
  • Google LLC v. Oracle America, Inc. (2021)
  • Smartphone patent wars
  • Privacy

  • Hibnick v. Google, Inc. (2010)
  • United States v. Google Inc. (2012)
  • Judgement of the German Federal Court of Justice on Google's autocomplete function (2013)
  • Joffe v. Google, Inc. (2013)
  • Mosley v SARL Google (2013)
  • Google Spain v AEPD and Mario Costeja González (2014)
  • Frank v. Gaos (2019)
  • Other

  • Google LLC v Defteros (2020)
  • Epic Games v. Google (2021)
  • Gonzalez v. Google LLC (2022)
  • Terms and phrases

  • Gayglers
  • Google (verb)
  • Google bombing
  • Google effect
  • Googlefight
  • Google hacking
  • Googleshare
  • Google tax
  • Googlewhack
  • Googlization
  • "Illegal flower tribute"
  • Rooting
  • Search engine manipulation effect
  • Sitelink
  • Site reliability engineering
  • YouTube poop
  • Documentaries

  • Google: Behind the Screen
  • Google Maps Road Trip
  • Google and the World Brain
  • The Creepy Line
  • Books

  • The Google Story
  • Google Volume One
  • Googled: The End of the World as We Know It
  • How Google Works
  • I'm Feeling Lucky
  • In the Plex
  • The Google Book
  • The MANIAC
  • Popular culture

  • Google Me (film)
  • "Google Me" (Kim Zolciak song)
  • "Google Me" (Teyana Taylor song)
  • Is Google Making Us Stupid?
  • Proceratium google
  • Matt Nathanson: Live at Google
  • The Billion Dollar Code
  • The Internship
  • Where on Google Earth is Carmen Sandiego?
  • Others

  • elgooG
  • Predictions of the end
  • Registry
  • Pimp My Search
  • Relationship with Wikipedia
  • Sensorvault
  • Stanford Digital Library Project
  • Category
  • Commons
  • Outline
  • WikiProject

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Google_JAX&oldid=1228905221"

    Categories: 
    Machine learning
    Google
    Hidden categories: 
    CS1 errors: missing title
    CS1 errors: bare URL
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 13 June 2024, at 21:25 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki