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

Features/343 qr #429

Merged
merged 202 commits into from
Mar 6, 2020
Merged

Features/343 qr #429

merged 202 commits into from
Mar 6, 2020

Conversation

coquelin77
Copy link
Member

@coquelin77 coquelin77 commented Dec 9, 2019

Description

Please include a summary of the change and which issue/s is/are fixed.
Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes: #343

Changes proposed

  • added tiling class
  • added tiles property to DNDarray
  • implemented QR factorization
  • abstracted the c_block_setter function from matmul
  • reorder functions in DNDarray

Type of change

-> New feature (non-breaking change which adds functionality)

Are all split configurations tested and accounted for?
[x] yes [ ] no
Does this change require a documentation update outside of the changes proposed?
[ ] yes [x] no
Does this change modify the behaviour of other functions?
[ ] yes [x] no
Are there code practices which require justification?
[x] yes [ ] no
-> There are multiple instances of >3 indentations here. Very often this occurs because of rank selection.

coquelin77 added 30 commits July 23, 2019 12:47
setting loop would sometimes try to set elements which were beyond the shape given
simple fix was try except, possible cleaner fix with different logic but this should suffice
outline of qr working. need to implement:
- remainder handling in binary reduction step
- bug in multiple tile/process code (not working)
- ATM this is only split=0
@codecov
Copy link

codecov bot commented Feb 19, 2020

Codecov Report

Merging #429 into master will decrease coverage by 0.17%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #429      +/-   ##
=========================================
- Coverage   96.77%   96.6%   -0.18%     
=========================================
  Files          63      65       +2     
  Lines       12872   13991    +1119     
=========================================
+ Hits        12457   13516    +1059     
- Misses        415     475      +60
Impacted Files Coverage Δ
heat/core/__init__.py 100% <100%> (ø) ⬆️
heat/core/tests/test_communication.py 97.2% <100%> (ø) ⬆️
heat/core/tests/test_tiling.py 100% <100%> (ø)
heat/core/communication.py 89.04% <100%> (+0.06%) ⬆️
heat/core/tests/test_linalg.py 96.29% <71.27%> (-3.06%) ⬇️
heat/core/dndarray.py 96.59% <95%> (-0.11%) ⬇️
heat/core/linalg.py 96.23% <95.34%> (-0.9%) ⬇️
heat/core/tiling.py 96.28% <96.28%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b438d2...96649c9. Read the comment docs.

@coquelin77
Copy link
Member Author

I ran the tests successful with 1 to 8 GPUs and CPUs. I have also included an extended tests feature for QR. the loops for this equate to the following:

st_whole = torch.randn(70, 70, device=device)
for sp in range(0, 1):
        for m in range(50, 71, 1):
            for n in range(50, 71, 1):
                for t in range(1, 3):
                    st = st_whole[:m, :n].clone()
                    a_comp = ht.array(st, split=0, device=ht_device)
                    a = ht.array(st, split=sp, device=ht_device)
                    qr = a.qr(tiles_per_proc=t)
                    self.assertTrue(ht.allclose(a_comp, qr.Q @ qr.R, rtol=1e-5, atol=1e-5))
                    self.assertTrue(
                        ht.allclose(
                            qr.Q.T @ qr.Q, ht.eye(m, device=ht_device), rtol=1e-5, atol=1e-5
                        )
                    )
                    self.assertTrue(
                        ht.allclose(
                            ht.eye(m, device=ht_device), qr.Q @ qr.Q.T, rtol=1e-5, atol=1e-5
                        )
                    )

there tests were successfully run on 4,7, and 8 GPUs and CPUs, however they do take about 100x as long. I have successfully run the extended tests for range(30, 100) as well; the change to range(50, 71) was made to reduce the time required. To activate these tests one must add EXTENDED_TESTS=True before the command starting the tests. It is the same syntax as the DEVICE parameter as implemented by @mtar for running the tests on GPUs. As these functions have been shown to work, I propose that they be merged in 2 weeks provided that there are no objections.

@coquelin77 coquelin77 merged commit 607fd83 into master Mar 6, 2020
@coquelin77 coquelin77 deleted the features/343-QR branch March 6, 2020 11:11
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.

Implement QR decomposition
1 participant