Skip to content

9080 expose mat mul precision#9081

Merged
yaoshiang merged 22 commits intomasterfrom
9080-expose-mat_mul_precision
May 9, 2025
Merged

9080 expose mat mul precision#9081
yaoshiang merged 22 commits intomasterfrom
9080-expose-mat_mul_precision

Conversation

@yaoshiang
Copy link
Copy Markdown
Collaborator

@yaoshiang yaoshiang commented May 2, 2025

I added a binding to get the mat mul precision to the init_python_bindings.cpp

I exposed it as a brand new module, torch_xla.backends. This is an ackward name but the goal is to eventually migrate this to torch.backends.xla, to parallel torch.backends.{cuda, cpu, mps, etc}.

I got advice from on very exact numerics for default (1 pass). I made estimates on the 3 pass and 6 pass technique.

I was careful to ensure that there was a non-zero delta from the torch64 cpu calculation - it's easy to make a mistake and end up with your "reference" math also be rounded.

I have a detailed guide on this coming after this PR goes in.

@yaoshiang yaoshiang linked an issue May 2, 2025 that may be closed by this pull request
@yaoshiang yaoshiang requested a review from qihqi May 2, 2025 19:02
Comment thread torch_xla/backends/__init__.py
Comment thread test/test_mat_mul_precision_highest.py Outdated
Comment thread test/test_mat_mul_precision_default.py Outdated
Comment thread torch_xla/backends/__init__.py Outdated
Comment thread test/test_mat_mul_precision_default.py Outdated
Comment thread test/test_mat_mul_precision_default.py Outdated
Comment thread test/test_mat_mul_precision_default.py Outdated
Comment thread test/test_mat_mul_precision.py Outdated
Comment thread test/test_utils.py Outdated
Comment thread test/test_mat_mul_precision.py
@yaoshiang yaoshiang merged commit 41c9913 into master May 9, 2025
24 checks passed
zhanyong-wan pushed a commit to zhanyong-wan/pytorch-xla that referenced this pull request May 9, 2025
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.

Expose mat_mul_precision

5 participants