Skip to content

Commit

Permalink
Add Lux.jl integration with Jax (#27)
Browse files Browse the repository at this point in the history
* basic support for Lux + Jax

* update version

* add mixed example as well

* fix some typos

* make sure only positive seeds

* rename to allow more wrappers for other jax frameworks
  • Loading branch information
rejuvyesh committed Jul 5, 2022
1 parent d860efc commit 6f88d0e
Show file tree
Hide file tree
Showing 8 changed files with 664 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PyCallChainRules"
uuid = "b12ccfe2-7326-416f-9f4f-cd3183bd9fe8"
authors = ["rejuvyesh <mail@rejuvyesh.com> and contributors"]
version = "0.3.2"
version = "0.4.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -28,6 +28,7 @@ julia = "1.6"
[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ loss(p, x, y) = sum(jlwrap(p, x) .- y)
grad, = Zygote.gradient(p->loss(p, input, target), params_jl)
```

When mixing `jax` and `julia` it's recommended to disable `jax`'s preallocation with setting the environment variable `XLA_PYTHON_CLIENT_PREALLOCATE=false`.

## Current Limitations

Expand Down
Loading

2 comments on commit 6f88d0e

@rejuvyesh
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Add integration and example usage with Lux.jl and jax.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/63660

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.0 -m "<description of version>" 6f88d0e23d73f77e86efddefe310932df80d9552
git push origin v0.4.0

Please sign in to comment.