Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run on Lithops AWS #7

Merged
merged 3 commits into from
Mar 4, 2024
Merged

Run on Lithops AWS #7

merged 3 commits into from
Mar 4, 2024

Conversation

tomwhite
Copy link
Member

@tomwhite tomwhite commented Mar 4, 2024

  • Update test to use Xarray
  • Write test data to Zarr files and delete at end (outside of timing context)
  • Add a config file for running on Lithops AWS (commented out for the moment)

I had to install the following packages (Xarray is pinned due to namedarray changes):

pip install pytest-xdist filelock 'xarray==2023.10.0' cubed_xarray lithops rich pydot s3fs

Then I could run some tests on Lithops:

pytest --benchmark -s 'tests/benchmarks/test_array.py::test_quadratic_means_xarray[configs/lithops_aws.yaml-50]'
pytest --benchmark -s 'tests/benchmarks/test_array.py::test_quadratic_means_xarray[configs/lithops_aws.yaml-500]'
pytest --benchmark -s 'tests/benchmarks/test_array.py::test_quadratic_means_xarray[configs/lithops_aws.yaml-5000]'

Note that Pytest -s option enables the Cubed's Rich progress bars, which is helpful when running a computation interactively.

$ duckdb benchmark.db
D select name, duration from test_run where name like '%lithops%';
┌────────────────────────────────────────────────────────────┬────────────────────┐
│                            name                            │      duration      │
│                          varchar                           │       double       │
├────────────────────────────────────────────────────────────┼────────────────────┤
│ test_quadratic_means_xarray[configs/lithops_aws.yaml-50]   │  34.91558289527893 │
│ test_quadratic_means_xarray[configs/lithops_aws.yaml-500]  │ 56.183167934417725 │
│ test_quadratic_means_xarray[configs/lithops_aws.yaml-5000] │  66.49491095542908 │
└────────────────────────────────────────────────────────────┴────────────────────┘

@@ -2,7 +2,7 @@ channels:
- conda-forge
dependencies:

- python >=3.9
- python >=3.9,<=3.11
Copy link
Member Author

Choose a reason for hiding this comment

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

Lithops doesn't run on 3.12 yet.


cubed.visualize(
*(result[var].data for var in ("anom_u", "anom_v", "uv")),
filename=tmp_path / f"quadratic_means_xarray_{t_length}-unoptimized",
Copy link
Member Author

Choose a reason for hiding this comment

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

Writes to pytest's temp directory

@TomNicholas
Copy link
Contributor

Wait 66 seconds for t_length=5000?! That's the same as the 150GB job in the blog post notebook, which previously took 11 minutes!

Copy link
Contributor

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

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

Looks great!

Xarray is pinned due to namedarray changes

I can go and look into this

@tomwhite
Copy link
Member Author

tomwhite commented Mar 4, 2024

Wait 66 seconds for t_length=5000?! That's the same as the 150GB job in the blog post notebook, which previously took 11 minutes!

That's right. This is running on AWS though - I have noticed that GCP can be several times slower (I dont know why), but still a lot faster than when you first ran the benchmarks.

@tomwhite
Copy link
Member Author

tomwhite commented Mar 4, 2024

I can go and look into this

Thanks!

@tomwhite tomwhite merged commit 1af148e into main Mar 4, 2024
@tomwhite tomwhite deleted the lithops-aws branch March 4, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants