Skip to content

Commit

Permalink
Merge branch 'main' into features/1097-Provide_Fast_Fourier_Transform…
Browse files Browse the repository at this point in the history
…_FFT
  • Loading branch information
ClaudiaComito authored Nov 24, 2023
2 parents 83c7b1a + 3302a44 commit e4409cb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
6 changes: 4 additions & 2 deletions heat/core/arithmetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
)
Expand Down
9 changes: 9 additions & 0 deletions heat/core/tests/test_arithmetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e4409cb

Please sign in to comment.