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

Fixing attribute name in the ExecutableImage class and adding an event to BufferInstance #235

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

ajakovljevicTT
Copy link
Contributor

@ajakovljevicTT ajakovljevicTT commented Feb 5, 2025

My previous merge had an error in the naming of num_addressable_devices attribute, so this PR changes that. In addition, the multichip xla execution requires that the BufferInstance has a ready_event, even if it now used used, so I also added this in this PR.

Copy link

github-actions bot commented Feb 5, 2025

TestsPassed ✅Skipped ⚠️Failed
TT-XLA Tests479 ran392 passed87 skipped0 failed
TestResult
No test annotations available

@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.23%. Comparing base (35cce74) to head (bda3248).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/common/pjrt_implementation/buffer_instance.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #235      +/-   ##
==========================================
- Coverage   77.46%   77.23%   -0.23%     
==========================================
  Files          21       21              
  Lines        1025     1028       +3     
==========================================
  Hits          794      794              
- Misses        231      234       +3     

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

@ajakovljevicTT ajakovljevicTT changed the title Fixing attribute name in the ExecutableImage class Fixing attribute name in the ExecutableImage class and adding an event to BufferInstance Feb 5, 2025
@ajakovljevicTT ajakovljevicTT merged commit e5f7ece into main Feb 6, 2025
6 checks passed
@ajakovljevicTT ajakovljevicTT deleted the ajakovljevic/naming_fix branch February 6, 2025 11:05
@@ -131,6 +131,9 @@ void BufferInstance::BindApi(PJRT_Api *api) {
api->PJRT_Buffer_ReadyEvent =
+[](PJRT_Buffer_ReadyEvent_Args *args) -> PJRT_Error * {
DLOG_F(LOG_DEBUG, "BufferInstance::PJRT_Buffer_ReadyEvent");
BufferInstance *buffer = BufferInstance::Unwrap(args->buffer);
buffer->on_ready_event_ = new EventInstance();
Copy link
Contributor

Choose a reason for hiding this comment

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

@ajakovljevicTT Everytime you write a naked new you should have a really good reason. This will cause a memory leak since you are not deleting it in BufferInstance destructor, forgetting to do so is the main reason to avoid using naked new :) Can you please fix this with changes in #220?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, will fix it in the aforementioned PR

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad, I've just found out that PJRT API callers are responsible with destroying events, though we should still avoid using naked new, I will add further comments in #220

sdjukicTT added a commit that referenced this pull request Feb 12, 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.

5 participants