Move warp scoped stream to a new model that uses warp blocking streams.#1771
Move warp scoped stream to a new model that uses warp blocking streams.#1771coreyjadams wants to merge 5 commits into
Conversation
This prevents premature garbage collection and illegal memory access.
Greptile SummaryThis PR introduces
Important Files Changed
|
peterdsharpe
left a comment
There was a problem hiding this comment.
Good find, and nice design! We'll have to be vigilant that we remember to use this on any new Warp-backend functionals. Maybe worth adding a sentence to FUNCTIONAL_APIS.md to this effect, beyond the example-change you did? This is also fine as-is though.
ktangsali
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for the explainer session and walkthrough
|
/ok to test 98d23f1 |
This prevents premature garbage collection and illegal memory access.
The root cause of our issues:
The issues we see are things like the BVH structures, which create temporary objects on the GPU, would have components go out of scope in python and be garbage collected before the GPU kernel completes because it's async execution. In pytorch, this is handled by event syncs: you can keep the GPU objects alive until a certain event has occurred, but warp will automatically handle this with the blocking streams.
The solution from Lukasz on the warp team is so simple we're all kicking ourselves for not thinking of it earlier
This PR codifies this as a new context scope that wraps Warp's stream scope. Using this, the SDF now works again in the GeoTransolver Datapipe!
I moved ALL our functionals over to this scope in this PR, which is why many files have been touch, since it should be exclusively safer without a performance impact. (Blocking stream != host blocking. It's a GPU stream block, not a full GPU sync).
PhysicsNeMo Pull Request
Description
Checklist
Dependencies
Review Process
All PRs are reviewed by the PhysicsNeMo team before merging.
Depending on which files are changed, GitHub may automatically assign a maintainer for review.
We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.
AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.