C.W.K.
Stream
Lesson 04 of 05 · published

TF and JAX — Google's Two Frameworks

~11 min · jax, convergence, stablehlo

Level 0Level 0
0 XP0/78 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

Why Google maintains two frameworks (and what it means for you)

Google maintains two major ML frameworks: TensorFlow (2015) and JAX (2018). Understanding the difference is essential context for anyone working in the TF ecosystem in 2026.

DimensionTensorFlowJAX
ParadigmOO, statefulFunctional, pure functions
Model stateObject attributesExplicit pytrees
Key opstf.function, GradientTapejit, grad, vmap, pmap
Random numbersGlobal RNGExplicit PRNG key splitting
Debug experienceGood (eager default)Hard under jit
TPU performanceGood (via XLA)Best-in-class
Production deploymentExcellent (Serving, TFLite, TF.js)Hard (needs jax2tf bridge)

Google's frontier LLMs (Gemini, PaLM 2, Gemma) are trained in JAX. TensorFlow remains dominant for production serving and mobile deployment. The interoperability bridge is jax2tf — convert JAX functions to TF for TF Serving / TFLite deployment.

The bigger picture: TF, JAX, and PyTorch are converging on StableHLO as a common intermediate representation for XLA hardware. Long term, the framework you write in matters less than the deployment target — Keras 3 is the most visible part of this convergence.

Code

jax2tf — JAX 함수를 TF SavedModel로·python
from jax.experimental import jax2tf
import jax.numpy as jnp
import tensorflow as tf

def jax_model(x):
    return jnp.sin(jnp.cos(x))

# Convert JAX function to TF (for TF Serving / TFLite)
tf_model = jax2tf.convert(jax_model)
result = tf_model(tf.constant([1.0, 2.0]))

# Export as TF SavedModel from JAX training
tf_func = tf.function(tf_model, autograph=False)
module   = tf.Module()
module.f = tf_func
tf.saved_model.save(module, "/tmp/jax_as_tf_saved_model")

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.