kaushalya / jax_playground Goto Github PK
View Code? Open in Web Editor NEWPure-functional neural networks in JAX
Pure-functional neural networks in JAX
coremltools currently supports conversion from Tensorflow and PyTorch. As an alternative, we can convert JAX models to Tensorflow using jax2tf and then convert the generated Tensorflow model into coreml using coremltools
.
Known issues:
coremltools
and Apple Silicon devices.Device: M2 Max
Library versions
jax: 0.4.20
jaxlib: 0.4.20
jax-metal: 0.0.5
Decoder-only transformer with rotary positional embedding (RoPE) doesn't work on Apple Silicon device with jax-metal. The model generates gibberish text.
Looks like einsum
and einops
are not supported yet. It works fine when learned positional embeddings are used as it doesn't use einops
.
On Apple M2 Max with jax-metal plugin:
Metal device set to: Apple M2 Max
systemMemory: 64.00 GB
maxCacheSize: 24.00 GB
Devices: [METAL(id=0)]
Using rope embeddings: True
Loading Tiny Shakespeare dataset...
Loaded Tiny Shakespeare dataset
Loading model parameters from: /Users/kaushalya/code/jax_playground/artifacts/transformer_model:v3/transformer_epoch_100.pkl
Generating text...
fhzzzzzzzU?xfzzDzn.HLKxU-!zUzzBk?N'AEMPJzizhYk;VzD
The same model generates sensible output on CUDA devices.
Devices: [cuda(id=0), cuda(id=1)]
Using rope embeddings: True
Loading Tiny Shakespeare dataset...
Loaded Tiny Shakespeare dataset
Loading model parameters from: models/transformer_rope_epoch_100.pkl
Generating text...
you not to see your grace above and well,
Gaunt t
Paper: "RoFormer: Enhanced Transformer with Rotary Position Embedding" Arxiv, 2021
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.