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

Generalized CUDA synchronize #28

Open
jaywonchung opened this issue Oct 16, 2023 · 0 comments
Open

Generalized CUDA synchronize #28

jaywonchung opened this issue Oct 16, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jaywonchung
Copy link
Member

PyTorch has torch.cuda.synchronize, which syncs CPU and GPU code execution. This is essential for accurate measurement. But there isn't one for JAX, which we do hope to support as first class in the future.

Right now we have some infrastructure for generalized CUDA synchronize in zeus.util.framework (

def cuda_sync(device: int | None = None) -> None:
), without JAX.
My current idea is to allow users to pass in a hook (Callable[[], None]) that does synchronization and default it to torch.cuda.synchronize. Then JAX users can pass in loss.block_until_ready as the synchronization hook, for example.

@jaywonchung jaywonchung added enhancement New feature or request good first issue Good for newcomers labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant