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

Support batched QR decomposition #1720

Merged
merged 11 commits into from
Dec 2, 2024
Merged

Conversation

mrfh92
Copy link
Collaborator

@mrfh92 mrfh92 commented Nov 14, 2024

Due Diligence

  • General:
  • Implementation:
    • unit tests: all split configurations tested
    • unit tests: multiple dtypes tested
    • benchmarks: created for new functionality
    • (within the error margin) benchmarks: performance improved or maintained
    • documentation updated where needed

Description

Batched QR

Issue/s resolved: necessary for #1696

Changes proposed:

ht.linalg.qr now is able to compute QR for batches of matrices, as PyTorch's batched linear algebra does

Type of change

(not really) new feature

Does this change modify the behaviour of other functions? If so, which?

yes (ht.linalg.qr)

@mrfh92 mrfh92 added linalg ESAPCA relevant for the ESA-funded project "ESAPCA" enhancement New feature or request benchmark PR labels Nov 14, 2024
@mrfh92 mrfh92 marked this pull request as ready for review November 14, 2024 16:51
Copy link
Contributor

Thank you for the PR!

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.21%. Comparing base (c23428e) to head (c8702a8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1720      +/-   ##
==========================================
- Coverage   92.21%   92.21%   -0.01%     
==========================================
  Files          83       83              
  Lines       12318    12316       -2     
==========================================
- Hits        11359    11357       -2     
  Misses        959      959              
Flag Coverage Δ
unit 92.21% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Thank you for the PR!

@JuanPedroGHM
Copy link
Member

Benchmarks results - Sponsored by perun

function mpi_ranks device metric value ref_value std % change type alert lower_quantile upper_quantile
matmul_split_0 4 CPU RUNTIME 0.13726 0.181238 0.0256314 -24.265 jump-detection True nan nan
apply_inplace_normalizer 4 CPU RUNTIME 0.00320091 0.00104532 0.00649931 206.213 jump-detection True nan nan
matmul_split_0 4 GPU RUNTIME 0.033585 0.0562632 0.0285393 -40.3074 jump-detection True nan nan
matmul_split_1 4 GPU RUNTIME 0.0259047 0.0343244 0.0123812 -24.5298 jump-detection True nan nan
concatenate 4 GPU RUNTIME 0.173058 0.142046 0.0596402 21.8327 jump-detection True nan nan
qr_split_1 4 CPU RUNTIME 0.197579 0.186863 0.0262833 5.73458 trend-deviation True 0.179407 0.196056
hierachical_svd_tol 4 CPU RUNTIME 0.0513506 0.0521396 0.000182696 -1.51317 trend-deviation True 0.0515701 0.0531136
reshape 4 CPU RUNTIME 0.155652 0.160234 0.00165965 -2.85945 trend-deviation True 0.156578 0.167456
resplit 4 CPU RUNTIME 1.07068 1.0918 0.00795151 -1.93423 trend-deviation True 1.0711 1.11149
apply_inplace_robust_scaler_and_inverse 4 CPU RUNTIME 2.36339 2.45182 0.0576843 -3.60671 trend-deviation True 2.38057 2.56004
matmul_split_0 4 GPU RUNTIME 0.033585 0.0501268 0.0285393 -33 trend-deviation True 0.0339485 0.0687051
lanczos 4 GPU RUNTIME 0.618193 0.595779 0.00583022 3.76207 trend-deviation True 0.581043 0.617789
hierachical_svd_tol 4 GPU RUNTIME 0.123252 0.119621 0.000163931 3.03512 trend-deviation True 0.117207 0.122445
kmeans 4 GPU RUNTIME 0.680437 0.646702 0.00515695 5.21645 trend-deviation True 0.623644 0.677172
apply_inplace_robust_scaler_and_inverse 4 GPU RUNTIME 6.21877 5.8251 0.0352397 6.75803 trend-deviation True 5.51667 6.17805

Grafana Dashboard
Last updated: 2024-11-15T08:33:51Z

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

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

Thanks a lot @mrfh92! I only have 2 tiny changes, otherwise it's ready as far as I can tell. 👍🏼

heat/core/linalg/qr.py Outdated Show resolved Hide resolved
heat/core/linalg/qr.py Outdated Show resolved Hide resolved
mrfh92 and others added 2 commits November 22, 2024 10:54
Co-authored-by: Claudia Comito <[email protected]>
remove dead code
Copy link
Contributor

Thank you for the PR!

1 similar comment
Copy link
Contributor

Thank you for the PR!

@mrfh92
Copy link
Collaborator Author

mrfh92 commented Nov 25, 2024

@JuanPedroGHM looks like the BM failed because the gitlab runner had to wait more than 01:30h for getting the job allocated. Is the cluster currently busy or out-of-order?

@mrfh92
Copy link
Collaborator Author

mrfh92 commented Nov 25, 2024

@ClaudiaComito I turned off the benchmark_pr as it does not work at the moment; except of that everything should be fine now (the previour run of the benchmark already has shown that there is no performance problem associated with the changes)

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

github-actions bot commented Dec 2, 2024

Thank you for the PR!

Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

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

Thanks again @mrfh92 !

@ClaudiaComito ClaudiaComito changed the title Features/1707 batched QR Support batched QR decomposition Dec 2, 2024
@ClaudiaComito ClaudiaComito merged commit e6499cf into main Dec 2, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ESAPCA relevant for the ESA-funded project "ESAPCA" linalg merge queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants