🔒 3 more in the full analysis
🔒 3 more in the full analysis
Searchable transcript of From notebook to production: Serving JAX at scale — Google Cloud Tech (03:05). Search for a phrase, then click its timestamp to jump straight to that moment in the video.
Captions sourced from the original video on YouTube, published by Google Cloud Tech. The video, its captions and all related intellectual property remain the property of their respective owners; AINotes claims no ownership. Provided for research, accessibility and search — see the Transcript Notice and Copyright Policy.
00:00 A model that works in a notebook can still underperform when you serve it. The first user asks for a prediction and the server goes into a long compilation who pays the compile cost. >> In the last video, we saved a train transformer checkpoint. Now we rebuild the model structure, load the orbox parameters and place them on the serving device. >> There are different patterns you can consider.
00:25 Jax G for a Python service. Hi head of time compile for startup time compilation. Jax export for portable Jax artifacts and JAX 2TF when the serving stack is TensorFlow based. >> First Jaxjit is the simplest in process pass. It's great for Python service but the first call may compile. Consider warming it up before real traffic. Second option is ahead of time compilation which makes the stage explicit.
00:58 Lower produce stable HLO and compile produces the executable. Then server calls execute without the first call compile spike. >> Stable HLO is not a new model. It's the lowest program the compiler sees. You inspect it when you need to debug or confirm what got staged. >> [music] >> Batch size is still a thing to consider. New shapes may compile separately, but larger batches can improve tokens per second by a mortisizing overhead.
01:29 Same shape lesson we share before, but now at a second time. Third option is Jax export which serializes a stable HLO based artifact. The notebook writes it, reads it back, calls it and checks that predictions match. If your platform speaks Jax runtime, this is the portable route. >> Fourth and last option is Jax 2TF for TensorFlow infrastructure. If the serving stack expects a save model, convert with native serialization and save the standard TF artifact.
02:09 To wrap up, choose by deployment target, Python service, AOTJ runtime, portable JAX artifact or TensorFlow serving stack. The checkpoint is the same but the serving wrapper changes. >> So to conclude, in the whole course we had one mental model J traces, XLA compiles and the Nvidia stack runs. When something surprises you, keep in mind these four layers and start your investigation.
02:40 >> Don't forget to verify the GPU stabilized [music] shapes. Time is blocking profile before guessing and avoid accidental host transfers. >> And that's it. This is the path from your first GPU chuck to serving a Jax model on GPU. >> Now go make your GPU busy.