GithubHelp home page GithubHelp logo

jax_playground's People

Contributors

kaushalya avatar

Stargazers

 avatar

Watchers

 avatar  avatar

jax_playground's Issues

Create CoreML models for Apple Silicon devices

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:

  • Only TF models a single concrete function can be converted to coreml.
  • All TF/JAX operations are not supported by coremltools and Apple Silicon devices.

RoPE embeddings are not working on Apple Silicon

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.