Skip to content

Migrate Python dynamics solver implementation to pybind11 #2853

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

Merged
merged 31 commits into from
May 21, 2025

Conversation

1tnguyen
Copy link
Collaborator

@1tnguyen 1tnguyen commented May 1, 2025

Description

Migrate dynamics evolve to C++

  • Remove operator conversion utility in Python. This is now completely handled in C++ via operator bindings.

  • Create bindings for time stepper, integrator, and expectation value calculator. Note: these bindings are for internal usage, i.e., not for end users. Python integrators (scipy/torch) are now using the C++ time stepper as well.

  • Refactor and clean up the CuDensityMatState class. Add support for distributed state.

@1tnguyen 1tnguyen force-pushed the tnguyen/dynamics-bindings branch from f85afc2 to bf694ff Compare May 7, 2025 01:56
- Make sure we do accumulate + scaling in a single cublas call

- Optimize tempory memory allocation with cuda mempool: we allocate
  quite a lot of temporary memory during the evolution hence make sure
to use mempool (as cupy does)

Signed-off-by: Thien Nguyen <[email protected]>
@1tnguyen 1tnguyen force-pushed the tnguyen/dynamics-bindings branch from bf694ff to 4774610 Compare May 7, 2025 02:14
1tnguyen and others added 8 commits May 7, 2025 06:40
dynamics solver involves many repetitive steps, hence, conventional
trace logging is not suitable. Adding a metric map, which tracks the
total time across many calls, e.g., to computeAction, to display
aggregated data.

Refactor the allocator into a helper class for better configurability.

Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
@1tnguyen 1tnguyen marked this pull request as ready for review May 12, 2025 05:01
@1tnguyen 1tnguyen changed the title [WIP] Migrate Python dynamics solver implementation to pybind11 Migrate Python dynamics solver implementation to pybind11 May 12, 2025
Signed-off-by: Thien Nguyen <[email protected]>
github-actions bot pushed a commit that referenced this pull request May 12, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request May 12, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Signed-off-by: Thien Nguyen <[email protected]>
github-actions bot pushed a commit that referenced this pull request May 12, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

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

A few comments. Still review in progress.

Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

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

Finally finished :) Have put some comments.

github-actions bot pushed a commit that referenced this pull request May 19, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request May 19, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @1tnguyen.

github-actions bot pushed a commit that referenced this pull request May 21, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@1tnguyen 1tnguyen merged commit df4609e into NVIDIA:main May 21, 2025
196 of 197 checks passed
github-actions bot pushed a commit that referenced this pull request May 21, 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.

2 participants