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 CUDA Graphs #68

Closed
wants to merge 25 commits into from
Closed

Support CUDA Graphs #68

wants to merge 25 commits into from

Conversation

raimis
Copy link
Contributor

@raimis raimis commented Feb 24, 2022

Inspired by the significant performance increase with CUDA Graphs (torchmd/torchmd-net#48 (comment)), this PR implemented the support of CUDA Graphs to accelerate PyTorch models (https://pytorch.org/blog/accelerating-pytorch-with-cuda-graphs/).

  • Separate the graphable operations
  • Make the input and output tensors persistent
  • Capture the graph
  • Expose an option to enable the graph
  • Serialize the options
  • Conditionally build for the old PyTorch version without the support of CUDA Graphs
  • Add tests
  • Update documentation

@raimis raimis added the enhancement New feature or request label Feb 24, 2022
@raimis raimis self-assigned this Feb 24, 2022
@raimis
Copy link
Contributor Author

raimis commented Mar 10, 2022

@peastman I need your opinion.

We need to extend the API for platform-specific options, e.g. the usage of CUDA Graphs.

My proposal is to add a simple dictionary-style API:

TorchForce.getPropertyValue(name: str) -> str
TorchForce.setPropertyValue(name: str, value: str)

For convenience, the constructor can accept a dictionary directly:

TorchForce(filename: str, options: Optional[Dict[str, str]] = None)

The names and values are checked when a platform-specific CalcTorchForceKernel is initialized.

@peastman
Copy link
Member

That sounds reasonable.

@raimis
Copy link
Contributor Author

raimis commented Apr 14, 2023

Deprecated by #103

@raimis raimis closed this Apr 14, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants