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

[Backport] Introduce jax_import_guard #6794

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Conversation

alanwaketan
Copy link
Collaborator

Summary:
Importing JAX will lock the TPU devices and prevent any pytorxh/xla's TPU computations. To address it, we need to acquire the TPU first. Somehow xm.xla_device() is enough to acquire the TPU device.

Test Plan:
python test/test_pallas.py

Fix linters

Fix comment

Move JAX import into make_kernel_from_pallas and use _init_computation_client

Guard JAX import for TPU tests only

Fix linters

Fix cpu/gpu ci
@alanwaketan alanwaketan requested a review from lsy323 March 21, 2024 03:19
@alanwaketan alanwaketan changed the title [Pallas] Introduce jax_import_guard [Backport] Introduce jax_import_guard Mar 21, 2024
@alanwaketan
Copy link
Collaborator Author

Thanks, Jack!

@alanwaketan alanwaketan merged commit c3001d6 into r2.3 Mar 21, 2024
17 checks passed
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.

2 participants