Glossary term
Glossary term
Foundations
A function whose outputs are based only on its inputs, and that has no side effects. Specifically, a pure function doesn't use or change any global state, such as the contents of a file or the value of a variable outside the function.
Pure functions can be used to create thread-safe code, which is beneficial when sharding model code across multiple accelerator chips.
JAX's function transformation methods require that the input functions are pure functions.
Q
Created for this library
A research engineer expresses model components as pure functions in JAX so they can be transformed with jit, grad, and vmap cleanly.
An ML team writes data transformations as pure functions so they can be tested in isolation without managing shared state.
An ML platform team adopts pure-function patterns in its training code so reproducibility and parallelism stay tractable.
Definition source: Google for Developers Machine Learning Glossary | Creative Commons Attribution 4.0 License