Skip to content

Conversation

muraj
Copy link
Contributor

@muraj muraj commented Sep 15, 2025

No description provided.

Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@1674659). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/realm/inst_impl.cc 6.66% 14 Missing ⚠️
src/realm/mem_impl.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #300   +/-   ##
=======================================
  Coverage        ?   26.63%           
=======================================
  Files           ?      188           
  Lines           ?    39022           
  Branches        ?    14222           
=======================================
  Hits            ?    10393           
  Misses          ?    27642           
  Partials        ?      987           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@muraj muraj self-assigned this Sep 15, 2025
@muraj muraj requested a review from lightsighter September 15, 2025 21:41
@lightsighter
Copy link
Contributor

Is there a reason to introduce a new method call and not just make the old API start returning an event? Overhead of triggering an event for an instance destruction should be very low.

@muraj
Copy link
Contributor Author

muraj commented Sep 16, 2025

Triggering should be low, but I worry about creating an event on destroy. I didn't want to inadvertently regress perf on a heavily utilized call. I could go with returning an event, but I don't know what to tell QA to run to verify this isn't an issue. Was hoping you might have some insight?

I still need to write tests for this change, so it's technically not done yet, but wanted a quick check to verify the concept.

@lightsighter
Copy link
Contributor

I could go with returning an event, but I don't know what to tell QA to run to verify this isn't an issue.

Run the Legate performance test suite. It should be fairly representative of at least some interesting workloads.

Was hoping you might have some insight?

My intuition is that we should just always return an event. Even if the instance creation/deletion is on the critical path, the cost of triggering the event will be significantly lower than the cost of running through a memory allocator to make the instance (e.g. Realm's allocator or cudaMalloc, etc.). I don't expect to see any performance regression from returning an event all the time.

@muraj muraj force-pushed the cperry/inst-destroy-event branch 2 times, most recently from 09621a2 to fc0fc3b Compare September 16, 2025 19:49
@muraj
Copy link
Contributor Author

muraj commented Sep 16, 2025

@lightsighter updated to always return an event. It'll not create a destroy event if wait_on is Event::NO_EVENT, and just return Event::NO_EVENT in that case, which is always triggered, as a small optimization. I can go deeper and only do this when the wait_on event is triggered, but I'm not sure it's worth it.

@lightsighter
Copy link
Contributor

lightsighter commented Sep 16, 2025

It'll not create a destroy event if wait_on is Event::NO_EVENT, and just return Event::NO_EVENT in that case, which is always triggered, as a small optimization. I can go deeper and only do this when the wait_on event is triggered, but I'm not sure it's worth it.

I think that is perfectly fine and compliant with the Realm API. Presumably though I'll still get an actual event back if I do a destroy with a NO_EVENT as a precondition if I issue the destroy on a remote node from where the instance lives and a message needs to be sent to the owner node to do the actual destroy right? The event will trigger after the message has made it to the owner node and been applied.

@muraj
Copy link
Contributor Author

muraj commented Sep 17, 2025

if I issue the destroy on a remote node

Ah, hm, no, I'll have to add that.

@github-actions github-actions bot added the chore label Sep 18, 2025
@muraj muraj force-pushed the cperry/inst-destroy-event branch 7 times, most recently from 84dd938 to 2751484 Compare September 25, 2025 22:23
inst: add inst destroy waits to tutorials
inst: add destroy events for examples
inst: add waits for inst destruction in all benchmarks
@muraj muraj force-pushed the cperry/inst-destroy-event branch from 2751484 to 3366af8 Compare September 25, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants