63 Commits

Author SHA1 Message Date
Skye Wanderman-Milne
2fcf3f7270 Remove .[minimum-jaxlib] from test-requirements.txt
This means that jax and its dependencies (e.g. jaxlib) must be
manually installed before running the tests. This is useful for
testing an existing jax install, e.g. a later version of jaxlib, GPU
jaxlib, etc.
2021-09-23 12:24:24 -07:00
Yash Katariya
19d7710d35 Remove the last long running CI build from github actions which is being replaced by internal infra build.
PiperOrigin-RevId: 394694532
2021-09-03 09:04:10 -07:00
Yash Katariya
b31293f743 Replace github action test with test running on internal infra. Also replace JAX_NUM_GENERATED_CASES to 1 for test with 3.8 and test with numpy dispatch tests to reduce the build time.
PiperOrigin-RevId: 394531539
2021-09-02 13:35:19 -07:00
jax authors
d349086ca5 Merge pull request #7683 from google:dependabot/github_actions/pre-commit/action-2.0.3
PiperOrigin-RevId: 392098389
2021-08-20 17:17:02 -07:00
dependabot[bot]
60f025dd41
Bump pre-commit/action from 2.0.0 to 2.0.3
Bumps [pre-commit/action](https://github.com/pre-commit/action) from 2.0.0 to 2.0.3.
- [Release notes](https://github.com/pre-commit/action/releases)
- [Commits](https://github.com/pre-commit/action/compare/v2.0.0...v2.0.3)

---
updated-dependencies:
- dependency-name: pre-commit/action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 20:59:50 +00:00
dependabot[bot]
050cce0358
Bump styfle/cancel-workflow-action from 0.8.0 to 0.9.1
Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.8.0 to 0.9.1.
- [Release notes](https://github.com/styfle/cancel-workflow-action/releases)
- [Commits](https://github.com/styfle/cancel-workflow-action/compare/0.8.0...0.9.1)

---
updated-dependencies:
- dependency-name: styfle/cancel-workflow-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 20:59:48 +00:00
Matthieu MOREL
6a360e9684
Update dependabot.yml 2021-08-19 20:21:16 +02:00
Matthieu MOREL
952bd03f20
chore(ci) : setup dependabot
Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
2021-08-19 20:17:45 +02:00
Yash Katariya
f729f7ea1f Replace py3.8 build with JAX_NUM_GENERATED_CASES=25 with JAX_NUM_GENERATED_CASES=10.
JAX_NUM_GENERATED_CASES=25 is now using kokoro with py3.9 `CPU` which is 4x faster than the github action.

Since py3.8 build with JAX_NUM_GENERATED_CASES=25 on github action is the slowest build, this should give an improvement of 10 minutes overall since the second slowest build is 10 mins faster than the above one.

But moving py3.8 build (Github actions) with JAX_NUM_GENERATED_CASES=25 to Kokoro (JAX_NUM_GENERATED_CASES=25 and py3.9 and `CPU`) gives a `4x` speedup (testing time).
Overall kokoro time is around 11 mins. So its a `2.5x` speedup overall.

Github actions:

```
=============== 23033 passed, 2033 skipped in 1727.43s (0:28:47) ===============
```

Kokoro:

```
=============== 22877 passed, 2065 skipped in 446.36s (0:07:26) ================

Total kokoro time = 11 mins. So 2.5x speedup overall.
```

PiperOrigin-RevId: 390656668
2021-08-13 11:33:39 -07:00
Peter Hawkins
6e9169d100 Drop support for NumPy 1.17. 2021-07-29 09:18:01 -04:00
Peter Hawkins
94446ff757 Drop Python 3.6 support.
Per the deprecation policy (https://jax.readthedocs.io/en/latest/deprecation.html),
Python 3.6 support has been due for removal since June 23, 2020.
2021-07-15 14:20:29 -04:00
Qiao Zhang
0216a317a0 Change test matrix to use latest jaxlib release. 2021-07-12 15:04:10 -07:00
George Necula
6a48c60a72 Rename master to main in embedded links.
Tried to avoid the change on external links to repos that
have not yet renamed master.
2021-06-18 10:00:01 +03:00
George Necula
a6c16119c9 Renaming master to main: step 1.
Here we just enable the GitHub actions to run on both master and main.
2021-06-17 14:25:01 +03:00
Peter Hawkins
b130257ee1 Drop support for NumPy 1.16. 2021-06-11 09:03:09 -04:00
Peter Hawkins
f07ccf0074 Use short tracebacks in CI builds.
Often useful information is hard to see in the GitHub UI with the default traceback verbosity of pytest.
2021-05-26 13:43:38 -04:00
Jake VanderPlas
ed66dd4d57 CI: test Python 3.9 with numpy dispatch test 2021-05-17 10:10:52 -07:00
Peter Hawkins
aea068ed84 Reenable numpy dispatch tests. 2021-05-11 09:12:06 -04:00
Lukas Geiger
78ea235ac7 CI: Install wheel pkg to improve pip-cache 2021-04-16 02:55:41 +02:00
Peter Hawkins
3861da4ffc Remove omnistaging references in CI build config. 2021-04-09 15:44:18 -04:00
Jake VanderPlas
cee3af580b Testing: avoid global fixture for doctests 2021-04-08 12:11:14 -07:00
Jake VanderPlas
8e789c7380 Run doctest on all source files except jax2tf 2021-04-05 10:39:59 -07:00
George Necula
7c4e26af8c Rename GitHub workflow "without omnistaging" to "with 3.7"
PiperOrigin-RevId: 366267935
2021-04-01 09:34:42 -07:00
Jake VanderPlas
8f40b68cc6 CI: quick fix for disable omnistaging test 2021-03-25 14:30:22 -07:00
Jake VanderPlas
01ee29cf88 CI: fix broken package-overrides check 2021-03-16 16:48:49 -07:00
Jake VanderPlas
60dcd0da61 Set reasonable timeouts for github actions jobs 2021-03-12 09:31:43 -08:00
Seth Vargo
9b7aa37a12
Update ci-build.yaml 2021-03-10 17:55:21 -05:00
Seth Vargo
1048ebb9fa
Update ci-build.yaml 2021-03-10 17:14:48 -05:00
Seth Vargo
e550dda8ba
Improve Actions hygiene
👋 hello there! I'm a fellow Googler who works on projects that leverage GitHub Actions for CI/CD. Recently I noticed a large increase in our queue time, and I've tracked it down to the [limit of 180 concurrent jobs](https://docs.github.com/en/actions/reference/usage-limits-billing-and-administration) for an organization. To help be better citizens, I'm proposing changes across a few repositories that will reduce GitHub Actions hours and consumption. I hope these changes are reasonable and I'm happy to talk through them in more detail.

- **(you were already doing this, thank you!**) Only run GitHub Actions for pushes and PRs against the main branch of the repository. If your team uses a forking model, this change will not affect you. If your team pushes branches to the repository directly, this changes actions to only run against the primary branches or if you open a Pull Request against a primary branch.

- For long-running jobs (especially tests), I added the "Cancel previous" workflow. This is very helpful to prevent a large queue backlog when you are doing rapid development and pushing multiple commits. Without this, GitHub Actions' default behavior is to run all actions on all commits.

There are other changes you could make, depending on your project (but I'm not an expert):

- If you have tests that should only run when a subset of code changes, consider gating your workflow to particular file paths. For example, we have some jobs that do Terraform linting, but [they only run when Terraform files are changed](c4f59fee71/.github/workflows/terraform.yml (L3-L11)).

Hopefully these changes are not too controversial and also hopefully you can see how this would reduce actions consumption to be good citizens to fellow Googlers. If you have any questions, feel free to respond here or ping me on chat. Thank you!
2021-03-10 16:26:01 -05:00
Jake VanderPlas
12c84e7a50 Add jax.errors submodule & error troubleshooting docs 2021-03-03 12:39:12 -08:00
Jake VanderPlas
ecdef1f6e0 Add github issue templates to direct users in the right direction 2021-02-23 13:55:38 -08:00
Jake VanderPlas
9513a7d45a Remove pandoc & nbsphinx references 2021-02-16 10:42:16 -08:00
Jake VanderPlas
e159d67e7e Move flake8 & mypy checks to pre-commit 2021-02-10 13:44:40 -08:00
Jake VanderPlas
6eedadc27f DOC: use jupytext to maintain synced markdown versions of notebooks. 2021-02-10 12:23:07 -08:00
Jake VanderPlas
6f161bf49c CI: use internal scipy when testing internal numpy 2021-02-05 13:37:25 -08:00
George Necula
f105517ea2 Fixed mypy type errors for numpy 1.20
Revert also previous changes that pinned numpy to 1.19.

One of the changes in numpy 1.20 is to add more type annotations.
However, this sometimes make mypy give errors. A common example is
numpy.take, which with the new type annotation does not appear to
mypy as indexable.

Another change is that np.int and np.bool are deprecated. One
should use np.bool_ or np.int_, or the built-ins bool and int.
2021-02-05 10:40:47 +02:00
Peter Hawkins
a2df1a3cc5
Revert "run CI pytest in verbose mode" 2021-02-01 19:56:05 -05:00
George Necula
cefab2ca5d Disable the "with numpy-dispatch" test action.
As numpy 1.20 was released recently, and triggers some errors
in the GitHub CI, we pin numpy to 1.19. It seems that we still
get failures when trying to import numpy-dispatch. We
disable it until we figure out the problem.
2021-01-31 17:10:14 +02:00
Roy Frostig
db2298fa6b run CI pytest in verbose mode 2021-01-27 16:57:49 -08:00
Jake VanderPlas
0f76882bea CI: use python 3.9 for numpy dispatch tests 2021-01-15 13:49:27 -08:00
Jake VanderPlas
5959fa9ccf Run main test suite under Python 3.8 2020-12-30 13:20:13 -08:00
Roy Frostig
3e74f725b2 more readable CI action names 2020-12-23 17:10:15 -08:00
Roy Frostig
fd39901adc reduce test-case count of the numpy-dispatch CI check, to match our other x64-mode CI check 2020-10-01 15:00:38 -07:00
Matthew Johnson
2678a4647a
omnistaging on by default (#4038) 2020-09-15 08:06:46 -07:00
Stephan Hoyer
decd760020
Add experimental __array_module__ method (#4076)
* Add experimental __array_module__ method

xref https://github.com/google/jax/issues/1565

`__array_module__` (see [NEP 37](https://numpy.org/neps/nep-0037-array-module.html))
is an experimental alternative to `__array_function__` and `__array_ufunc__`
for "duck array" compatibility with NumPy that promises to be much less
invasive.

Example usage:

```python
import numpy as np

def duckarray_stack(arrays):
    """This "stack" function should work with any array library, including JAX."""
    npx = np.get_array_module(*arrays)
    arrays = [npx.asarray(arr) for arr in arrays]
    shapes = {arr.shape for arr in arrays}
    if len(shapes) != 1:
        raise ValueError('all input arrays must have the same shape')
    expanded_arrays = [arr[npx.newaxis, ...] for arr in arrays]
    return npx.concatenate(expanded_arrays, axis=0)
```

Support for this protocol has *not* yet been implemented in NumPy, but it can
be tested with https://github.com/seberg/numpy-dispatch.

My reasoning for merging it into JAX (on an experimental basis with no
guarantees, of course) is that:

1. It's not invasive -- the implementation is small and self-contained.
2. No backwards compatibility issues. Unlike `__array_function__` and
   `__array_ufunc__`, `__array_module__` will always require an explicit
   opt-in by libraries that use it by calling `get_array_module()`.
2. Other NumPy developers
   [want evidence](https://github.com/numpy/numpy/pull/16935#issuecomment-673951287)
   that this is actually feasible.
3. Scikit-Learn developers like @thomasjpfan are interested in exploring
   supporting scikit-learn on top of NumPy-like libraries like JAX, and
   experimental support for this protocol will make that easier.

Note: this PR does add `numpy-dispatch` as a optional testing requirement in
order to verify that this works. If desired, we could remove this from CI, but
installing numpy-dispatch (and its build requirement Cython) appears to only
add a few seconds of build time.

* don't explicitly list cython

* remove UnshpaedArray from _JAX_ARRAY_TYPES

* Remove incorrect note about metaclasses

* remove unnecessary numpy_dispatch.ensure_dispatching()
2020-08-18 09:40:57 -07:00
George Necula
0b99ca896d
[jax2tf] Disable the CI tests for jax2tf. (#4019)
We do this to see if this reduces the incidence of errors fetching
the tf-nightly package. These tests are being run when we import
the code in Google.
2020-08-11 12:39:54 +03:00
Jake Vanderplas
481b6f1508
github actions: cache pypi dependencies (#3990) 2020-08-07 11:28:03 -07:00
Matthew Johnson
4236eb2b59
omnistaging, under a flag and disabled by default (#3370)
This change, when enabled, stages out all primitive calls in the dynamic
scope of a jitted, pmapped, or control flow function, rather than only
staging out based on data dependence. One improvement is that jitted
functions can consume less memory, by avoiding instantiating large
constants at trace time, and cause less memory fragmentation as well. It
also simplifies several internals.

See https://github.com/google/jax/pull/3370 fo more information.
2020-07-30 12:59:36 -07:00
Jake Vanderplas
5c674cf850
Properly set X64 flag in github actions (#3854)
This allows the github actions CI to actually exercise tests with jax_enable_x64.
2020-07-24 15:03:48 -07:00
George Necula
4f3011f320
Refactored host_callback to use the C++ runtime. (#3644)
* Refactored host_callback to use the C++ runtime.

* The new runtime makes it unnecessary to start the outfeed_receiver
  in the user's code
* We don't need msgpack anymore
* There is an interaction between host_callback and using lax.outfeed.
  I am trying to solve this by (a) making host_callback_test stop the
  outfeed receiver on finish and infeed_test on start, and (b)
  telling pytest-xdist to run all the tests from one file into
  a single worker.
2020-07-04 18:12:58 +03:00