From 3302a44512c906b860437214fd37361dcbf5a280 Mon Sep 17 00:00:00 2001 From: Claudia Comito <39374113+ClaudiaComito@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:49:09 +0100 Subject: [PATCH] Merge release v1.3.1 into `main` (#1278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * copy from fix/1168-update-docker-image-and-documentation-on-release13x-and-main * corrected bug * docker scripts documentation * Fix tzdata handling and merging multiple actions The copy of tzdata was originally intended to be used from the root of the repository. The documentation states building docker images from the docker directory. This had to be aligned. Moreover, each RUN line in a Dockerfile represents the building of another intermediate image. This has to be taken into account when writing the files. Commands such as "cd" will not work on separate lines. * update pre-commit-config * Fix Pytorch release tracking workflows (#1264) * upgrade checkout action & use default token * increase tolerance for single-prec torch.inv comparison * fix typo --------- Co-authored-by: Claudia Comito <39374113+ClaudiaComito@users.noreply.github.com> * Fix `ht.diff` for 1-element-axis edge case (#1201) * fix diff axis size one * fix diff() axis along split * remove debug code --------- Co-authored-by: Claudia Comito <39374113+ClaudiaComito@users.noreply.github.com> * update version to 1.3.1 before release * revert * Update version before release (#1274) * update version to 1.3.1 before release * revert * update version before release * update version to dev, update changelog --------- Co-authored-by: Gutiérrez Hermosillo Muriedas, Juan Pedro Co-authored-by: Hoppe Co-authored-by: Bjoern Hagemeier Co-authored-by: Michael Tarnawa Co-authored-by: Fabian Hoppe <112093564+mrfh92@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++++ heat/core/arithmetics.py | 6 ++++-- heat/core/tests/test_arithmetics.py | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89f1857715..ee2e6c9a3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +# v1.3.1 - Bug fixes, Docker documentation update + +## Bug fixes +- #1259 Bug-fix for `ht.regression.Lasso()` on GPU (by @mrfh92) +- #1201 Fix `ht.diff` for 1-element-axis edge case (by @mtar) + +## Changes + +### Interoperability + +- #1257 Docker release 1.3.x update (by @JuanPedroGHM) + +### Maintenance + +- #1274 Update version before release (by @ClaudiaComito) +- #1267 Unit tests: Increase tolerance for `ht.allclose` on `ht.inv` operations for all torch versions (by @ClaudiaComito) +- #1266 Sync `pre-commit` configuration with `main` branch (by @ClaudiaComito) +- #1264 Fix Pytorch release tracking workflows (by @mtar) +- #1234 Update sphinx package requirements (by @mtar) +- #1187 Create configuration file for Read the Docs (by @mtar) + # v1.3.0 - Scalable SVD, GSoC`22 contributions, Docker image, PyTorch 2 support, AMD GPUs acceleration This release includes many important updates (see below). We particularly would like to thank our enthusiastic [GSoC2022](https://summerofcode.withgoogle.com/programs/2022) / tentative GSoC2023 contributors @Mystic-Slice @neosunhan @Sai-Suraj-27 @shahpratham @AsRaNi1 @Ishaan-Chandak 🙏🏼 Thank you so much! diff --git a/heat/core/arithmetics.py b/heat/core/arithmetics.py index a38f10c3a2..eed92c58c9 100644 --- a/heat/core/arithmetics.py +++ b/heat/core/arithmetics.py @@ -538,7 +538,8 @@ def diff( # build the slice for the first element on the specified axis arb_slice = [slice(None)] * len(a.shape) - arb_slice[axis] = 0 + if ret.lshape[axis] > 0: + arb_slice[axis] = 0 # send the first element of the array to rank - 1 if rank > 0: snd = ret.comm.Isend(ret.lloc[arb_slice].clone(), dest=rank - 1, tag=rank) @@ -554,7 +555,8 @@ def diff( if rank < size - 1: cr_slice = [slice(None)] * len(a.shape) # slice of 1 element in the selected axis for the shape creation - cr_slice[axis] = 1 + if ret.lshape[axis] > 1: + cr_slice[axis] = 1 recv_data = torch.ones( ret.lloc[cr_slice].shape, dtype=ret.dtype.torch_type(), device=a.device.torch_device ) diff --git a/heat/core/tests/test_arithmetics.py b/heat/core/tests/test_arithmetics.py index 7c2f9c8aa8..1c98da7f77 100644 --- a/heat/core/tests/test_arithmetics.py +++ b/heat/core/tests/test_arithmetics.py @@ -405,6 +405,15 @@ def test_diff(self): ht_diff = ht.diff(ht_array, n=0) self.assertTrue(ht.equal(ht_diff, ht_array)) + # edge cases + ht_arr = ht.ones((2, 1, 2), split=0) + ht_diff = ht.diff(ht_arr, axis=1) + self.assertEqual(ht_diff.gshape, (2, 0, 2)) + + ht_arr = ht.ones((2, 1, 2), split=1) + ht_diff = ht.diff(ht_arr, axis=1) + self.assertEqual(ht_diff.gshape, (2, 0, 2)) + # raises with self.assertRaises(ValueError): ht.diff(ht_array, n=-2)