Skip to content

Fix: Correct input type for pyhpc_equation_of_state in Torch_XLA2 #17

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ayshiff
Copy link

@ayshiff ayshiff commented Jan 22, 2025

Converts the example input list to a tuple before passing it to torch.func.functional_call to resolve the argument type mismatch.

Tested with: python models/pyhpc_equation_of_state.py

Fixes pytorch/xla#8164

Converts the example input list to a tuple before passing it to torch.func.functional_call to resolve argument type mismatch.
@ayshiff
Copy link
Author

ayshiff commented Jan 24, 2025

JAX_PLATFORMS=cpu python models/pyhpc_equation_of_state.py

[XLATensor2(..., device='meta', size=(204, 204, 26), dtype=torch.float64), XLATensor2(..., device='meta', size=(204, 204, 26), dtype=torch.float64), XLATensor2(..., device='meta', size=(1, 1, 26), dtype=torch.float64)]
Eager mode time 0.7211941659988952
Eager max abs vs expected tensor(0.0720, dtype=torch.float64)
Jitted mode time 0.24614562499846215
Jitted max abs vs expected tensor(0.0720, dtype=torch.float64)

@ayshiff
Copy link
Author

ayshiff commented Jan 25, 2025

cc @ManfeiBai

Copy link
Collaborator

@ManfeiBai ManfeiBai left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

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.

Model support for pyhpc_equation_of_state with Torch_XLA2
2 participants